4
4
contains ,
5
5
realmURL ,
6
6
} from ' https://cardstack.com/base/card-api' ;
7
- import { Component } from ' https://cardstack.com/base/card-api' ;
7
+ import { Component , BaseDef } from ' https://cardstack.com/base/card-api' ;
8
8
import GlimmerComponent from ' @glimmer/component' ;
9
9
import {
10
10
field ,
@@ -243,6 +243,18 @@ class IsolatedTemplate extends Component<typeof Account> {
243
243
this ._createNewTask .perform ();
244
244
};
245
245
246
+ get activeTasksCount() {
247
+ const tasks = this .activeTasks ;
248
+ if (! tasks || tasks .isLoading ) {
249
+ return 0 ;
250
+ }
251
+ return tasks .instances ?.length ?? 0 ;
252
+ }
253
+
254
+ get hasActiveTasks() {
255
+ return this .activeTasksCount > 0 ;
256
+ }
257
+
246
258
get activeDealsCount() {
247
259
const deals = this .deals ;
248
260
if (! deals || deals .isLoading ) {
@@ -564,7 +576,19 @@ class IsolatedTemplate extends Component<typeof Account> {
564
576
</BoxelButton >
565
577
</: icon >
566
578
<: content >
567
- {{! UI for upcoming tasks }}
579
+ {{#if this . activeTasks.isLoading }}
580
+ <div class =' loading-skeleton' >Loading...</div >
581
+ {{else }}
582
+ {{#if this . hasActiveTasks }}
583
+ {{#each this . activeTasks.instances as | task | }}
584
+ {{#let ( getComponent task ) as | Component | }}
585
+ <Component @ format =' embedded' @ displayContainer ={{ false }} />
586
+ {{/let }}
587
+ {{/each }}
588
+ {{else }}
589
+ <p class =' description' >No Upcoming Tasks</p >
590
+ {{/if }}
591
+ {{/if }}
568
592
</: content >
569
593
</SummaryCard >
570
594
</: tasks >
@@ -642,9 +666,14 @@ class IsolatedTemplate extends Component<typeof Account> {
642
666
.activities-summary-card ,
643
667
.tasks-summary-card {
644
668
--summary-card-padding : var (--boxel-sp-xl ) var (--boxel-sp );
669
+ --summary-card-gap : var (--boxel-sp-lg );
645
670
container-type : inline-size;
646
671
container-name : activities-summary-card;
647
672
}
673
+ .tasks-summary-card :where(.task-card ) {
674
+ --task-card-padding : var (--boxel-sp ) 0 ;
675
+ border-top : 1px solid var (--boxel-200 );
676
+ }
648
677
.activity-title {
649
678
font : 600 var (--boxel-font-med );
650
679
letter-spacing : var (--boxel-lsp-xxs );
@@ -669,6 +698,15 @@ class IsolatedTemplate extends Component<typeof Account> {
669
698
--profile-avatar-icon-border : 0px ;
670
699
flex-shrink : 0 ;
671
700
}
701
+ .loading-skeleton {
702
+ height : 60px ;
703
+ width : 100% ;
704
+ background-color : var (--boxel-100 );
705
+ border-radius : var (--boxel-border-radius-sm );
706
+ display : flex ;
707
+ align-items : center ;
708
+ justify-content : center ;
709
+ }
672
710
673
711
@container activities-summary-card (max-width: 447px) {
674
712
.activity-button-mobile {
@@ -922,3 +960,7 @@ class AccountPageLayout extends GlimmerComponent<AccountPageLayoutArgs> {
922
960
< /style >
923
961
</template >
924
962
}
963
+
964
+ function getComponent(cardOrField : BaseDef ) {
965
+ return cardOrField .constructor .getComponent (cardOrField );
966
+ }
0 commit comments