Skip to content

Commit

Permalink
Fix fileartifact reference in component class
Browse files Browse the repository at this point in the history
  • Loading branch information
djbarnwal committed Dec 20, 2024
1 parent edd973d commit bab44b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ export abstract class BaseCanvasComponent<T> implements CanvasComponent<T> {
const parseDocumentStore = getParsedDocument(this.fileArtifact);
const parsedDocument = get(parseDocumentStore);

const { saveContent } = this.fileArtifact;
const { updateEditorContent, saveLocalContent } = this.fileArtifact;

// Update the Item
parsedDocument.setIn(this.pathInYAML, newSpec);

// Save the updated document
await saveContent(parsedDocument.toString());
updateEditorContent(parsedDocument.toString(), true);
await saveLocalContent();
}

async setSpec(newSpec: T): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ Handle optional fields and defaults properly
type={config.type}
selectedItem={paramValues[key]}
onSelect={async (field) => {
console.log(field);
component.updateProperty(key, field);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
label={`${config.label || key} Field`}
metricName={metricsView}
id={`${key}-field`}
type="measure"
type={key === "x" ? "dimension" : "measure"}
selectedItem={value?.field || ""}
onSelect={async (field) => {
updateFieldConfig("field", field);
Expand Down
1 change: 1 addition & 0 deletions web-common/src/features/canvas/inspector/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface ComponentInputParam {
showInUI?: boolean; // If not specified, can assume true
required?: boolean; // If not specified, can assume true
description?: string; // Tooltip description for the input
meta?: Record<string, string>; // Any additional metadata
}

0 comments on commit bab44b4

Please sign in to comment.