diff --git a/backend/src/api/boards.ts b/backend/src/api/boards.ts index 50998db6..ccd8b2fd 100644 --- a/backend/src/api/boards.ts +++ b/backend/src/api/boards.ts @@ -98,7 +98,7 @@ router.post('/:boardID/copy-configuration', async (req, res) => { ); await dalBoard.updateMany(boards, updatedBoard); - res.status(200); + res.status(200).json(boards); }); router.get('/:id', async (req, res) => { diff --git a/frontend/src/app/components/add-post-modal/add-post.component.html b/frontend/src/app/components/add-post-modal/add-post.component.html index bb66aeb0..4f2ecdd8 100644 --- a/frontend/src/app/components/add-post-modal/add-post.component.html +++ b/frontend/src/app/components/add-post-modal/add-post.component.html @@ -174,7 +174,7 @@

Update Post

cancel -
+
No tags available.
UI Elements
-
diff --git a/frontend/src/app/components/project-configuration-modal/project-configuration-modal.component.ts b/frontend/src/app/components/project-configuration-modal/project-configuration-modal.component.ts index 50241f6b..33ad24a4 100644 --- a/frontend/src/app/components/project-configuration-modal/project-configuration-modal.component.ts +++ b/frontend/src/app/components/project-configuration-modal/project-configuration-modal.component.ts @@ -21,6 +21,8 @@ export class ProjectConfigurationModalComponent implements OnInit { Role: typeof Role = Role; + loading: boolean = false; + constructor( public dialogRef: MatDialogRef, public boardService: BoardService, @@ -34,22 +36,32 @@ export class ProjectConfigurationModalComponent implements OnInit { this.membershipDisabledEditable = this.project.membershipDisabled; } - async ngOnInit() { - this.members = ( - await this.userService.getMultipleByIds(this.project.members) - ).sort((a, b) => b.role.charCodeAt(0) - a.role.charCodeAt(0)); + ngOnInit(): void { + this.userService.getMultipleByIds(this.project.members).then((users) => { + this.members = users.sort( + (a, b) => b.role.charCodeAt(0) - a.role.charCodeAt(0) + ); + }); } - async handleDialogSubmit() { - this.project = await this.projectService.update(this.project.projectID, { - name: this.nameEditable, - membershipDisabled: this.membershipDisabledEditable, - members: this.members.map((user) => user.userID), - }); - this.close(); + handleDialogSubmit(): void { + this.loading = true; + this.projectService + .update(this.project.projectID, { + name: this.nameEditable, + membershipDisabled: this.membershipDisabledEditable, + members: this.members.map((user) => user.userID), + }) + .then((project) => { + this.project = project; + }) + .finally(() => { + this.close(); + this.loading = false; + }); } - async removeUser(_user: User) { + removeUser(_user: User): void { this.members = this.members.filter((user) => user.userID !== _user.userID); } diff --git a/frontend/src/app/services/board.service.ts b/frontend/src/app/services/board.service.ts index 799537f5..d648e657 100644 --- a/frontend/src/app/services/board.service.ts +++ b/frontend/src/app/services/board.service.ts @@ -46,7 +46,7 @@ export class BoardService { copyConfiguration(boardID: string, boards: string[]) { return this.http - .post(`boards/${boardID}/copy-configuration/`, { boards }) + .post(`boards/${boardID}/copy-configuration/`, { boards }) .toPromise(); } } diff --git a/frontend/src/app/services/snackbar.service.ts b/frontend/src/app/services/snackbar.service.ts index bfa6bc70..50167d5e 100644 --- a/frontend/src/app/services/snackbar.service.ts +++ b/frontend/src/app/services/snackbar.service.ts @@ -1,6 +1,6 @@ import { Injectable, OnDestroy } from '@angular/core'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import { BehaviorSubject, Subscription } from 'rxjs'; +import { BehaviorSubject } from 'rxjs'; import { SnackBarComponent } from '../components/snackbar/snackbar.component'; export interface SnackbarConfig { @@ -55,13 +55,13 @@ export class SnackbarService implements OnDestroy { title: string, description = '', configParams: SnackbarConfig = {} - ) { + ): void { this.snackBarQueue.next( this.snackBarQueue.value.concat([{ title, description, configParams }]) ); } - dequeueSnackbar() { + dequeueSnackbar(): void { this.snackBarQueue.value.pop(); this.snackBarQueue.next(this.snackBarQueue.value); } @@ -72,6 +72,7 @@ export class SnackbarService implements OnDestroy { private openSnackbar(item: SnackBarQueueItem) { const config = item.configParams.matSnackbarConfig ?? {}; + config.duration = 5000; config.data = { title: item.title, description: item.description, diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss index 42150c61..0bc422ea 100644 --- a/frontend/src/styles.scss +++ b/frontend/src/styles.scss @@ -63,3 +63,23 @@ a { .wide-snackbar { max-width: 75% !important; } + +@keyframes spinner { + to {transform: rotate(360deg);} +} + +.spinner:before { + content: ''; + box-sizing: border-box; + position: absolute; + top: 50%; + left: 50%; + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + border-radius: 50%; + border: 2px solid #ffffff; + border-top-color: #000000; + animation: spinner .8s linear infinite; +}