diff --git a/src/app/admin/components/sessions/sessions.component.html b/src/app/admin/components/sessions/sessions.component.html index f1ea99f..60476c2 100644 --- a/src/app/admin/components/sessions/sessions.component.html +++ b/src/app/admin/components/sessions/sessions.component.html @@ -49,9 +49,11 @@ Grid view -
-
- +
+
+
+ +
diff --git a/src/app/admin/components/sessions/sessions.component.scss b/src/app/admin/components/sessions/sessions.component.scss index f7b5211..9c3c310 100644 --- a/src/app/admin/components/sessions/sessions.component.scss +++ b/src/app/admin/components/sessions/sessions.component.scss @@ -97,3 +97,22 @@ background-color: #ea5f02; } } + +.sessions-content { + min-height: 150px; +} + +.sessions-spinner-outer { + position: relative; + width: 100%; +} + +.sessions-spinner { + height: 150px; + top: 16px; + position: absolute; + display: flex; + justify-content: center; + width: 100%; + z-index: 999999; +} diff --git a/src/app/user/home/home.component.html b/src/app/user/home/home.component.html index bca66eb..44fe84f 100644 --- a/src/app/user/home/home.component.html +++ b/src/app/user/home/home.component.html @@ -58,10 +58,12 @@

Looks like you don't have any instances

{{ experiment.startDate | date: 'MMM yyyy' }}) -
- +
+
+ +
- + My instances {{ (instances | instanceFilterPipe: ['OWNER']: selectedExperiment).length }} diff --git a/src/app/user/home/home.component.scss b/src/app/user/home/home.component.scss index 4a536fa..0548923 100644 --- a/src/app/user/home/home.component.scss +++ b/src/app/user/home/home.component.scss @@ -6,3 +6,15 @@ padding-top: 8px; padding-bottom: 8px; } + +.home-spinner-outer { + position: relative; + width: 100%; +} + +.home-spinner { + position: absolute; + display: flex; + justify-content: center; + width: 100%; +} diff --git a/src/app/user/home/home.component.ts b/src/app/user/home/home.component.ts index 0a492af..e83f69e 100644 --- a/src/app/user/home/home.component.ts +++ b/src/app/user/home/home.component.ts @@ -138,7 +138,7 @@ export class HomeComponent implements OnInit, OnDestroy { public refresh(): void { this.loading = true; this.accountService.getInstances().subscribe((instances) => { - this.instances = instances; + this.mergeInstances(instances); this.experiments = [].concat(...instances.map(instance => instance.experiments)) .filter((v, i, a) => { return a.findIndex(t => (t.id === v.id)) === i; @@ -156,6 +156,13 @@ export class HomeComponent implements OnInit, OnDestroy { this.refresh$.next(); } + private mergeInstances(instances: Instance[]) { + const originalMap = new Map(this.instances.map(instance => [instance.id, instance])); + this.instances = instances.map(newInstance => { + return originalMap.get(newInstance.id) || newInstance; + }); + } + private bindEventGatewayListeners(): void { this._gatewayEventSubscriber = this.eventsGateway.subscribe() .on('user:instances_changed', _ => { diff --git a/src/assets/stylesheets/application.scss b/src/assets/stylesheets/application.scss index 2277d85..6b7862f 100644 --- a/src/assets/stylesheets/application.scss +++ b/src/assets/stylesheets/application.scss @@ -1086,8 +1086,3 @@ $visa-theme: mat.define-light-theme(( margin: 0 0 10px !important; } -.centered-content-area { - display: flex; - justify-content: center; - align-items: center; -}