Skip to content

Commit

Permalink
Merge branch 'main' into cs-7948-file-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenwerk committed Feb 13, 2025
2 parents afbfd8a + 9fe7e54 commit f45e1fa
Show file tree
Hide file tree
Showing 9 changed files with 644 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const LoadingIndicator: TemplateOnlyComponent<Signature> = <template>
--boxel-loading-indicator-size,
var(--boxel-icon-sm)
);
display: inline-block;
width: var(--loading-indicator-size);
height: var(--loading-indicator-size);
flex-shrink: 0;
Expand Down
22 changes: 21 additions & 1 deletion packages/experiments-realm/crm/account.gts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ class IsolatedTemplate extends Component<typeof Account> {
return `${formattedValue} in ${currentYear}`;
}

removeFileExtension(cardUrl: string) {
return cardUrl.replace(/\.[^/.]+$/, '');
}

<template>
<AccountPageLayout>
<:header>
Expand Down Expand Up @@ -501,7 +505,23 @@ class IsolatedTemplate extends Component<typeof Account> {
{{#if this.hasActiveTasks}}
{{#each this.activeTasks.instances as |task|}}
{{#let (getComponent task) as |Component|}}
<Component @format='embedded' @displayContainer={{false}} />
<div
{{@context.cardComponentModifier
cardId=task.id
format='data'
fieldType=undefined
fieldName=undefined
}}
data-test-cards-grid-item={{this.removeFileExtension
task.id
}}
data-cards-grid-item={{this.removeFileExtension task.id}}
>
<Component
@format='embedded'
@displayContainer={{false}}
/>
</div>
{{/let}}
{{/each}}
{{else}}
Expand Down
27 changes: 23 additions & 4 deletions packages/experiments-realm/crm/deal.gts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ class IsolatedTemplate extends Component<typeof Deal> {
return null;
}

removeFileExtension(cardUrl: string) {
return cardUrl.replace(/\.[^/.]+$/, '');
}

<template>
<DealPageLayout>
<:header>
Expand Down Expand Up @@ -474,10 +478,25 @@ class IsolatedTemplate extends Component<typeof Deal> {
{{#if this.hasActiveTasks}}
{{#each this.activeTasks.instances as |task|}}
{{#let (getComponent task) as |Component|}}
<Component
@format='embedded'
@displayContainer={{false}}
/>
<div
{{@context.cardComponentModifier
cardId=task.id
format='data'
fieldType=undefined
fieldName=undefined
}}
data-test-cards-grid-item={{this.removeFileExtension
task.id
}}
data-cards-grid-item={{this.removeFileExtension
task.id
}}
>
<Component
@format='embedded'
@displayContainer={{false}}
/>
</div>
{{/let}}
{{/each}}
{{else}}
Expand Down
8 changes: 1 addition & 7 deletions packages/host/app/components/operator-mode/code-submode.gts
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,7 @@ export default class CodeSubmode extends Component<Signature> {
if (!isPlaygroundEnabled) {
return false;
}
let declaration = this.selectedDeclaration;
if (!declaration || !('cardOrField' in declaration)) {
return false;
}
return isCardDef(declaration.cardOrField);
return isCardDef(this.selectedCardOrField?.cardOrField);
}

get showSpecPreview() {
Expand Down Expand Up @@ -1024,8 +1020,6 @@ export default class CodeSubmode extends Component<Signature> {
{{#if this.showSpecPreview}}
<SpecPreview
@selectedDeclaration={{this.selectedDeclaration}}
@createFile={{perform this.createFile}}
@isCreateModalShown={{bool this.isCreateModalOpen}}
as |SpecPreviewTitle SpecPreviewContent|
>
<A.Item
Expand Down
Loading

0 comments on commit f45e1fa

Please sign in to comment.