From f4293213be0722b58e0e62849a06864875d15c92 Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Wed, 11 Oct 2023 08:35:51 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20475:=20=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2786: 画面実装](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2786) - ワークフロー一覧画面からワークフローを削除する処理を追加しました。 - アカウント画面の実装について想定外の変更となっていた、部品の不要なクラスを削除しました。 - クラスに当たっていた`required`はクラスではなくタグの属性だったため削除して属性に設定しています。 ## レビューポイント - 削除処理は適切か。 - アカウント画面の対応内容に問題はないか - `select`の`required`は不要だと思いますがいかがでしょうか? ## UIの変更 - [Task2786](https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task2786?csf=1&web=1&e=0TlIXM) ## 動作確認状況 - ローカルで確認 - 実際にAPIで削除しての動作は未検証です。 --- dictation_client/src/api/api.ts | 488 +++++++++++++++++- .../src/features/account/operations.ts | 2 +- .../src/features/workflow/operations.ts | 47 +- .../src/features/workflow/workflowSlice.ts | 10 + .../src/pages/AccountPage/index.tsx | 11 +- .../src/pages/WorkflowPage/index.tsx | 32 +- dictation_client/src/styles/app.module.scss | 100 +++- .../src/styles/app.module.scss.d.ts | 10 +- 8 files changed, 657 insertions(+), 43 deletions(-) diff --git a/dictation_client/src/api/api.ts b/dictation_client/src/api/api.ts index 36a1050..2357449 100644 --- a/dictation_client/src/api/api.ts +++ b/dictation_client/src/api/api.ts @@ -530,7 +530,7 @@ export interface CreateTypistGroupRequest { */ export interface CreateWorkflowsRequest { /** - * Authornの内部ID + * Authorの内部ID * @type {number} * @memberof CreateWorkflowsRequest */ @@ -643,6 +643,32 @@ export interface ErrorResponse { */ 'code': string; } +/** + * + * @export + * @interface GetAccountInfoMinimalAccessRequest + */ +export interface GetAccountInfoMinimalAccessRequest { + /** + * idトークン + * @type {string} + * @memberof GetAccountInfoMinimalAccessRequest + */ + 'idToken': string; +} +/** + * + * @export + * @interface GetAccountInfoMinimalAccessResponse + */ +export interface GetAccountInfoMinimalAccessResponse { + /** + * 階層 + * @type {number} + * @memberof GetAccountInfoMinimalAccessResponse + */ + 'tier': number; +} /** * * @export @@ -1860,6 +1886,31 @@ export interface TypistGroup { */ 'name': string; } +/** + * + * @export + * @interface UpdateAcceptedVersionRequest + */ +export interface UpdateAcceptedVersionRequest { + /** + * IDトークン + * @type {string} + * @memberof UpdateAcceptedVersionRequest + */ + 'idToken': string; + /** + * 更新バージョン(EULA) + * @type {string} + * @memberof UpdateAcceptedVersionRequest + */ + 'acceptedEULAVersion': string; + /** + * 更新バージョン(DPA) + * @type {string} + * @memberof UpdateAcceptedVersionRequest + */ + 'acceptedDPAVersion'?: string; +} /** * * @export @@ -1923,6 +1974,37 @@ export interface UpdateTypistGroupRequest { */ 'typistIds': Array; } +/** + * + * @export + * @interface UpdateWorkflowRequest + */ +export interface UpdateWorkflowRequest { + /** + * Authorの内部ID + * @type {number} + * @memberof UpdateWorkflowRequest + */ + 'authorId': number; + /** + * Worktypeの内部ID + * @type {number} + * @memberof UpdateWorkflowRequest + */ + 'worktypeId'?: number; + /** + * テンプレートの内部ID + * @type {number} + * @memberof UpdateWorkflowRequest + */ + 'templateId'?: number; + /** + * ルーティング候補のタイピストユーザー/タイピストグループ + * @type {Array} + * @memberof UpdateWorkflowRequest + */ + 'typists': Array; +} /** * * @export @@ -2408,9 +2490,9 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteAccount: async (deleteAccountRequest: DeleteAccountRequest, options: AxiosRequestConfig = {}): Promise => { + deleteAccountAndData: async (deleteAccountRequest: DeleteAccountRequest, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'deleteAccountRequest' is not null or undefined - assertParamExists('deleteAccount', 'deleteAccountRequest', deleteAccountRequest) + assertParamExists('deleteAccountAndData', 'deleteAccountRequest', deleteAccountRequest) const localVarPath = `/accounts/delete`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -2441,6 +2523,42 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat options: localVarRequestOptions, }; }, + /** + * + * @summary + * @param {GetAccountInfoMinimalAccessRequest} getAccountInfoMinimalAccessRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountInfoMinimalAccess: async (getAccountInfoMinimalAccessRequest: GetAccountInfoMinimalAccessRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'getAccountInfoMinimalAccessRequest' is not null or undefined + assertParamExists('getAccountInfoMinimalAccess', 'getAccountInfoMinimalAccessRequest', getAccountInfoMinimalAccessRequest) + const localVarPath = `/accounts/minimal-access`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(getAccountInfoMinimalAccessRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * ログインしているユーザーのアカウント配下のAuthor一覧を取得します * @summary @@ -3180,8 +3298,19 @@ export const AccountsApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async deleteAccount(deleteAccountRequest: DeleteAccountRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAccount(deleteAccountRequest, options); + async deleteAccountAndData(deleteAccountRequest: DeleteAccountRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAccountAndData(deleteAccountRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary + * @param {GetAccountInfoMinimalAccessRequest} getAccountInfoMinimalAccessRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest: GetAccountInfoMinimalAccessRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -3446,8 +3575,18 @@ export const AccountsApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - deleteAccount(deleteAccountRequest: DeleteAccountRequest, options?: any): AxiosPromise { - return localVarFp.deleteAccount(deleteAccountRequest, options).then((request) => request(axios, basePath)); + deleteAccountAndData(deleteAccountRequest: DeleteAccountRequest, options?: any): AxiosPromise { + return localVarFp.deleteAccountAndData(deleteAccountRequest, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary + * @param {GetAccountInfoMinimalAccessRequest} getAccountInfoMinimalAccessRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest: GetAccountInfoMinimalAccessRequest, options?: any): AxiosPromise { + return localVarFp.getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest, options).then((request) => request(axios, basePath)); }, /** * ログインしているユーザーのアカウント配下のAuthor一覧を取得します @@ -3707,8 +3846,20 @@ export class AccountsApi extends BaseAPI { * @throws {RequiredError} * @memberof AccountsApi */ - public deleteAccount(deleteAccountRequest: DeleteAccountRequest, options?: AxiosRequestConfig) { - return AccountsApiFp(this.configuration).deleteAccount(deleteAccountRequest, options).then((request) => request(this.axios, this.basePath)); + public deleteAccountAndData(deleteAccountRequest: DeleteAccountRequest, options?: AxiosRequestConfig) { + return AccountsApiFp(this.configuration).deleteAccountAndData(deleteAccountRequest, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary + * @param {GetAccountInfoMinimalAccessRequest} getAccountInfoMinimalAccessRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountsApi + */ + public getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest: GetAccountInfoMinimalAccessRequest, options?: AxiosRequestConfig) { + return AccountsApiFp(this.configuration).getAccountInfoMinimalAccess(getAccountInfoMinimalAccessRequest, options).then((request) => request(this.axios, this.basePath)); } /** @@ -5981,6 +6132,105 @@ export class TemplatesApi extends BaseAPI { +/** + * TermsApi - axios parameter creator + * @export + */ +export const TermsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTermsInfo: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/terms`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * TermsApi - functional programming interface + * @export + */ +export const TermsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = TermsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getTermsInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getTermsInfo(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * TermsApi - factory interface + * @export + */ +export const TermsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = TermsApiFp(configuration) + return { + /** + * + * @summary + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getTermsInfo(options?: any): AxiosPromise { + return localVarFp.getTermsInfo(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * TermsApi - object-oriented interface + * @export + * @class TermsApi + * @extends {BaseAPI} + */ +export class TermsApi extends BaseAPI { + /** + * + * @summary + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TermsApi + */ + public getTermsInfo(options?: AxiosRequestConfig) { + return TermsApiFp(this.configuration).getTermsInfo(options).then((request) => request(this.axios, this.basePath)); + } +} + + + /** * UsersApi - axios parameter creator * @export @@ -6281,6 +6531,42 @@ export const UsersApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, + /** + * 利用規約同意バージョンを更新 + * @summary + * @param {UpdateAcceptedVersionRequest} updateAcceptedVersionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateAcceptedVersion: async (updateAcceptedVersionRequest: UpdateAcceptedVersionRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'updateAcceptedVersionRequest' is not null or undefined + assertParamExists('updateAcceptedVersion', 'updateAcceptedVersionRequest', updateAcceptedVersionRequest) + const localVarPath = `/users/accepted-version`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(updateAcceptedVersionRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * ログインしているユーザーのタスクソート条件を更新します * @summary @@ -6456,6 +6742,17 @@ export const UsersApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.signup(signupRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * 利用規約同意バージョンを更新 + * @summary + * @param {UpdateAcceptedVersionRequest} updateAcceptedVersionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateAcceptedVersion(updateAcceptedVersionRequest: UpdateAcceptedVersionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateAcceptedVersion(updateAcceptedVersionRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * ログインしているユーザーのタスクソート条件を更新します * @summary @@ -6565,6 +6862,16 @@ export const UsersApiFactory = function (configuration?: Configuration, basePath signup(signupRequest: SignupRequest, options?: any): AxiosPromise { return localVarFp.signup(signupRequest, options).then((request) => request(axios, basePath)); }, + /** + * 利用規約同意バージョンを更新 + * @summary + * @param {UpdateAcceptedVersionRequest} updateAcceptedVersionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateAcceptedVersion(updateAcceptedVersionRequest: UpdateAcceptedVersionRequest, options?: any): AxiosPromise { + return localVarFp.updateAcceptedVersion(updateAcceptedVersionRequest, options).then((request) => request(axios, basePath)); + }, /** * ログインしているユーザーのタスクソート条件を更新します * @summary @@ -6688,6 +6995,18 @@ export class UsersApi extends BaseAPI { return UsersApiFp(this.configuration).signup(signupRequest, options).then((request) => request(this.axios, this.basePath)); } + /** + * 利用規約同意バージョンを更新 + * @summary + * @param {UpdateAcceptedVersionRequest} updateAcceptedVersionRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UsersApi + */ + public updateAcceptedVersion(updateAcceptedVersionRequest: UpdateAcceptedVersionRequest, options?: AxiosRequestConfig) { + return UsersApiFp(this.configuration).updateAcceptedVersion(updateAcceptedVersionRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** * ログインしているユーザーのタスクソート条件を更新します * @summary @@ -6761,6 +7080,44 @@ export const WorkflowsApiAxiosParamCreator = function (configuration?: Configura options: localVarRequestOptions, }; }, + /** + * アカウント内のワークフローを削除します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWorkflow: async (workflowId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'workflowId' is not null or undefined + assertParamExists('deleteWorkflow', 'workflowId', workflowId) + const localVarPath = `/workflows/{workflowId}/delete` + .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * アカウント内のワークフローの一覧を取得します * @summary @@ -6790,6 +7147,50 @@ export const WorkflowsApiAxiosParamCreator = function (configuration?: Configura let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * アカウント内のワークフローを編集します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {UpdateWorkflowRequest} updateWorkflowRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWorkflow: async (workflowId: number, updateWorkflowRequest: UpdateWorkflowRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'workflowId' is not null or undefined + assertParamExists('updateWorkflow', 'workflowId', workflowId) + // verify required parameter 'updateWorkflowRequest' is not null or undefined + assertParamExists('updateWorkflow', 'updateWorkflowRequest', updateWorkflowRequest) + const localVarPath = `/workflows/{workflowId}` + .replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(updateWorkflowRequest, localVarRequestOptions, configuration) + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -6816,6 +7217,17 @@ export const WorkflowsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.createWorkflows(createWorkflowsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * アカウント内のワークフローを削除します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteWorkflow(workflowId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteWorkflow(workflowId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * アカウント内のワークフローの一覧を取得します * @summary @@ -6826,6 +7238,18 @@ export const WorkflowsApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getWorkflows(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * アカウント内のワークフローを編集します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {UpdateWorkflowRequest} updateWorkflowRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateWorkflow(workflowId: number, updateWorkflowRequest: UpdateWorkflowRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateWorkflow(workflowId, updateWorkflowRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -6846,6 +7270,16 @@ export const WorkflowsApiFactory = function (configuration?: Configuration, base createWorkflows(createWorkflowsRequest: CreateWorkflowsRequest, options?: any): AxiosPromise { return localVarFp.createWorkflows(createWorkflowsRequest, options).then((request) => request(axios, basePath)); }, + /** + * アカウント内のワークフローを削除します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteWorkflow(workflowId: number, options?: any): AxiosPromise { + return localVarFp.deleteWorkflow(workflowId, options).then((request) => request(axios, basePath)); + }, /** * アカウント内のワークフローの一覧を取得します * @summary @@ -6855,6 +7289,17 @@ export const WorkflowsApiFactory = function (configuration?: Configuration, base getWorkflows(options?: any): AxiosPromise { return localVarFp.getWorkflows(options).then((request) => request(axios, basePath)); }, + /** + * アカウント内のワークフローを編集します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {UpdateWorkflowRequest} updateWorkflowRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateWorkflow(workflowId: number, updateWorkflowRequest: UpdateWorkflowRequest, options?: any): AxiosPromise { + return localVarFp.updateWorkflow(workflowId, updateWorkflowRequest, options).then((request) => request(axios, basePath)); + }, }; }; @@ -6877,6 +7322,18 @@ export class WorkflowsApi extends BaseAPI { return WorkflowsApiFp(this.configuration).createWorkflows(createWorkflowsRequest, options).then((request) => request(this.axios, this.basePath)); } + /** + * アカウント内のワークフローを削除します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WorkflowsApi + */ + public deleteWorkflow(workflowId: number, options?: AxiosRequestConfig) { + return WorkflowsApiFp(this.configuration).deleteWorkflow(workflowId, options).then((request) => request(this.axios, this.basePath)); + } + /** * アカウント内のワークフローの一覧を取得します * @summary @@ -6887,6 +7344,19 @@ export class WorkflowsApi extends BaseAPI { public getWorkflows(options?: AxiosRequestConfig) { return WorkflowsApiFp(this.configuration).getWorkflows(options).then((request) => request(this.axios, this.basePath)); } + + /** + * アカウント内のワークフローを編集します + * @summary + * @param {number} workflowId ワークフローの内部ID + * @param {UpdateWorkflowRequest} updateWorkflowRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof WorkflowsApi + */ + public updateWorkflow(workflowId: number, updateWorkflowRequest: UpdateWorkflowRequest, options?: AxiosRequestConfig) { + return WorkflowsApiFp(this.configuration).updateWorkflow(workflowId, updateWorkflowRequest, options).then((request) => request(this.axios, this.basePath)); + } } diff --git a/dictation_client/src/features/account/operations.ts b/dictation_client/src/features/account/operations.ts index 03b242f..292680b 100644 --- a/dictation_client/src/features/account/operations.ts +++ b/dictation_client/src/features/account/operations.ts @@ -130,7 +130,7 @@ export const deleteAccountAsync = createAsyncThunk< const accountApi = new AccountsApi(config); try { - await accountApi.deleteAccount(deleteAccounRequest, { + await accountApi.deleteAccountAndData(deleteAccounRequest, { headers: { authorization: `Bearer ${accessToken}` }, }); diff --git a/dictation_client/src/features/workflow/operations.ts b/dictation_client/src/features/workflow/operations.ts index 76e84a5..7810d20 100644 --- a/dictation_client/src/features/workflow/operations.ts +++ b/dictation_client/src/features/workflow/operations.ts @@ -16,7 +16,6 @@ import type { RootState } from "app/store"; import { ErrorObject, createErrorObject } from "common/errors"; import { openSnackbar } from "features/ui/uiSlice"; import { getTranslationID } from "translation"; -import { WorkflowRelations } from "./state"; export const listWorkflowAsync = createAsyncThunk< GetWorkflowsResponse, @@ -211,3 +210,49 @@ export const getworkflowRelationsAsync = createAsyncThunk< return thunkApi.rejectWithValue({ error }); } }); + +export const deleteWorkflowAsync = createAsyncThunk< + { + /* Empty Object */ + }, + { workflowId: number }, + { + // rejectした時の返却値の型 + rejectValue: { + error: ErrorObject; + }; + } +>("workflow/deleteWorkflowAsync", async (args, thunkApi) => { + const { workflowId } = args; + // apiのConfigurationを取得する + const { getState } = thunkApi; + const state = getState() as RootState; + const { configuration, accessToken } = state.auth; + const config = new Configuration(configuration); + const workflowsApi = new WorkflowsApi(config); + + try { + await workflowsApi.deleteWorkflow(workflowId, { + headers: { authorization: `Bearer ${accessToken}` }, + }); + + thunkApi.dispatch( + openSnackbar({ + level: "info", + message: getTranslationID("common.message.success"), + }) + ); + return {}; + } catch (e) { + // e ⇒ errorObjectに変換" + const error = createErrorObject(e); + + thunkApi.dispatch( + openSnackbar({ + level: "error", + message: getTranslationID("common.message.internalServerError"), + }) + ); + return thunkApi.rejectWithValue({ error }); + } +}); diff --git a/dictation_client/src/features/workflow/workflowSlice.ts b/dictation_client/src/features/workflow/workflowSlice.ts index bb6aa9f..4011d19 100644 --- a/dictation_client/src/features/workflow/workflowSlice.ts +++ b/dictation_client/src/features/workflow/workflowSlice.ts @@ -3,6 +3,7 @@ import { Assignee } from "api"; import { createWorkflowAsync, getworkflowRelationsAsync, + deleteWorkflowAsync, listWorkflowAsync, } from "./operations"; import { WorkflowState } from "./state"; @@ -127,6 +128,15 @@ export const workflowSlice = createSlice({ builder.addCase(createWorkflowAsync.rejected, (state) => { state.apps.isAddLoading = false; }); + builder.addCase(deleteWorkflowAsync.pending, (state) => { + state.apps.isLoading = true; + }); + builder.addCase(deleteWorkflowAsync.fulfilled, (state) => { + state.apps.isLoading = false; + }); + builder.addCase(deleteWorkflowAsync.rejected, (state) => { + state.apps.isLoading = false; + }); }, }); diff --git a/dictation_client/src/pages/AccountPage/index.tsx b/dictation_client/src/pages/AccountPage/index.tsx index d40d452..d136510 100644 --- a/dictation_client/src/pages/AccountPage/index.tsx +++ b/dictation_client/src/pages/AccountPage/index.tsx @@ -149,7 +149,8 @@ const AccountPage: React.FC = (): JSX.Element => { {isTier5 && !viewInfo.account.parentAccountName && (
{ dispatch( changePrimaryAdministrator({ @@ -303,8 +304,8 @@ const AccountPage: React.FC = (): JSX.Element => {