diff --git a/src/components/Extensibility/ExtensibilityDetails.js b/src/components/Extensibility/ExtensibilityDetails.js index 321bdb7e58..b1d282da60 100644 --- a/src/components/Extensibility/ExtensibilityDetails.js +++ b/src/components/Extensibility/ExtensibilityDetails.js @@ -37,9 +37,6 @@ export const ExtensibilityDetailsCore = ({ resource, }); - console.log(schema); - console.log(resMetaData); - const jsonata = useJsonata({}); const description = useCreateResourceDescription(resourceDescription); diff --git a/src/components/Extensibility/helpers/jsonataWrapper.ts b/src/components/Extensibility/helpers/jsonataWrapper.ts index 4d1b96ca9e..b7506a9bc9 100644 --- a/src/components/Extensibility/helpers/jsonataWrapper.ts +++ b/src/components/Extensibility/helpers/jsonataWrapper.ts @@ -9,8 +9,11 @@ import { AuthDataState, authDataState } from 'state/authDataAtom'; export const escapeKebabCase = (expr: string) => { return expr.replace( - /(? { + if (quotedString) return match; + return `\`${identifier}${hyphenPart}\``; + }, ); }; diff --git a/src/components/Extensibility/helpers/tests/escapeKebabCase.test.js b/src/components/Extensibility/helpers/tests/escapeKebabCase.test.js index 1c0b80bf6b..9188f0e71c 100644 --- a/src/components/Extensibility/helpers/tests/escapeKebabCase.test.js +++ b/src/components/Extensibility/helpers/tests/escapeKebabCase.test.js @@ -6,12 +6,12 @@ describe('escapeKebabCase', () => { expect(escapeKebabCase(expression)).toBe('$root.spec.myRegularPath'); }); - it('kebab path 1', () => { + it('kebab path', () => { const expression = '$root.spec.my-kebab-path'; expect(escapeKebabCase(expression)).toBe('$root.spec.`my-kebab-path`'); }); - it('kebab path, regular path', () => { + it('kebab path and regular path', () => { const expression = '$root.spec.my-kebab-path.subPath'; expect(escapeKebabCase(expression)).toBe( '$root.spec.`my-kebab-path`.subPath', @@ -25,11 +25,6 @@ describe('escapeKebabCase', () => { ); }); - it('special path', () => { - const expression = '$root.spec.some-$special-path'; - expect(escapeKebabCase(expression)).toBe('$root.spec.`some-$special-path`'); - }); - it('direct follow-up 1', () => { const expression = '$root.spec.my-kebab-path.subPath!=true'; expect(escapeKebabCase(expression)).toBe(