I’m currently trying the Custom Widget in Workshop.
In order to do so, I followed the following tutorial / thread: https://community.palantir.com/t/how-to-create-a-custom-widget-for-workshop/2182
@ewitkon
Somehow my Custom Widget stays in a Loading State and won’t continue. See screenshot:
The code is the following:
const workshopContext = useWorkshopContext(EXAMPLE_CONFIG);
console.log(workshopContext.status)
// Note: we can have a proper management of the state on loading etc.
return visitLoadingState(workshopContext, {
loading: () => <>LOADING...</>,
// If the Workshop context was loaded successfully, we pass it to our custom widget
succeeded: (value) => {
console.log("Workshop context loaded successfully:", value);
return <MyCustomWidget loadedWorkshopContext={value} />
},
reloading: (previousValue) => {
console.log("Workshop context is reloading:", previousValue);
return <MyCustomWidget loadedWorkshopContext={previousValue} />
},
My config is the following:
import { IConfigDefinition } from "@osdk/workshop-iframe-custom-widget";
export const EXAMPLE_CONFIG = [
{
fieldId: "stringField",
field: {
type: "single",
fieldValue: {
type: "inputOutput",
variableType: {
type: "string",
defaultValue: "test",
},
},
label: "string field",
},
},
] as const satisfies IConfigDefinition;
In the Developer Console I get the following error:
Invalid change to widget config: ‘bidirectional’ → ‘id’ must be non-empty
But I’m not sure what’s meant by that?
Are there other ways I could further investigate the issue?