diff --git a/ocd/packages/codegen/src/generator/OcdModelGenerator.ts b/ocd/packages/codegen/src/generator/OcdModelGenerator.ts index e289d528..ce3355fa 100644 --- a/ocd/packages/codegen/src/generator/OcdModelGenerator.ts +++ b/ocd/packages/codegen/src/generator/OcdModelGenerator.ts @@ -237,7 +237,7 @@ export default ${this.autoGeneratedClassName(resource)} const contents = `${this.copyright()} ${this.autoGeneratedWarning()} -${resources.sort(this.simpleSort).map((r) => `export { ${[this.namespaceName(r), this.className(r)].join(', ')} } from './${this.resourcesDirectory()}/${this.namespaceName(r)}'`).join('\n')} +${resources.toSorted(this.simpleSort).map((r) => `export { ${[this.namespaceName(r), this.className(r)].join(', ')} } from './${this.resourcesDirectory()}/${this.namespaceName(r)}'`).join('\n')} ` return contents } diff --git a/ocd/packages/desktop/src/components/OcdResourceSvg.tsx b/ocd/packages/desktop/src/components/OcdResourceSvg.tsx index bfee8068..a3048800 100644 --- a/ocd/packages/desktop/src/components/OcdResourceSvg.tsx +++ b/ocd/packages/desktop/src/components/OcdResourceSvg.tsx @@ -228,7 +228,7 @@ const OcdContainerRect = ({ ocdConsoleConfig, ocdDocument, setOcdDocument, resou } const OcdResizePoint = ({cx, cy, position, setDimensions, onResizeEnd}: any): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [dragging, setDragging] = useState(false) const [origin, setOrigin] = useState({ x: 0, y: 0 }); const [radius, setRadius] = useState(3) diff --git a/ocd/packages/desktop/src/components/properties/OcdPropertyTypes.tsx b/ocd/packages/desktop/src/components/properties/OcdPropertyTypes.tsx index ea7f36e4..5299b589 100644 --- a/ocd/packages/desktop/src/components/properties/OcdPropertyTypes.tsx +++ b/ocd/packages/desktop/src/components/properties/OcdPropertyTypes.tsx @@ -128,7 +128,7 @@ export const isPropertyDisplayConditionTrue = (conditional: boolean, condition: export const OcdDisplayNameProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue] = useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -141,7 +141,6 @@ export const OcdDisplayNameProperty = ({ ocdDocument, setOcdDocument, resource, resource[attribute.key] = e.target.value setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdDisplayNameProperty: ${attribute.id} Render(${value})`) @@ -155,7 +154,7 @@ export const OcdDisplayNameProperty = ({ ocdDocument, setOcdDocument, resource, export const OcdTextProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -168,7 +167,6 @@ export const OcdTextProperty = ({ ocdDocument, setOcdDocument, resource, config, resource[attribute.key] = e.target.value // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdTextProperty: ${attribute.id} Render(${value})`) @@ -182,7 +180,7 @@ export const OcdTextProperty = ({ ocdDocument, setOcdDocument, resource, config, export const OcdNumberProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -195,7 +193,6 @@ export const OcdNumberProperty = ({ ocdDocument, setOcdDocument, resource, confi resource[attribute.key] = e.target.value // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdNumberProperty: ${attribute.id} Render(${value})`) @@ -209,7 +206,7 @@ export const OcdNumberProperty = ({ ocdDocument, setOcdDocument, resource, confi export const OcdBooleanProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -218,7 +215,6 @@ export const OcdBooleanProperty = ({ ocdDocument, setOcdDocument, resource, conf resource[attribute.key] = e.target.checked // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdBooleanProperty: ${attribute.id} Render(${value})`) @@ -232,7 +228,7 @@ export const OcdBooleanProperty = ({ ocdDocument, setOcdDocument, resource, conf export const OcdCodeProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -245,7 +241,6 @@ export const OcdCodeProperty = ({ ocdDocument, setOcdDocument, resource, config, resource[attribute.key] = e.target.value // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdCodeProperty: ${attribute.id} Render(${value})`) @@ -275,7 +270,7 @@ export const OcdLookupGroupOption = ({group}: {group: ResourceElementConfigLooku export const OcdLookupProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { console.debug('OcdPropertyTypes: OcdLookupProperty', config, attribute, resource) const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const lookupGroups = config && config.lookupGroups ? config.lookupGroups : [] @@ -294,7 +289,6 @@ export const OcdLookupProperty = ({ ocdDocument, setOcdDocument, resource, confi // TODO: Replace with a performant Solution setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdLookupProperty: ${attribute.id} Render(${value})`) @@ -317,7 +311,7 @@ export const OcdLookupProperty = ({ ocdDocument, setOcdDocument, resource, confi } export const OcdLookupListProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const resourceType = OcdUtils.toResourceType(attribute.lookupResource) @@ -333,7 +327,6 @@ export const OcdLookupListProperty = ({ ocdDocument, setOcdDocument, resource, c // TODO: Replace with a performant Solution setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdLookupListProperty: ${attribute.id} Render(${value})`) @@ -353,7 +346,7 @@ export const OcdLookupListProperty = ({ ocdDocument, setOcdDocument, resource, c export const OcdStaticLookupProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue] = useState(resource[attribute.key]) const properties = config?.properties ? config.properties : {} const configOptions = config?.options ? config.options : [] @@ -368,7 +361,6 @@ export const OcdStaticLookupProperty = ({ ocdDocument, setOcdDocument, resource, // TODO: Replace with a performant Solution setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } useEffect(() => { if (!resource[attribute.key] || resource[attribute.key] === '') { @@ -377,7 +369,6 @@ export const OcdStaticLookupProperty = ({ ocdDocument, setOcdDocument, resource, // TODO: Replace with a performant Solution // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } } }, []) @@ -398,8 +389,8 @@ export const OcdStaticLookupProperty = ({ ocdDocument, setOcdDocument, resource, export const OcdCacheLookupProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { console.debug('OcdPropertyTypes: OcdCacheLookupProperty', config, attribute, resource) - const {activeFile, setActiveFile} = useContext(ActiveFileContext) - const {ocdCache, setOcdCache} = useContext(CacheContext) + const {activeFile} = useContext(ActiveFileContext) + const {ocdCache} = useContext(CacheContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} // const id = `${rootResource.id.replace(/\W+/g, "")}_${attribute.id.replace(/\W+/g, "")}` @@ -424,7 +415,6 @@ export const OcdCacheLookupProperty = ({ ocdDocument, setOcdDocument, resource, // TODO: Replace with a performant Solution setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug('OcdPropertyTypes: OcdCacheLookupProperty', config, attribute, resource, resources) @@ -447,7 +437,7 @@ export const OcdCacheLookupProperty = ({ ocdDocument, setOcdDocument, resource, export const OcdStringListProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key] ? resource[attribute.key].join(',') : '') const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -460,7 +450,6 @@ export const OcdStringListProperty = ({ ocdDocument, setOcdDocument, resource, c resource[attribute.key] = e.target.value.split(',').filter((v) => v !== '') // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdStringListProperty: ${attribute.id} Render(${value})`) @@ -474,7 +463,7 @@ export const OcdStringListProperty = ({ ocdDocument, setOcdDocument, resource, c export const OcdNumberListProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { const id = useId() - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key].join(',')) const properties = config && config.properties ? config.properties : {} const onChange = (e: React.ChangeEvent) => { @@ -487,7 +476,6 @@ export const OcdNumberListProperty = ({ ocdDocument, setOcdDocument, resource, c resource[attribute.key] = e.target.value.split(',') // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdNumberListProperty: ${attribute.id} Render(${value})`) @@ -500,7 +488,7 @@ export const OcdNumberListProperty = ({ ocdDocument, setOcdDocument, resource, c } export const OcdListProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` // const id = `${rootResource.id.replace(/\W+/g, "")}_${attribute.id.replace(/\W+/g, "")}` @@ -514,7 +502,7 @@ export const OcdListProperty = ({ ocdDocument, setOcdDocument, resource, config, } export const OcdSetProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` // const id = `${rootResource.id.replace(/\W+/g, "")}_${attribute.id.replace(/\W+/g, "")}` @@ -528,7 +516,7 @@ export const OcdSetProperty = ({ ocdDocument, setOcdDocument, resource, config, } export const OcdSetLookupProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const properties = config && config.properties ? config.properties : {} const resourceType = OcdUtils.toResourceType(attribute.lookupResource) @@ -542,7 +530,6 @@ export const OcdSetLookupProperty = ({ ocdDocument, setOcdDocument, resource, co else resource[attribute.key] = resource[attribute.key].filter((s: string) => s !== securityListId) // setOcdDocument(OcdDocument.clone(ocdDocument)) if (!activeFile.modified) activeFile.modified = true - // if (!activeFile.modified) setActiveFile({...activeFile, modified: true}) } const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdSetLookupProperty: ${attribute.id} Render(${value})`) @@ -561,7 +548,7 @@ export const OcdSetLookupProperty = ({ ocdDocument, setOcdDocument, resource, co } export const OcdMapProperty = ({ ocdDocument, setOcdDocument, resource, config, attribute, rootResource }: ResourceProperty): JSX.Element => { - const {activeFile, setActiveFile} = useContext(ActiveFileContext) + const {activeFile} = useContext(ActiveFileContext) const [value, setValue]= useState(resource[attribute.key]) const className = isPropertyDisplayConditionTrue(attribute.conditional, attribute.condition, resource, rootResource) ? `ocd-property-row ocd-simple-property-row` : `collapsed hidden` console.debug(`>>>> OcdPropertyTypes: OcdMapProperty: ${attribute.id} Render(${value})`) diff --git a/okitweb/static/okit/js/okit.js b/okitweb/static/okit/js/okit.js index 820a8698..b848ad4d 100644 --- a/okitweb/static/okit/js/okit.js +++ b/okitweb/static/okit/js/okit.js @@ -262,9 +262,9 @@ class OkitOCIData { cache: false }).done((resp) => { console.info('OkitOCIData: Querying Dropdown data for', profile, region); - const response = resp + // const response = resp const end = new Date().getTime() - const profile_region = okitOciConfig.getRegion(profile) + // const profile_region = okitOciConfig.getRegion(profile) console.info('OkitOCIData: Querying Dropdown Region Subscription for', profile, 'took', end - start, 'ms') // console.info('Region Subscriptions', typeof(response), response) // We Know that this Profile is not a PCA-X9 so we can use the OCI Dropdowwn Query