diff --git a/client/src/api/configTemplates.ts b/client/src/api/configTemplates.ts index 248ea2b4b934..09b6348739e9 100644 --- a/client/src/api/configTemplates.ts +++ b/client/src/api/configTemplates.ts @@ -19,6 +19,12 @@ export type SecretData = CreateInstancePayload["secrets"]; 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 f1bba9373c56..cfe270edf373 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -925,6 +925,12 @@ export interface paths { patch?: never; trace?: never; }; + "/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": { parameters: { query?: never; @@ -3306,6 +3312,12 @@ export interface paths { patch?: never; trace?: never; }; + "/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": { parameters: { query?: never; @@ -15775,6 +15787,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: { /** @@ -20100,6 +20132,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: { parameters: { query?: never; @@ -28431,6 +28524,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: { parameters: { query?: never; 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 +