File tree Expand file tree Collapse file tree
collection-page/create-collection-page
shared/comcol/comcol-forms/create-comcol-page Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- < div class ="container ">
2- < div class ="row ">
3- < div class ="col-12 pb-4 ">
4- < h2 id ="sub-header " class =" border-bottom pb-2 " > {{'collection.create.sub-head' | translate:{ parent: dsoNameService.getName((parentRD$| async)?.payload) } }} </ h2 >
5- </ div >
1+ < div class ="container " *ngIf =" (isLoading$ | async) === false " >
2+ < div class ="row ">
3+ < div class ="col-12 pb-4 ">
4+ < h2 id ="sub-header "
5+ class =" border-bottom pb-2 " > {{ 'collection.create.sub-head' | translate:{ parent: dsoNameService.getName((parentRD$| async)?.payload) } }} </ h2 >
66 </ div >
7- < ds-collection-form (submitForm) ="onSubmit($event) "
8- (back) ="navigateToHome() "
9- (finish) ="navigateToNewPage() "> </ ds-collection-form >
7+ </ div >
8+ < ds-collection-form (submitForm) ="onSubmit($event) "
9+ (back) ="navigateToHome() "
10+ (finish) ="navigateToNewPage() "> </ ds-collection-form >
11+ </ div >
12+
13+ < div class ="container ">
14+ < ds-themed-loading *ngIf ="isLoading$ | async "> </ ds-themed-loading >
1015</ div >
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { Collection } from '../../core/shared/collection.model';
1515import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/create-comcol-page/create-comcol-page.component' ;
1616import { NotificationsService } from '../../shared/notifications/notifications.service' ;
1717import { CollectionFormComponent } from '../collection-form/collection-form.component' ;
18+ import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component' ;
1819
1920/**
2021 * Component that represents the page where a user can create a new Collection
@@ -27,6 +28,7 @@ import { CollectionFormComponent } from '../collection-form/collection-form.comp
2728 CollectionFormComponent ,
2829 TranslateModule ,
2930 AsyncPipe ,
31+ ThemedLoadingComponent ,
3032 ] ,
3133 standalone : true ,
3234} )
Original file line number Diff line number Diff line change 1- < div class ="container ">
1+ < div class ="container " *ngIf =" (isLoading$ | async) === false " >
22 < div class ="row ">
33 < div class ="col-12 pb-4 ">
44 < ng-container *ngVar ="(parentRD$ | async)?.payload as parent ">
55 < h2 *ngIf ="!parent " id ="header " class ="border-bottom pb-2 "> {{ 'community.create.head' | translate }}</ h2 >
6- < h2 *ngIf ="parent " id ="sub-header " class ="border-bottom pb-2 "> {{ 'community.create.sub-head' | translate:{ parent: dsoNameService.getName(parent) } }}</ h2 >
6+ < h2 *ngIf ="parent " id ="sub-header "
7+ class ="border-bottom pb-2 "> {{ 'community.create.sub-head' | translate:{ parent: dsoNameService.getName(parent) } }}</ h2 >
78 </ ng-container >
89 </ div >
910 </ div >
1011 < ds-community-form (submitForm) ="onSubmit($event) "
1112 (back) ="navigateToHome() "
1213 (finish) ="navigateToNewPage() "> </ ds-community-form >
1314</ div >
15+
16+ < div class ="container ">
17+ < ds-themed-loading *ngIf ="isLoading$ | async "> </ ds-themed-loading >
18+ </ div >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { CreateComColPageComponent } from '../../shared/comcol/comcol-forms/crea
1818import { NotificationsService } from '../../shared/notifications/notifications.service' ;
1919import { VarDirective } from '../../shared/utils/var.directive' ;
2020import { CommunityFormComponent } from '../community-form/community-form.component' ;
21+ import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component' ;
2122
2223/**
2324 * Component that represents the page where a user can create a new Community
@@ -32,6 +33,7 @@ import { CommunityFormComponent } from '../community-form/community-form.compone
3233 VarDirective ,
3334 NgIf ,
3435 AsyncPipe ,
36+ ThemedLoadingComponent ,
3537 ] ,
3638 standalone : true ,
3739} )
Original file line number Diff line number Diff line change 44} from '@angular/core' ;
55import { Router } from '@angular/router' ;
66import { TranslateService } from '@ngx-translate/core' ;
7- import { Observable } from 'rxjs' ;
7+ import { BehaviorSubject , Observable } from 'rxjs' ;
88import {
99 mergeMap ,
1010 take ,
@@ -62,6 +62,11 @@ export class CreateComColPageComponent<TDomain extends Collection | Community> i
6262 */
6363 protected type : ResourceType ;
6464
65+ /**
66+ * The
67+ */
68+ isLoading$ : BehaviorSubject < boolean > = new BehaviorSubject < boolean > ( false ) ;
69+
6570 public constructor (
6671 protected dsoDataService : ComColDataService < TDomain > ,
6772 public dsoNameService : DSONameService ,
@@ -89,6 +94,7 @@ export class CreateComColPageComponent<TDomain extends Collection | Community> i
8994 * @param event The event returned by the community/collection form. Contains the new dso and logo uploader
9095 */
9196 onSubmit ( event ) {
97+ this . isLoading$ . next ( true ) ;
9298 const dso = event . dso ;
9399 const uploader = event . uploader ;
94100
@@ -101,6 +107,7 @@ export class CreateComColPageComponent<TDomain extends Collection | Community> i
101107 ) ;
102108 } ) )
103109 . subscribe ( ( dsoRD : TDomain ) => {
110+ this . isLoading$ . next ( false ) ;
104111 if ( isNotUndefined ( dsoRD ) ) {
105112 this . newUUID = dsoRD . uuid ;
106113 if ( uploader . queue . length > 0 ) {
You can’t perform that action at this time.
0 commit comments