Skip to content

Commit

Permalink
rebase-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FinnStutzenstein committed Aug 17, 2020
1 parent 0e8888f commit 3a3c444
Show file tree
Hide file tree
Showing 12 changed files with 1,881 additions and 731 deletions.
2,535 changes: 1,839 additions & 696 deletions client/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Mediafile } from 'app/shared/models/mediafiles/mediafile';
import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile';
import { BaseIsListOfSpeakersContentObjectRepository } from '../base-is-list-of-speakers-content-object-repository';
import { RepositoryServiceCollector } from '../repository-service-collector';
import { HttpService } from 'app/core/core-services/http.service';

/**
* Repository for MediaFiles
Expand All @@ -22,7 +23,7 @@ import { RepositoryServiceCollector } from '../repository-service-collector';
export class MediafileRepositoryService extends BaseIsListOfSpeakersContentObjectRepository<ViewMediafile, Mediafile> {
private directoryBehaviorSubject: BehaviorSubject<ViewMediafile[]>;

public constructor(repositoryServiceCollector: RepositoryServiceCollector) {
public constructor(repositoryServiceCollector: RepositoryServiceCollector, private http: HttpService) {
super(repositoryServiceCollector, Mediafile);
this.directoryBehaviorSubject = new BehaviorSubject([]);
this.getViewModelListObservable().subscribe(mediafiles => {
Expand Down Expand Up @@ -108,14 +109,14 @@ export class MediafileRepositoryService extends BaseIsListOfSpeakersContentObjec
public async uploadFile(file: any): Promise<Identifiable> {
const emptyHeader = new HttpHeaders();
throw new Error('TODO');
// return this.httpService.post<Identifiable>('/rest/mediafiles/mediafile/', file, {}, emptyHeader);
// return this.http.post<Identifiable>('/rest/mediafiles/mediafile/', file, {}, emptyHeader);
}

public async downloadArchive(archiveName: string, files: ViewMediafile[]): Promise<void> {
const zip = new JSZip();
for (const file of files) {
if (!file.is_directory) {
const base64Data = await this.httpService.downloadAsBase64(file.url);
const base64Data = await this.http.downloadAsBase64(file.url);
zip.file(file.filename, base64Data, { base64: true });
}
}
Expand All @@ -128,7 +129,7 @@ export class MediafileRepositoryService extends BaseIsListOfSpeakersContentObjec
}

public async move(mediafiles: ViewMediafile[], directoryId: number | null): Promise<void> {
// return await this.httpService.post('/rest/mediafiles/mediafile/move/', {
// return await this.http.post('/rest/mediafiles/mediafile/move/', {
// ids: mediafiles.map(mediafile => mediafile.id),
// directory_id: directoryId
// });
Expand All @@ -141,7 +142,7 @@ export class MediafileRepositoryService extends BaseIsListOfSpeakersContentObjec
* @param mediafiles The users to delete
*/
public async bulkDelete(mediafiles: ViewMediafile[]): Promise<void> {
// await this.httpService.post('/rest/mediafiles/mediafile/bulk_delete/', {
// await this.http.post('/rest/mediafiles/mediafile/bulk_delete/', {
// ids: mediafiles.map(mediafile => mediafile.id)
// });
throw new Error('TODO');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class TopicRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCon
};

public getListTitle = (topic: ViewTopic) => {
if (topic.agenda_item_number && topic.agenda_item_number()) {
return `${topic.agenda_item_number()} · ${topic.title}`;
if (topic.agenda_item && topic.agenda_item.item_number) {
return `${topic.agenda_item.item_number} · ${topic.title}`;
} else {
return this.getTitle(topic);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';

import { ServertimeService } from 'app/core/core-services/servertime.service';
import { ConfigService } from 'app/core/ui-services/config.service';
import { FontConfigObject } from 'app/core/ui-services/media-manage.service';

declare let FontFace: any;
Expand Down Expand Up @@ -96,10 +95,10 @@ export class CountdownTimeComponent implements OnInit, OnDestroy {
return this._countdown;
}

public constructor(private servertimeService: ServertimeService, private configService: ConfigService) {}
public constructor(private servertimeService: ServertimeService) {}

public ngOnInit(): void {
this.configService.get<FontConfigObject>('font_monospace').subscribe(font => {
/*this.configService.get<FontConfigObject>('font_monospace').subscribe(font => {
if (font) {
const customFont = new FontFace('OSFont Monospace', `url(${font.path || font.default})`);
customFont
Expand All @@ -111,7 +110,8 @@ export class CountdownTimeComponent implements OnInit, OnDestroy {
console.log(error);
});
}
});
});*/
console.error("TODO");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export class AssignmentDetailComponent extends BaseModelContextComponent impleme
*
* @param candidate A ViewAssignmentUser currently in the list of related users
*/
public async removeUser(candidate: ViewAssignmentRelatedUser): Promise<void> {
public async removeUser(candidate: ViewAssignmentCandidate): Promise<void> {
await this.repo.changeCandidate(candidate.user.id, this.assignment, false).catch(this.raiseError);
}

Expand Down Expand Up @@ -422,7 +422,7 @@ export class AssignmentDetailComponent extends BaseModelContextComponent impleme
this.candidatesForm.valueChanges.subscribe(formResult => {
// resetting a form triggers a form.next(null) - check if data is present
if (formResult && formResult.userId) {
this.addUserAsCandidate(formResult.userId);
this.addUser(formResult.userId);
this.candidatesForm.setValue({ userId: null });
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ <h2>{{ 'Home' | translate }}</h2>
</div>
</os-head-bar>

<button type="button" mat-button (click)="t()">TEST</button>

<mat-card class="spacer-bottom-60" [ngClass]="isEditing ? 'os-form-card' : 'os-card'">
<ng-container *ngIf="!isEditing">
<div class="app-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,24 @@ export class AmendmentCreateWizardComponent extends BaseComponent implements OnI
return null;
}
});
const newMotionValues = {
throw new Error("TODO");
/*const newMotionValues = {
...this.contentForm.value,
title: this.translate.instant('Amendment to') + ' ' + this.motion.getIdentifierOrTitle(),
text: text, // Workaround as 'text' is required from the backend
parent_id: this.motion.id,
category_id: this.motion.category_id,
tag_ids: this.motion.tag_ids,
motion_block_id: this.motion.motion_block_id,
motion_block_id: this.motion.block_id,
amendment_paragraphs: amendedParagraphs,
workflow_id: this.configService.instant<number>('motions_amendments_workflow')
// TODO
// workflow_id: this.configService.instant<number>('motions_amendments_workflow')
};
const motion = new CreateMotion();
motion.deserialize(newMotionValues);
const response = await this.repo.create(motion);
this.router.navigate(['./motions/' + response.id]);
this.router.navigate(['./motions/' + response.id]);*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { MotionStatuteParagraphRepositoryService } from 'app/core/repositories/m
import { MotionWorkflowRepositoryService } from 'app/core/repositories/motions/motion-workflow-repository.service';
import { TagRepositoryService } from 'app/core/repositories/tags/tag-repository.service';
import { NewUser, UserRepositoryService } from 'app/core/repositories/users/user-repository.service';
import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service';
import { ComponentServiceCollector } from 'app/core/ui-services/component-service-collector';
import { DiffLinesInParagraph, LineRange } from 'app/core/ui-services/diff.service';
import { LinenumberingService } from 'app/core/ui-services/linenumbering.service';
Expand Down Expand Up @@ -718,11 +717,12 @@ export class MotionDetailComponent extends BaseModelContextComponent implements
tag_ids: parentMotion.tag_ids
});

const amendmentTextMode = this.configService.instant<string>('motions_amendments_text_mode');
throw new Error("TODO");
/*const amendmentTextMode = this.configService.instant<string>('motions_amendments_text_mode');
if (amendmentTextMode === 'fulltext') {
defaultMotion.text = parentMotion.text;
this.contentForm.patchValue({ text: defaultMotion.text });
}
}*/
}
this.motion = new ViewCreateMotion(new CreateMotion(defaultMotion));
}
Expand Down Expand Up @@ -1268,15 +1268,16 @@ export class MotionDetailComponent extends BaseModelContextComponent implements
* Goes to the amendment creation wizard. Executed via click.
*/
public createAmendment(): void {
const amendmentTextMode = this.configService.instant<string>('motions_amendments_text_mode');
if (amendmentTextMode === 'paragraph') {
throw new Error("TODO");
// const amendmentTextMode = this.configService.instant<string>('motions_amendments_text_mode');
/*if (amendmentTextMode === 'paragraph') {
this.router.navigate(['./create-amendment'], { relativeTo: this.route });
} else {
this.router.navigate(['./motions/new-amendment'], {
relativeTo: this.route.snapshot.params.relativeTo,
queryParams: { parent: this.motion.id || null }
});
}
}*/
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { map } from 'rxjs/operators';
import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service';
import { ComponentServiceCollector } from 'app/core/ui-services/component-service-collector';
import { BaseComponent } from 'app/site/base/components/base.component';
import { ViewBasePoll } from 'app/site/polls/models/view-base-poll';
import { BaseViewPoll } from '../../models/base-view-poll';
import { ActiveMeetingService } from 'app/core/core-services/active-meeting.service';

@Component({
selector: 'os-poll-progress',
Expand All @@ -14,7 +15,7 @@ import { ViewBasePoll } from 'app/site/polls/models/view-base-poll';
})
export class PollProgressComponent extends BaseComponent implements OnInit {
@Input()
public poll: ViewBasePoll;
public poll: BaseViewPoll;
public max: number;

public get votescast(): number {
Expand All @@ -23,7 +24,8 @@ export class PollProgressComponent extends BaseComponent implements OnInit {

public constructor(
componentServiceCollector: ComponentServiceCollector,
private userRepo: UserRepositoryService
private userRepo: UserRepositoryService,
private activeMeetingService: ActiveMeetingService,
) {
super(componentServiceCollector);
}
Expand All @@ -36,7 +38,10 @@ export class PollProgressComponent extends BaseComponent implements OnInit {
.pipe(
map(users =>
users.filter(
user => user.is_present && this.poll.groups_id.intersect(user.groups_id).length
user =>
user.isPresentInMeeting &&
this.poll.entitled_group_ids.intersect(user.group_ids(this.activeMeetingService.meetingId)).length

)
)
)
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/site/polls/services/poll.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ export abstract class PollService {
return data;
}

protected getPollDataFields(poll: PollData | ViewBasePoll): CalculablePollKey[] {
const isAssignment: boolean = (poll as ViewBasePoll).pollClassType === 'assignment';
protected getPollDataFields(poll: PollData | BaseViewPoll): CalculablePollKey[] {
const isAssignment: boolean = (poll as BaseViewPoll).pollClassType === 'assignment';
return isAssignment ? this.getPollDataFieldsByMethod(poll) : this.getPollDataFieldsByPercentBase(poll);
}

private getPollDataFieldsByMethod(poll: PollData | ViewBasePoll): CalculablePollKey[] {
private getPollDataFieldsByMethod(poll: PollData | BaseViewPoll): CalculablePollKey[] {
switch (poll.pollmethod) {
case AssignmentPollMethod.YNA: {
return ['yes', 'no', 'abstain'];
Expand All @@ -348,7 +348,7 @@ export abstract class PollService {
}
}

private getPollDataFieldsByPercentBase(poll: PollData | ViewBasePoll): CalculablePollKey[] {
private getPollDataFieldsByPercentBase(poll: PollData | BaseViewPoll): CalculablePollKey[] {
switch (poll.onehundred_percent_base) {
case PercentBase.YN: {
return ['yes', 'no'];
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/site/topics/models/view-topic.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SearchRepresentation } from 'app/core/ui-services/search.service';
import { Topic } from 'app/shared/models/topics/topic';
import { HasAgendaItem, ViewAgendaItem } from 'app/site/agenda/models/view-agenda-item';
import { HasListOfSpeakers, ViewListOfSpeakers } from 'app/site/agenda/models/view-list-of-speakers';
import { BaseProjectableViewModel } from 'app/site/base/base-projectable-view-model';
import { ProjectorElementBuildDeskriptor } from 'app/site/base/projectable';
import { ViewMeeting } from 'app/site/event-management/models/view-meeting';
import { HasAttachment, ViewMediafile } from 'app/site/mediafiles/models/view-mediafile';
import { HasTags, ViewTag } from 'app/site/tags/models/view-tag';
import { HasAgendaItem } from 'app/site/agenda/models/view-agenda-item';

/**
* Provides "safe" access to topic with all it's components
Expand Down
2 changes: 1 addition & 1 deletion client/src/assets/styles/component-themes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $narrow-spacing: (
@import './app/site/common/components/super-search/super-search.component.scss';
@import './app/shared/components/rounded-input/rounded-input.component.scss';
@import './app/shared/components/meta-text-block/meta-text-block.component.scss';
@import './app/site/settings/components/settings-field/settings-field.component.scss-theme.scss';
@import './app/site/meeting-settings/components/meeting-settings-field/meeting-settings-field.component.scss-theme.scss';
@import './app/site/motions/modules/motion-detail/components/amendment-create-wizard/amendment-create-wizard.components.scss-theme.scss';
@import './app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.scss-theme.scss';
@import './app/shared/components/banner/banner.component.scss-theme.scss';
Expand Down

0 comments on commit 3a3c444

Please sign in to comment.