Skip to content

Commit

Permalink
Merge main into stable/4.0.x. Update 20231123
Browse files Browse the repository at this point in the history
* commit '8b36d05f8bf4f192ab3be28f65c936d878a9b06f':
  Update nanocosmos url (#3041)
  Update material radio-buttons (#3001)
  Fix multiselect motion move in agenda (#3036)
  Fix projector header height (#3031)
  Remove alternating colour in global search (#3039)
  Cache search term from global search (#3032)
  Global search improvements (#3013)
  Fix vote weight 0 not displayed (#3034)
  Motion detail run change reco on motion id change (#3000)
  Update getTitle of speaker with deleted user (#2895)
  Fix topic poll create after meeting create (#3026)
  Add tests to connection-status service (#3003)
  Migrate mdc tooltips (#2999)
  Add tests to auth-token service (#3027)
  Add tests to fallback-routes service (#3022)
  Fix cr projection with start_line_number set (#3020)
  Fix amendment slide line numbering (#3018)
  Bump tinymce from 5.10.8 to 5.10.9 in /client (#3016)
  • Loading branch information
m-schieder committed Nov 23, 2023
2 parents d63f24b + 8b36d05 commit 22d1c77
Show file tree
Hide file tree
Showing 83 changed files with 407 additions and 169 deletions.
14 changes: 7 additions & 7 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"qrcode": "^1.5.3",
"rxjs": "^7.8.1",
"tinycolor2": "1.4.2",
"tinymce": "^5.10.8",
"tinymce": "^5.10.9",
"ts-dedent": "^2.2.0",
"tslib": "^2.3.0",
"tsparticles": "~1.42.4",
Expand Down
2 changes: 2 additions & 0 deletions client/src/app/domain/models/users/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class Group extends BaseModel<Group> {
public assignment_poll_ids!: Id[]; // (assignment_poll/entitled_group_ids)[];
public used_as_motion_poll_default_id!: Id; // meeting/motion_poll_default_group_ids;
public used_as_assignment_poll_default_id!: Id; // meeting/assignment_poll_default_group_ids;
public used_as_topic_poll_default_id!: Id; // meeting/topic_poll_default_group_ids;

public get isAdminGroup(): boolean {
return !!this.admin_group_for_meeting_id;
Expand Down Expand Up @@ -58,6 +59,7 @@ export class Group extends BaseModel<Group> {
`write_chat_group_ids`,
`used_as_motion_poll_default_id`,
`used_as_assignment_poll_default_id`,
`used_as_topic_poll_default_id`,
`meeting_id`
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyProgressBarModule as MatProgressBarModule } from '@angular/material/legacy-progress-bar';
import { MatLegacySnackBarModule as MatSnackBarModule } from '@angular/material/legacy-snack-bar';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';

import { ProgressSnackBarComponent } from './components/progress-snack-bar/progress-snack-bar.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export class SpeakerRepositoryService extends BaseMeetingRelatedRepository<ViewS

public getVerboseName = (plural = false) => this.translate.instant(plural ? `Speakers` : `Speaker`);

public getTitle = (viewSpeaker: ViewSpeaker) => (viewSpeaker.user ? viewSpeaker.user.getFullName() : ``);
public getTitle = (viewSpeaker: ViewSpeaker) =>
viewSpeaker.user ? viewSpeaker.user.getFullName() : this.translate.instant(`Deleted user`);

public create(
listOfSpeakers: ListOfSpeakers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ export const RELATIONS: Relation[] = [
OField: `assignment_poll_default_groups`,
MField: `used_as_assignment_poll_default`
}),
...makeM2O({
OViewModel: ViewMeeting,
MViewModel: ViewGroup,
OField: `topic_poll_default_groups`,
MField: `used_as_topic_poll_default`
}),
...makeM2O({
OViewModel: ViewMeeting,
MViewModel: ViewPointOfOrderCategory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

<mat-dialog-content class="search-results">
<ng-container *ngIf="searching === null">
<section class="search-results-category alternating-list">
<div *ngFor="let result of filteredResults" class="search-results-entry">
<section class="search-results-category">
<div *ngFor="let result of filteredResults" class="search-results-entry divider-bottom">
<div class="breadcrumb">
<ng-container *ngIf="result.committee">
<span>{{ result.committee.name }}</span>
Expand All @@ -50,9 +50,19 @@
</span>
</div>
<ng-container [ngSwitch]="result.collection">
<a *ngSwitchCase="'mediafile'" [href]="result.url" target="blank" mat-dialog-close>
<h3 *ngIf="result.title" [innerHtml]="result.title"></h3>
</a>
<ng-container *ngSwitchCase="'mediafile'">
<a
*ngIf="result.url.startsWith('/system')"
[href]="result.url"
target="_blank"
mat-dialog-close
>
<h3 *ngIf="result.title" [innerHtml]="result.title"></h3>
</a>
<a *ngIf="!result.url.startsWith('/system')" [routerLink]="result.url" mat-dialog-close>
<h3 *ngIf="result.title" [innerHtml]="result.title"></h3>
</a>
</ng-container>
<a *ngSwitchCase="'motion'" [routerLink]="result.url" mat-dialog-close>
<h3 *ngIf="result.title">
<span *ngIf="result.obj?.number" [innerHTML]="result.obj?.number + ': '"></span>
Expand All @@ -70,6 +80,11 @@ <h3 *ngIf="result.title">
</span>
</div>
<p *ngIf="result.text" class="text-snippet" [innerHtml]="getTextSnippet(result.text)"></p>
<p
*ngIf="!result.text && result.obj?.amendment_paragraphs"
class="text-snippet"
[innerHtml]="getTextSnippet(result.obj.amendment_paragraphs)"
></p>
</a>
<a *ngSwitchDefault [routerLink]="result.url" mat-dialog-close>
<h3 *ngIf="result.title" [innerHtml]="result.title"></h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,24 @@ import { OperatorService } from 'src/app/site/services/operator.service';
changeDetection: ChangeDetectionStrategy.OnPush
})
export class GlobalSearchComponent implements OnDestroy {
public searchTerm = ``;
private static _searchTerm = ``;

public get searchTerm(): string {
return GlobalSearchComponent._searchTerm;
}

public set searchTerm(input: string) {
GlobalSearchComponent._searchTerm = input;
}

public noResults = false;

private static _filteredResults: GlobalSearchEntry[] = [];

public get filteredResults(): GlobalSearchEntry[] {
return GlobalSearchComponent._filteredResults;
}

public readonly availableFilters = {
meeting: _(`Meeting`),
committee: _(`Committee`),
Expand All @@ -36,21 +51,20 @@ export class GlobalSearchComponent implements OnDestroy {
meetingFilter: this.activeMeeting.meetingId ? `current` : `all`
});

public filteredResults: GlobalSearchEntry[] = [];
public inMeeting = !!this.activeMeeting.meetingId;

public get resultCount(): number {
return this.results.length;
}

public get filteredResultCount(): number {
return this.filteredResults.length;
return GlobalSearchComponent._filteredResults.length;
}

public searching: number | null = null;

private results: GlobalSearchEntry[] = [];
private models: GlobalSearchResponse;
private static models: GlobalSearchResponse;

private filterChangeSubscription: Subscription;

Expand All @@ -65,7 +79,7 @@ export class GlobalSearchComponent implements OnDestroy {
this.filterChangeSubscription = this.currentFilters.valueChanges
.pipe(startWith(this.currentFilters.value), pairwise())
.subscribe(() => {
if (this.searchTerm) {
if (GlobalSearchComponent._searchTerm) {
this.searchChange();
}
});
Expand Down Expand Up @@ -96,14 +110,14 @@ export class GlobalSearchComponent implements OnDestroy {
? [`meeting`]
: this.selectedFilters();
const search = await this.globalSearchService.searchChange(
this.searchTerm,
GlobalSearchComponent._searchTerm,
filters,
this.currentlyAvailableFilters,
searchMeeting
);
if (this.searching === searchId) {
this.results = search.resultList;
this.models = search.models;
GlobalSearchComponent.models = search.models;
this.updateFilteredResults();
}
} catch (e) {
Expand All @@ -119,7 +133,7 @@ export class GlobalSearchComponent implements OnDestroy {
}

public getModel(model: string, id: Id): any | null {
return this.models[`${model}/${id}`] || null;
return GlobalSearchComponent.models[`${model}/${id}`] || null;
}

public getNamesBySubmitters(submitters: Id[]): string[] {
Expand All @@ -135,7 +149,18 @@ export class GlobalSearchComponent implements OnDestroy {
return submitterNames;
}

public getTextSnippet(text: string): string {
public getTextSnippet(input: string | { [key: number]: string }): string {
let text: string;
if (typeof input !== `string`) {
try {
text = Object.values(input).join(`\n`);
} catch (e) {
text = ``;
}
} else {
text = input;
}

const textSnippetSize = 180;
const removeTags = /<\/?(?!(?:mark)\b)[^/>]+>/g;
let resultText = ``;
Expand Down Expand Up @@ -201,7 +226,7 @@ export class GlobalSearchComponent implements OnDestroy {
}

private updateFilteredResults(): void {
this.filteredResults = [];
GlobalSearchComponent._filteredResults = [];
let allUnchecked = true;
for (const filter of this.currentlyAvailableFilters) {
if (this.currentFilters.get(filter) && this.currentFilters.get(filter).getRawValue()) {
Expand All @@ -213,19 +238,18 @@ export class GlobalSearchComponent implements OnDestroy {
const collection = result.collection;
if (this.currentFilters.get(`meetingFilter`).getRawValue() === `meetings`) {
if (collection === `meeting` || collection === `committee`) {
this.filteredResults.push(result);
GlobalSearchComponent._filteredResults.push(result);
}
} else {
if (
allUnchecked ||
(this.currentFilters.get(collection) && this.currentFilters.get(collection).getRawValue())
) {
this.filteredResults.push(result);
GlobalSearchComponent._filteredResults.push(result);
}
}
}

this.noResults = !Object.keys(this.filteredResults).length;
this.noResults = !Object.keys(GlobalSearchComponent._filteredResults).length;
}

private updateCurrentlyAvailableFilters(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/lega
import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner';
import { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatRadioModule } from '@angular/material/radio';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { RouterModule } from '@angular/router';
import { DirectivesModule } from 'src/app/ui/directives';
import { CommaSeparatedListingModule } from 'src/app/ui/modules/comma-separated-listing';
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/site/modules/info/info.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { EditorModule } from 'src/app/ui/modules/editor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/materia
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { IconContainerModule } from 'src/app/ui/modules/icon-container';

import { OpenSlidesTranslationModule } from '../../../site/modules/translations/openslides-translation.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-c
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyListModule as MatListModule } from '@angular/material/legacy-list';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { SortingListModule } from 'src/app/ui/modules/sorting/modules/sorting-list/sorting-list.module';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card';
import { MatLegacyProgressSpinnerModule as MatProgressSpinnerModule } from '@angular/material/legacy-progress-spinner';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { RouterModule } from '@angular/router';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { HeadBarModule } from 'src/app/ui/modules/head-bar';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
import { ListModule } from 'src/app/ui/modules/list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/legacy-checkbox';
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog';
import { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatRadioModule } from '@angular/material/radio';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
import { MatLegacyChipsModule as MatChipsModule } from '@angular/material/legacy-chips';
import { MatLegacyMenuModule as MatMenuModule } from '@angular/material/legacy-menu';
import { MatLegacyTooltipModule as MatTooltipModule } from '@angular/material/legacy-tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { MatLegacyCheckboxModule as MatCheckboxModule } from '@angular/material/
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
import { MatLegacyProgressBarModule as MatProgressBarModule } from '@angular/material/legacy-progress-bar';
import { MatLegacyRadioModule as MatRadioModule } from '@angular/material/legacy-radio';
import { MatLegacySelectModule as MatSelectModule } from '@angular/material/legacy-select';
import { MatRadioModule } from '@angular/material/radio';
import { NgChartsModule } from 'ng2-charts';
import { OpenSlidesTranslationModule } from 'src/app/site/modules/translations';
import { DirectivesModule } from 'src/app/ui/directives';
Expand Down
Loading

0 comments on commit 22d1c77

Please sign in to comment.