From 6a78d65dc397c614c6c5478b8cf29a811a6d6626 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Thu, 14 Feb 2019 14:17:17 +0100 Subject: [PATCH] Remove redundant Submits Remove concurrent ngSubmit Some cleanup and code alignment --- .../agenda/item-repository.service.ts | 1 - .../agenda-list/agenda-list.component.ts | 7 +- .../item-info-dialog.component.html | 2 +- .../topic-detail/topic-detail.component.html | 8 +- .../reset-password-confirm.component.html | 24 +- .../reset-password.component.html | 17 +- .../mediafile-list.component.html | 251 +++++++++--------- .../amendment-create-wizard.component.html | 3 +- .../motion-detail.component.html | 8 +- .../tag-list/tag-list.component.html | 27 +- .../user-detail/user-detail.component.html | 10 +- 11 files changed, 193 insertions(+), 165 deletions(-) diff --git a/client/src/app/core/repositories/agenda/item-repository.service.ts b/client/src/app/core/repositories/agenda/item-repository.service.ts index 7d7f5ef20..bd419e1a9 100644 --- a/client/src/app/core/repositories/agenda/item-repository.service.ts +++ b/client/src/app/core/repositories/agenda/item-repository.service.ts @@ -82,7 +82,6 @@ export class ItemRepositoryService extends BaseRepository { /** * Returns the corresponding content object to a given {@link Item} as an {@link AgendaBaseViewModel} - * Used dynamically because of heavy race conditions * * @param agendaItem the target agenda Item * @returns the content object of the given item. Might be null if it was not found. diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts index a5a97aaa4..3da97eea3 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts @@ -111,14 +111,13 @@ export class AgendaListComponent extends ListViewBaseComponent impleme /** * Links to the content object. - * Gets content object from the repository rather than from the model - * to avoid race conditions * * @param item the item that was selected from the list view */ public singleSelectAction(item: ViewItem): void { - const contentObject = this.repo.getContentObject(item.item); - this.router.navigate([contentObject.getDetailStateURL()]); + if (item.contentObject) { + this.router.navigate([item.contentObject.getDetailStateURL()]); + } } /** diff --git a/client/src/app/site/agenda/components/item-info-dialog/item-info-dialog.component.html b/client/src/app/site/agenda/components/item-info-dialog/item-info-dialog.component.html index 582dad015..b99c789bb 100644 --- a/client/src/app/site/agenda/components/item-info-dialog/item-info-dialog.component.html +++ b/client/src/app/site/agenda/components/item-info-dialog/item-info-dialog.component.html @@ -1,6 +1,6 @@

{{ 'Edit details for' | translate }} {{ item.getTitle() }}

-
+ diff --git a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html index ecbb57e08..f32dc2beb 100644 --- a/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html +++ b/client/src/app/site/agenda/components/topic-detail/topic-detail.component.html @@ -10,7 +10,7 @@

- New topic + New topic Edit topic Topic

@@ -24,9 +24,7 @@
- +

{{ topic.title }}

@@ -49,7 +47,7 @@
- +

Please enter your new password

- + A password is required -
- - +
+ +
diff --git a/client/src/app/site/login/components/reset-password/reset-password.component.html b/client/src/app/site/login/components/reset-password/reset-password.component.html index a575164ba..f966313b9 100644 --- a/client/src/app/site/login/components/reset-password/reset-password.component.html +++ b/client/src/app/site/login/components/reset-password/reset-password.component.html @@ -2,14 +2,21 @@

Enter your email to send the password reset link

- + Please enter a valid email address! -
-   - +
+   +
diff --git a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html index fdd6306c0..85ed20422 100644 --- a/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html +++ b/client/src/app/site/mediafiles/components/mediafile-list/mediafile-list.component.html @@ -3,7 +3,8 @@ [editMode]="editFile" [multiSelectMode]="isMultiSelect" (mainEvent)="onMainEvent()" - (saveEvent)="onSaveEditedFile()"> + (saveEvent)="onSaveEditedFile()" +>

Files

@@ -13,7 +14,8 @@ *ngIf="editFile" [formGroup]="fileEditForm" (ngSubmit)="onSaveEditedFile()" - (keydown)="keyDownFunction($event)"> + (keydown)="keyDownFunction($event)" + > + placeholder="{{ 'New file name' | translate }}" + /> Required @@ -45,135 +48,143 @@ {{ selectedRows.length }} selected
- - - - - - - - - {{ isSelected(item) ? 'check_circle' : '' }} - - + + + + + + + + {{ isSelected(item) ? 'check_circle' : '' }} + + - - - Name - {{ file.title }} - + + + Name + {{ file.title }} + - - - Group - -
- insert_drive_file {{ file.type }} - data_usage {{ file.size }} + + + Group + +
+ insert_drive_file {{ file.type }} + data_usage {{ file.size }} +
+
+
+ + + + Indicator + + + +
+ text_fields + insert_photo +
+
+
+ + + + Menu + + + + + + + + + + + + + + +
+
+ +
- - - - - Indicator - - - -
- text_fields - insert_photo + +
+
+ +
- - - - - Menu - - - - + + + - - - - - - - - - -
-
- -
-
- - -
-
- -
-
- - - - -
-
- - - - - - - -
- -
-
- - - - - -
-
+ + +
+ +
+
+ + + + + +
+
diff --git a/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.html b/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.html index 2d7ec9fe0..71e2cceb0 100644 --- a/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.html +++ b/client/src/app/site/motions/components/amendment-create-wizard/amendment-create-wizard.component.html @@ -26,7 +26,8 @@ type="button" mat-button matStepperNext - [disabled]="contentForm.value.selectedParagraph === null"> + [disabled]="contentForm.value.selectedParagraph === null" + > Next
diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html index 95dd67938..7643038ce 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html @@ -420,13 +420,7 @@
-
+
diff --git a/client/src/app/site/tags/components/tag-list/tag-list.component.html b/client/src/app/site/tags/components/tag-list/tag-list.component.html index 031a29810..f91af2e71 100644 --- a/client/src/app/site/tags/components/tag-list/tag-list.component.html +++ b/client/src/app/site/tags/components/tag-list/tag-list.component.html @@ -1,12 +1,24 @@ -> +

Tags

- + - + Required @@ -14,12 +26,11 @@
-
- @@ -28,7 +39,7 @@ {{ tag.getTitle() }} - + diff --git a/client/src/app/site/users/components/user-detail/user-detail.component.html b/client/src/app/site/users/components/user-detail/user-detail.component.html index 611259ae4..046461009 100644 --- a/client/src/app/site/users/components/user-detail/user-detail.component.html +++ b/client/src/app/site/users/components/user-detail/user-detail.component.html @@ -15,12 +15,7 @@ @@ -49,7 +44,6 @@
@@ -104,7 +98,7 @@ placeholder="{{ 'Email' | translate }}" name="email" formControlName="email" - [value]="user.email ? user.email: null" + [value]="user.email ? user.email : null" /> Please enter a valid email address