Skip to content

Commit

Permalink
Fixed visibility of inactive attribute and hide filters (OpenSlides#3556
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rrenkert authored and bastianjoel committed May 22, 2024
2 parents d611b6e + 8d86099 commit 51c7d44
Show file tree
Hide file tree
Showing 160 changed files with 1,397 additions and 876 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/pick-to-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Cherry pick staging PRs merged into main

on:
pull_request_target:
types:
- closed
branches:
- 'main'


jobs:
create-pr-for-staging:
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'staging')
name: Create PR against staging branch
runs-on: ubuntu-latest

steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 2

- name: Fetch and checkout latest staging branch
run: |
branch=$(git ls-remote --heads origin 'staging/*' | awk 'gsub(".*refs/heads/","")' | sort -V | tail -1)
git fetch origin $branch
git checkout $branch
- name: Set git credentials
run: |
git config --global user.name openslides-automation
git config --global user.email [email protected]
- name: Cherry-pick new commit
id: cherry-pick
run: |
git fetch origin
# -m 1 to also be able to cherry-pick merge commits
git cherry-pick -m 1 ${{ github.sha }} || {
echo "error=1" >> $GITHUB_OUTPUT
git add .
git cherry-pick --continue
}
- name: Generate access token
uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.AUTOMATION_APP_ID }}
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}

- name: Create or update PR
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
branch: apply/commit-${{ github.sha }}
delete-branch: true
title: "[Cherry-Pick] ${{ github.event.pull_request.title }}"
body: "Triggered by commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})\n\n${{ steps.cherry-pick.outputs.error && 'There were conflicts during the cherry-pick. These were commited without any resolving. Please resolve them manually and push the result to this branch before merging.' || 'The cherry-pick was successful without any conflicts. You should be able to simply merge this PR.' }}"
reviewers: ${{ github.event.pull_request.user.login }}
assignees: ${{ github.event.pull_request.user.login }}
labels: picked-to-staging
milestone: 4
54 changes: 0 additions & 54 deletions .github/workflows/staging-to-main.yml

This file was deleted.

12 changes: 6 additions & 6 deletions client/package-lock.json

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

6 changes: 3 additions & 3 deletions client/src/app/domain/models/meetings/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ export class Settings {
public users_email_replyto!: string;
public users_email_subject!: string;
public users_email_body!: string;
public users_forbid_delegator_in_list_of_speakers!: string;
public users_forbid_delegator_as_submitter!: string;
public users_forbid_delegator_as_supporter!: string;
public users_forbid_delegator_in_list_of_speakers!: boolean;
public users_forbid_delegator_as_submitter!: boolean;
public users_forbid_delegator_as_supporter!: boolean;

// Assignments
public assignments_export_title!: string;
Expand Down
4 changes: 3 additions & 1 deletion client/src/app/domain/models/motions/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export class Motion extends BaseModel<Motion> implements MotionFormattingReprese
}

public amendment_paragraph_text(paragraphNumber: number): string | null {
return this.amendment_paragraphs[paragraphNumber] ?? null;
return this.amendment_paragraphs && this.amendment_paragraphs[paragraphNumber]
? this.amendment_paragraphs[paragraphNumber]
: null;
}

public static readonly REQUESTABLE_FIELDS: (keyof Motion)[] = [
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/gateways/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ export class Action<T = void> {
}
}

export const createEmptyAction = () => new Action(async () => []);
export const createEmptyAction = (): Action<any> => new Action(async () => []);
2 changes: 1 addition & 1 deletion client/src/app/gateways/base-icc-gateway.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export abstract class BaseICCGatewayService<ICCResponseType> {
msgSub.unsubscribe();
onClosedSub.unsubscribe();
});
this.connectionClosingFn = () => {
this.connectionClosingFn = (): void => {
onReastartSub.unsubscribe();
msgSub.unsubscribe();
onClosedSub.unsubscribe();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class PdfCreator {
});

// the result of the worker
this._pdfWorker.onmessage = ({ data }) => {
this._pdfWorker.onmessage = ({ data }): void => {
// if the worker returns a numbers, is always the progress
if (typeof data === `number`) {
// update progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import * as pdfMake from 'pdfmake/build/pdfmake';

const osTableLayout = {
switchColorTableLayout: {
hLineWidth: (rowIndex: any) => rowIndex === 1,
vLineWidth: () => 0,
fillColor: (rowIndex: any) => (rowIndex % 2 === 0 ? `#EEEEEE` : null)
hLineWidth: (rowIndex: any): boolean => rowIndex === 1,
vLineWidth: (): number => 0,
fillColor: (rowIndex: any): string => (rowIndex % 2 === 0 ? `#EEEEEE` : null)
},
metaboxLayout: {
fillColor: () => `#dddddd`,
hLineWidth: (i: any, node: any) => (i === 0 || i === node.table.body.length ? 0 : 0.5),
vLineWidth: () => 0,
hLineColor: () => `white`
fillColor: (): string => `#dddddd`,
hLineWidth: (i: any, node: any): 0 | 0.5 => (i === 0 || i === node.table.body.length ? 0 : 0.5),
vLineWidth: (): number => 0,
hLineColor: (): string => `white`
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Injectable } from '@angular/core';
import { Id } from 'src/app/domain/definitions/key-types';

import { Presenter } from './presenter';
import { PresenterService } from './presenter.service';

interface GetForwardCommitteesPresenterPayload {
meeting_id: Id;
}

type GetForwardingCommitteesPresenterResult = string[];

@Injectable({
providedIn: `root`
})
export class GetForwardingCommitteesPresenterService {
public constructor(private presenter: PresenterService) {}

public async call(payload: GetForwardCommitteesPresenterPayload): Promise<GetForwardingCommitteesPresenterResult> {
return await this.presenter.call<GetForwardingCommitteesPresenterResult>(
Presenter.GET_FORWARDING_COMMITTEES,
payload
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface HistoryPresenterResponse {

const HISTORY_ENDPOINT = `/system/autoupdate/history_information`;

const getUniqueItems = (positions: Position[]) => {
const getUniqueItems = (positions: Position[]): Position[] => {
const positionMap: { [positionNumber: number]: Position } = {};
for (const position of positions) {
positionMap[position.position] = position;
Expand Down
1 change: 1 addition & 0 deletions client/src/app/gateways/presenter/presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum Presenter {
GET_ACTIVE_USER_AMOUNT = `get_active_users_amount`,
GET_USER_RELATED_MODELS = `get_user_related_models`,
GET_USER_SCOPE = `get_user_scope`,
GET_FORWARDING_COMMITTEES = `get_forwarding_committees`,
GET_FORWARDING_MEETINGS = `get_forwarding_meetings`,
SEARCH_USERS = `search_users`,
SEARCH_DELETED_MODELS = `search_deleted_models`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository<Vi
this.setSortFunction((a, b) => a.tree_weight - b.tree_weight); // leave the sorting as it is
}

public getVerboseName = (plural = false) => this.translate.instant(plural ? `Items` : `Item`);
public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Items` : `Item`);

private getAgendaTitle(viewAgendaItem: ViewAgendaItem): AgendaListTitle {
if (viewAgendaItem.content_object) {
Expand All @@ -36,9 +36,9 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository<Vi
return { title: `-` }; // Default: Clarify which is the default
}

public getTitle = (viewAgendaItem: ViewAgendaItem) => this.getAgendaTitle(viewAgendaItem).title;
public getTitle = (viewAgendaItem: ViewAgendaItem): string => this.getAgendaTitle(viewAgendaItem).title;

public getSubtitle = (viewAgendaItem: ViewAgendaItem) => this.getAgendaTitle(viewAgendaItem).subtitle;
public getSubtitle = (viewAgendaItem: ViewAgendaItem): string => this.getAgendaTitle(viewAgendaItem).subtitle;

public getItemNumberPrefix(viewModel: HasAgendaItem): string {
return viewModel.agenda_item && viewModel.agenda_item.item_number
Expand Down Expand Up @@ -128,7 +128,7 @@ export class AgendaItemRepositoryService extends BaseMeetingRelatedRepository<Vi
*/
protected override createViewModel(model: AgendaItem): ViewAgendaItem {
const viewModel = super.createViewModel(model);
viewModel.getSubtitle = () => this.getSubtitle(viewModel) as string;
viewModel.getSubtitle = (): string => this.getSubtitle(viewModel) as string;
return viewModel;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export class AssignmentCandidateRepositoryService extends BaseMeetingRelatedRepo
super(repositoryServiceCollector, AssignmentCandidate);
}

public getTitle = (viewAssignmentCandidate: ViewAssignmentCandidate) =>
public getTitle = (viewAssignmentCandidate: ViewAssignmentCandidate): string =>
viewAssignmentCandidate.user?.getTitle() ?? UnknownUserLabel;

public getVerboseName = (plural = false) => this.translate.instant(plural ? `Candidates` : `Candidate`);
public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Candidates` : `Candidate`);

public async create(assignment: Identifiable, meetingUserId: Id): Promise<Identifiable> {
const payload = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export class AssignmentRepositoryService extends BaseAgendaItemAndListOfSpeakers
return this.sendBulkActionToBackend(AssignmentAction.DELETE, payload);
}

public getTitle = (viewAssignment: ViewAssignment) => viewAssignment.title;
public getTitle = (viewAssignment: ViewAssignment): string => viewAssignment.title;

public getVerboseName = (plural = false) => this.translate.instant(plural ? `Elections` : `Election`);
public getVerboseName = (plural = false): string => this.translate.instant(plural ? `Elections` : `Election`);

private getPartialPayload(model: Partial<ViewAssignment>): any {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export abstract class BaseAgendaItemAndListOfSpeakersContentObjectRepository<
return numberPrefix + this.getTitle(viewModel);
}

public getListOfSpeakersTitle = (viewModel: V) => this.getAgendaListTitle(viewModel).title;
public getListOfSpeakersTitle = (viewModel: V): string => this.getAgendaListTitle(viewModel).title;

public getListOfSpeakersSlideTitle = (viewModel: V) => this.getAgendaSlideTitle(viewModel);
public getListOfSpeakersSlideTitle = (viewModel: V): string => this.getAgendaSlideTitle(viewModel);

protected override createViewModel(model: M): V {
const viewModel = super.createViewModel(model);
viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel);
viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel);
viewModel.getListOfSpeakersTitle = () => this.getListOfSpeakersTitle(viewModel);
viewModel.getListOfSpeakersSlideTitle = () => this.getListOfSpeakersSlideTitle(viewModel);
viewModel.getAgendaListTitle = (): AgendaListTitle => this.getAgendaListTitle(viewModel);
viewModel.getAgendaSlideTitle = (): string => this.getAgendaSlideTitle(viewModel);
viewModel.getListOfSpeakersTitle = (): string => this.getListOfSpeakersTitle(viewModel);
viewModel.getListOfSpeakersSlideTitle = (): string => this.getListOfSpeakersSlideTitle(viewModel);
return viewModel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export abstract class BaseAgendaItemContentObjectRepository<
*/
protected override createViewModel(model: M): V {
const viewModel = super.createViewModel(model);
viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel);
viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel);
viewModel.getAgendaListTitle = (): AgendaListTitle => this.getAgendaListTitle(viewModel);
viewModel.getAgendaSlideTitle = (): string => this.getAgendaSlideTitle(viewModel);
return viewModel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export abstract class BaseListOfSpeakersContentObjectRepository<
*/
protected override createViewModel(model: M): V {
const viewModel = super.createViewModel(model);
viewModel.getListOfSpeakersTitle = () => this.getListOfSpeakersTitle(viewModel);
viewModel.getListOfSpeakersSlideTitle = () => this.getListOfSpeakersSlideTitle(viewModel);
viewModel.getListOfSpeakersTitle = (): string => this.getListOfSpeakersTitle(viewModel);
viewModel.getListOfSpeakersSlideTitle = (): string => this.getListOfSpeakersSlideTitle(viewModel);
return viewModel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export abstract class BaseMeetingRelatedRepository<V extends BaseViewModel, M ex

protected override createViewModel(model: M): V {
const viewModel = super.createViewModel(model);
viewModel.getActiveMeetingId = () => this.repositoryMeetingServiceCollector.activeMeetingIdService.meetingId;
viewModel.getActiveMeetingId = (): number =>
this.repositoryMeetingServiceCollector.activeMeetingIdService.meetingId;
return viewModel;
}
}
Loading

0 comments on commit 51c7d44

Please sign in to comment.