Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 2934-mdc-table
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed May 23, 2024
2 parents 72057e3 + 92c61e1 commit 5525236
Show file tree
Hide file tree
Showing 20 changed files with 68 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Id } from 'src/app/domain/definitions/key-types';
import { Permission } from 'src/app/domain/definitions/permission';
import { VoteControllerService } from 'src/app/site/pages/meetings/modules/poll/services/vote-controller.service';
import { VotingService } from 'src/app/site/pages/meetings/modules/poll/services/voting.service';
import { HistoryService } from 'src/app/site/pages/meetings/pages/history/services/history.service';
import { ViewPoll } from 'src/app/site/pages/meetings/pages/polls';
import { ActiveMeetingService } from 'src/app/site/pages/meetings/services/active-meeting.service';
import { ActivePollsService } from 'src/app/site/pages/meetings/services/active-polls.service';
Expand Down Expand Up @@ -34,7 +33,6 @@ export class VotingBannerService {
public constructor(
private banner: BannerService,
private translate: TranslateService,
private historyService: HistoryService,
private votingService: VotingService,
private activeMeeting: ActiveMeetingService,
private sendVotesService: VoteControllerService,
Expand Down Expand Up @@ -72,8 +70,8 @@ export class VotingBannerService {
this.pollsToVote = [];
}

// display no banner if in history mode or there are no polls to vote
if ((this.historyService.isInHistoryMode() && this.currentBanner) || !this.pollsToVote.length) {
// display no banner if no polls to vote
if (!this.pollsToVote.length) {
this.sliceBanner();
return;
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@
</ng-container>

<mat-header-row *matHeaderRowDef="getRowDef()"></mat-header-row>
<mat-row
[ngClass]="{ 'links-disabled': !isSuperadmin }"
*matRowDef="let row; columns: getRowDef()"
(click)="onClickRow(row)"
></mat-row>
<mat-row *matRowDef="let row; columns: getRowDef()"></mat-row>
</mat-table>
</mat-card-content>
</mat-card>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
}

.os-headed-listview-table {
.links-disabled {
pointer-events: none;
mat-row:hover {
cursor: auto;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Observable, Subject } from 'rxjs';
import { Collection, Fqid, Id } from 'src/app/domain/definitions/key-types';
import { OML } from 'src/app/domain/definitions/organization-permission';
import { Selectable } from 'src/app/domain/interfaces';
import { isDetailNavigable } from 'src/app/domain/interfaces/detail-navigable';
import { BaseModel } from 'src/app/domain/models/base/base-model';
import { HistoryPosition, HistoryPresenterService } from 'src/app/gateways/presenter/history-presenter.service';
import { SearchDeletedModelsPresenterService } from 'src/app/gateways/presenter/search-deleted-models-presenter.service';
Expand All @@ -28,8 +27,6 @@ import { ViewModelStoreService } from 'src/app/site/services/view-model-store.se

import { ViewMotionState } from '../../../motions';
import { ParticipantControllerService } from '../../../participants/services/common/participant-controller.service';
import { Position } from '../../definitions';
import { HistoryService } from '../../services/history.service';

const HISTORY_SUBSCRIPTION_PREFIX = `history`;

Expand Down Expand Up @@ -109,7 +106,6 @@ export class HistoryListComponent extends BaseMeetingComponent implements OnInit
private historyPresenter: HistoryPresenterService,
private searchDeletedModelsPresenter: SearchDeletedModelsPresenterService,
private operator: OperatorService,
private historyService: HistoryService,
private motionRepo: MotionRepositoryService,
private assignmentRepo: AssignmentRepositoryService,
private userRepo: ParticipantControllerService,
Expand Down Expand Up @@ -247,26 +243,6 @@ export class HistoryListComponent extends BaseMeetingComponent implements OnInit
return [`time`, `info`, `user`];
}

/**
* Click handler for rows in the history table.
* Serves as an entry point for the time travel routine
*/
public async onClickRow(position: Position): Promise<void> {
if (!this.operator.hasOrganizationPermissions(OML.superadmin)) {
return;
}

await this.historyService.enterHistoryMode(this.currentFqid, position);
const [collection, id] = collectionIdFromFqid(this.currentFqid);
const element = this.viewModelStore.get(collection, id);
if (element && isDetailNavigable(element)) {
this.router.navigate([element.getDetailStateUrl()]);
} else {
const message = this.translate.instant(`Cannot navigate to the selected history element.`);
this.raiseError(message);
}
}

public refresh(): void {
if (this.currentFqid) {
this.queryByFqid(this.currentFqid);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { SearchSelectorModule } from 'src/app/ui/modules/search-selector';
import { PipesModule } from 'src/app/ui/pipes';

import { ParticipantCommonServiceModule } from '../participants/services/common/participant-common-service.module';
import { HistoryBannerComponent } from './components/history-banner/history-banner.component';
import { HistoryListComponent } from './components/history-list/history-list.component';
import { HistoryMainComponent } from './components/history-main/history-main.component';
import { HistoryRoutingModule } from './history-routing.module';
Expand All @@ -41,6 +40,6 @@ import { HistoryRoutingModule } from './history-routing.module';
ParticipantCommonServiceModule,
PipesModule
],
declarations: [HistoryListComponent, HistoryMainComponent, HistoryBannerComponent]
declarations: [HistoryListComponent, HistoryMainComponent]
})
export class HistoryModule {}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ <h1 mat-dialog-title>{{ 'Export motions' | translate }}</h1>
<mat-button-toggle *osPerms="permission.listOfSpeakersCanSee" value="speakers" #speakersButton>
<span>{{ 'Speakers' | translate }}</span>
</mat-button-toggle>
<mat-button-toggle
*ngIf="workingGroupSpeakerActive"
value="working_group_speakers"
#workingGroupSpeakerButton
>
<span>{{ 'Spokesperson' | translate }}</span>
</mat-button-toggle>
<mat-button-toggle value="polls" #votingResultButton>
<span>{{ 'Voting result' | translate }}</span>
</mat-button-toggle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn
*/
public exportForm!: UntypedFormGroup;

public workingGroupSpeakerActive: boolean;

/**
* Store the subject to the ViewMotionCommentSection
*/
Expand Down Expand Up @@ -109,6 +111,12 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn
@ViewChild(`speakersButton`)
public speakersButton!: MatButtonToggle;

/**
* To deactivate the working group button.
*/
@ViewChild(`workingGroupSpeakerButton`)
public workingGroupSpeakerButton!: MatButtonToggle;

/**
* To deactivate the toc button.
*/
Expand Down Expand Up @@ -137,6 +145,7 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn
super();
this.defaults.lnMode = this.meetingSettingsService.instant(`motions_default_line_numbering`)!;
this.defaults.crMode = this.meetingSettingsService.instant(`motions_recommendation_text_mode`)!;
this.workingGroupSpeakerActive = this.meetingSettingsService.instant(`motions_enable_working_group_speaker`)!;
this.commentsSubject = this.commentRepo.getViewModelListObservable();
if (this.meetingSettingsService.instant(`motions_show_sequential_number`)) {
this.defaults.metaInfo!.push(`id`);
Expand Down Expand Up @@ -173,9 +182,15 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn
if (format === ExportFileFormat.XLSX) {
this.disableControl(`content`);
this.changeStateOfButton(this.speakersButton, false);
if (this.workingGroupSpeakerButton) {
this.changeStateOfButton(this.workingGroupSpeakerButton, false);
}
} else {
this.enableControl(`content`);
this.changeStateOfButton(this.speakersButton, true);
if (this.workingGroupSpeakerButton) {
this.changeStateOfButton(this.workingGroupSpeakerButton, true);
}
}

if (format === ExportFileFormat.CSV || format === ExportFileFormat.XLSX) {
Expand Down Expand Up @@ -287,6 +302,10 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn
// restore selection or set default
this.store.get<MotionExportInfo>(`motion_export_selection`).then(restored => {
if (restored) {
if (!this.workingGroupSpeakerActive && restored.metaInfo?.includes(`working_group_speakers`)) {
restored.metaInfo.splice(restored.metaInfo.indexOf(`working_group_speakers`));
}

this.exportForm.patchValue(restored);
} else {
this.exportForm.patchValue(this.defaults);
Expand Down
Loading

0 comments on commit 5525236

Please sign in to comment.