diff --git a/client/src/api/configTemplates.ts b/client/src/api/configTemplates.ts index 51b21382c505..187c3a5931a9 100644 --- a/client/src/api/configTemplates.ts +++ b/client/src/api/configTemplates.ts @@ -17,6 +17,12 @@ export type SecretData = { [key: string]: string }; export type PluginAspectStatus = components["schemas"]["PluginAspectStatus"]; export type PluginStatus = components["schemas"]["PluginStatus"]; +export type CreateInstancePayload = components["schemas"]["CreateInstancePayload"]; +export type UpgradeInstancePayload = components["schemas"]["UpgradeInstancePayload"]; +export type TestUpgradeInstancePayload = components["schemas"]["TestUpgradeInstancePayload"]; +export type UpdateInstancePayload = components["schemas"]["UpdateInstancePayload"]; +export type TestUpdateInstancePayload = components["schemas"]["TestUpdateInstancePayload"]; + export interface TemplateSummary { description: string | null; hidden?: boolean; diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 2db6faeb1963..389a25f52387 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -322,6 +322,12 @@ export interface paths { /** Purge user file source instance. */ delete: operations["file_sources__instances_purge"]; }; + "/api/file_source_instances/{user_file_source_id}/test": { + /** Test a file source instance and return status. */ + get: operations["file_sources__instances_test_instance"]; + /** Test updating or upgrading user file source instance. */ + post: operations["file_sources__test_instances_update"]; + }; "/api/file_source_templates": { /** Get a list of file source templates available to build user defined file sources from */ get: operations["file_sources__templates_index"]; @@ -1273,6 +1279,12 @@ export interface paths { /** Purge user object store instance. */ delete: operations["object_stores__instances_purge"]; }; + "/api/object_store_instances/{user_object_store_id}/test": { + /** Get a persisted user object store instance. */ + get: operations["object_stores__instances_test_instance"]; + /** Test updating or upgrading user object source instance. */ + post: operations["object_stores__test_instances_update"]; + }; "/api/object_store_templates": { /** Get a list of object store templates available to build user defined object stores from */ get: operations["object_stores__templates_index"]; @@ -11996,6 +12008,26 @@ export interface components { */ type: "string"; }; + /** TestUpdateInstancePayload */ + TestUpdateInstancePayload: { + /** Variables */ + variables?: { + [key: string]: (string | boolean | number) | undefined; + } | null; + }; + /** TestUpgradeInstancePayload */ + TestUpgradeInstancePayload: { + /** Secrets */ + secrets: { + [key: string]: string | undefined; + }; + /** Template Version */ + template_version: number; + /** Variables */ + variables: { + [key: string]: (string | boolean | number) | undefined; + }; + }; /** ToolDataDetails */ ToolDataDetails: { /** @@ -15062,6 +15094,67 @@ export interface operations { }; }; }; + file_sources__instances_test_instance: { + /** Test a file source instance and return status. */ + parameters: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The UUID index for a persisted UserFileSourceStore object. */ + path: { + user_file_source_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["PluginStatus"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + file_sources__test_instances_update: { + /** Test updating or upgrading user file source instance. */ + parameters: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The UUID index for a persisted UserFileSourceStore object. */ + path: { + user_file_source_id: string; + }; + }; + requestBody: { + content: { + "application/json": + | components["schemas"]["TestUpgradeInstancePayload"] + | components["schemas"]["TestUpdateInstancePayload"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["PluginStatus"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; file_sources__templates_index: { /** Get a list of file source templates available to build user defined file sources from */ parameters?: { @@ -20986,6 +21079,67 @@ export interface operations { }; }; }; + object_stores__instances_test_instance: { + /** Get a persisted user object store instance. */ + parameters: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The UUID used to identify a persisted UserObjectStore object. */ + path: { + user_object_store_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["PluginStatus"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; + object_stores__test_instances_update: { + /** Test updating or upgrading user object source instance. */ + parameters: { + /** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */ + header?: { + "run-as"?: string | null; + }; + /** @description The UUID used to identify a persisted UserObjectStore object. */ + path: { + user_object_store_id: string; + }; + }; + requestBody: { + content: { + "application/json": + | components["schemas"]["TestUpgradeInstancePayload"] + | components["schemas"]["TestUpdateInstancePayload"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["PluginStatus"]; + }; + }; + /** @description Validation Error */ + 422: { + content: { + "application/json": components["schemas"]["HTTPValidationError"]; + }; + }; + }; + }; object_stores__templates_index: { /** Get a list of object store templates available to build user defined object stores from */ parameters?: { diff --git a/client/src/components/ConfigTemplates/ActionSummary.vue b/client/src/components/ConfigTemplates/ActionSummary.vue new file mode 100644 index 000000000000..6e4652a584fe --- /dev/null +++ b/client/src/components/ConfigTemplates/ActionSummary.vue @@ -0,0 +1,29 @@ + + + diff --git a/client/src/components/ConfigTemplates/ConfigurationTestItem.vue b/client/src/components/ConfigTemplates/ConfigurationTestItem.vue new file mode 100644 index 000000000000..3d360b35b708 --- /dev/null +++ b/client/src/components/ConfigTemplates/ConfigurationTestItem.vue @@ -0,0 +1,32 @@ + + + diff --git a/client/src/components/ConfigTemplates/ConfigurationTestSummary.vue b/client/src/components/ConfigTemplates/ConfigurationTestSummary.vue new file mode 100644 index 000000000000..be17f1593821 --- /dev/null +++ b/client/src/components/ConfigTemplates/ConfigurationTestSummary.vue @@ -0,0 +1,21 @@ + + + diff --git a/client/src/components/ConfigTemplates/ConfigurationTestSummaryModal.vue b/client/src/components/ConfigTemplates/ConfigurationTestSummaryModal.vue new file mode 100644 index 000000000000..22fa8a8b4736 --- /dev/null +++ b/client/src/components/ConfigTemplates/ConfigurationTestSummaryModal.vue @@ -0,0 +1,39 @@ + + + diff --git a/client/src/components/ConfigTemplates/ForceActionButton.vue b/client/src/components/ConfigTemplates/ForceActionButton.vue new file mode 100644 index 000000000000..55d42274f388 --- /dev/null +++ b/client/src/components/ConfigTemplates/ForceActionButton.vue @@ -0,0 +1,17 @@ + + + diff --git a/client/src/components/ConfigTemplates/InstanceDropdown.test.ts b/client/src/components/ConfigTemplates/InstanceDropdown.test.ts index e29d8d883113..abfca1e3070a 100644 --- a/client/src/components/ConfigTemplates/InstanceDropdown.test.ts +++ b/client/src/components/ConfigTemplates/InstanceDropdown.test.ts @@ -19,7 +19,7 @@ describe("InstanceDropdown", () => { }); const menu = wrapper.find(".dropdown-menu"); const links = menu.findAll("button.dropdown-item"); - expect(links.length).toBe(2); + expect(links.length).toBe(3); }); it("should render a drop down with upgrade if upgrade available as an option", async () => { @@ -35,6 +35,6 @@ describe("InstanceDropdown", () => { }); const menu = wrapper.find(".dropdown-menu"); const links = menu.findAll("button.dropdown-item"); - expect(links.length).toBe(3); + expect(links.length).toBe(4); }); }); diff --git a/client/src/components/ConfigTemplates/InstanceDropdown.vue b/client/src/components/ConfigTemplates/InstanceDropdown.vue index 95bbbf863cb8..f3fc2cebddd0 100644 --- a/client/src/components/ConfigTemplates/InstanceDropdown.vue +++ b/client/src/components/ConfigTemplates/InstanceDropdown.vue @@ -1,6 +1,6 @@ @@ -53,6 +54,10 @@ const emit = defineEmits<{ Edit configuration +