Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
<div class="flex flex-column gap-4 w-full">
<h3>{{ 'collections.addToCollection.collectionMetadata' | translate }}</h3>

@if (!isDisabled() && stepperActiveValue() !== targetStepValue()) {
@if (!isDisabled() && !isStepActive()) {
@if (collectionMetadataSaved()) {
@if (isCedarMode()) {
@if (cedarTemplate()) {
@let cedarTpl = cedarTemplate();

@if (cedarTpl) {
<cedar-artifact-viewer
#cedarViewer
[config]="cedarViewerConfig"
[templateObject]="cedarTemplate()!.attributes.template"
[instanceObject]="cedarFormData()"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we need the instanceObject? I thought we need this to render the form?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instanceObject is still required for the viewer to show saved data. We moved viewer hydration from template-only to the mount effect. The editor form still uses [metadata]="cedarFormData()"

[templateObject]="cedarTpl.attributes.template"
></cedar-artifact-viewer>
}
} @else {
Expand Down Expand Up @@ -45,19 +46,23 @@ <h3>{{ 'collections.addToCollection.collectionMetadata' | translate }}</h3>
</p-step>

<p-step-panel [value]="targetStepValue()" class="p-0">
<ng-template class="m-0" #content let-activateCallback="activateCallback">
<ng-template #content>
@if (isCedarMode()) {
@if (cedarTemplate()) {
<div class="cedar-editor-container mt-3">
<cedar-embeddable-editor
#cedarEditor
[config]="cedarConfig"
[templateObject]="cedarTemplate()!.attributes.template"
[metadata]="cedarFormData()"
(change)="onCedarChange($event)"
(keyup)="onCedarChange($event)"
></cedar-embeddable-editor>
</div>
@let cedarTpl = cedarTemplate();

@if (cedarTpl) {
@if (isStepActive()) {
<div class="cedar-editor-container mt-3">
<cedar-embeddable-editor
#cedarEditor
[config]="cedarConfig"
[templateObject]="cedarTpl.attributes.template"
[metadata]="cedarFormData()"
(change)="onCedarChange($event)"
(keyup)="onCedarChange($event)"
></cedar-embeddable-editor>
</div>
}

<div class="flex justify-content-end gap-3 mt-4">
<p-button
Expand Down
Loading
Loading