Skip to content

Commit ce06f87

Browse files
remove the requirement to have service selector when service data is provided (#107)
Co-authored-by: Stanislav <[email protected]>
1 parent 7719ca0 commit ce06f87

File tree

4 files changed

+3
-36
lines changed

4 files changed

+3
-36
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@cloudquery/plugin-config-ui-lib",
33
"description": "Plugin configuration UI library for CloudQuery Cloud App",
4-
"version": "11.1.0",
4+
"version": "11.2.0",
55
"private": false,
66
"main": "dist/index.cjs.js",
77
"module": "dist/index.esm.js",

src/context/utils/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ export const errorMessages = {
3232
'Config cannot include both a control-table-selector and control-services-selector component',
3333
config_no_table_selector:
3434
'Config must include a control-table-selector component when getTablesData returns a non-empty list of tables',
35-
config_no_service_selector:
36-
'Config must include a control-services-selector component when getServicesData returns a non-empty list of services',
3735
};
3836

3937
// These form value names are controlled entirely from within the lib

src/context/utils/validateConfig.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -163,36 +163,5 @@ export function validateConfig(
163163
}
164164
}
165165

166-
if (servicesList && servicesList.length > 0) {
167-
const hasServiceSelector = (
168-
steps: (RenderSection | LayoutComponent | ReservedLayoutComponent)[],
169-
): boolean => {
170-
return steps.some((step) => {
171-
if (step.component === 'control-services-selector') {
172-
return true;
173-
}
174-
if ((step as RenderSection).children && Array.isArray((step as RenderSection).children)) {
175-
return hasServiceSelector(
176-
(step as RenderSection).children as (
177-
| RenderSection
178-
| LayoutComponent
179-
| ReservedLayoutComponent
180-
)[],
181-
);
182-
}
183-
184-
return false;
185-
});
186-
};
187-
188-
if (
189-
!hasServiceSelector(
190-
config.steps as (RenderSection | LayoutComponent | ReservedLayoutComponent)[],
191-
)
192-
) {
193-
throw new Error(errorMessages.config_no_service_selector);
194-
}
195-
}
196-
197166
return config;
198167
}

0 commit comments

Comments
 (0)