diff --git a/dictation_client/src/api/api.ts b/dictation_client/src/api/api.ts
index 429eb58..0c2ff5c 100644
--- a/dictation_client/src/api/api.ts
+++ b/dictation_client/src/api/api.ts
@@ -757,6 +757,25 @@ export interface GetPartnerLicensesResponse {
*/
'childrenPartnerLicenses': Array;
}
+/**
+ *
+ * @export
+ * @interface GetPartnersResponse
+ */
+export interface GetPartnersResponse {
+ /**
+ * 合計件数
+ * @type {number}
+ * @memberof GetPartnersResponse
+ */
+ 'total': number;
+ /**
+ *
+ * @type {Array}
+ * @memberof GetPartnersResponse
+ */
+ 'partners': Array;
+}
/**
*
* @export
@@ -1028,6 +1047,55 @@ export interface OptionItemList {
*/
'optionItemList': Array;
}
+/**
+ *
+ * @export
+ * @interface Partner
+ */
+export interface Partner {
+ /**
+ * 会社名
+ * @type {string}
+ * @memberof Partner
+ */
+ 'name': string;
+ /**
+ * 階層
+ * @type {number}
+ * @memberof Partner
+ */
+ 'tier': number;
+ /**
+ * アカウントID
+ * @type {number}
+ * @memberof Partner
+ */
+ 'accountId': number;
+ /**
+ * 国
+ * @type {string}
+ * @memberof Partner
+ */
+ 'country': string;
+ /**
+ * プライマリ管理者
+ * @type {string}
+ * @memberof Partner
+ */
+ 'primaryAdmin': string;
+ /**
+ * プライマリ管理者メールアドレス
+ * @type {string}
+ * @memberof Partner
+ */
+ 'email': string;
+ /**
+ * 代行操作許可
+ * @type {boolean}
+ * @memberof Partner
+ */
+ 'dealerManagement': boolean;
+}
/**
*
* @export
@@ -1528,6 +1596,25 @@ export interface UpdateTypistGroupRequest {
*/
'typistIds': Array;
}
+/**
+ *
+ * @export
+ * @interface UpdateWorktypesRequest
+ */
+export interface UpdateWorktypesRequest {
+ /**
+ * WorktypeID
+ * @type {string}
+ * @memberof UpdateWorktypesRequest
+ */
+ 'worktypeId': string;
+ /**
+ * Worktypeの説明
+ * @type {string}
+ * @memberof UpdateWorktypesRequest
+ */
+ 'description'?: string;
+}
/**
*
* @export
@@ -2037,6 +2124,54 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
options: localVarRequestOptions,
};
},
+ /**
+ *
+ * @summary
+ * @param {number} limit 取得件数
+ * @param {number} offset 開始位置
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ getPartners: async (limit: number, offset: number, options: AxiosRequestConfig = {}): Promise => {
+ // verify required parameter 'limit' is not null or undefined
+ assertParamExists('getPartners', 'limit', limit)
+ // verify required parameter 'offset' is not null or undefined
+ assertParamExists('getPartners', 'offset', offset)
+ const localVarPath = `/accounts/partners`;
+ // 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: 'GET', ...baseOptions, ...options};
+ const localVarHeaderParameter = {} as any;
+ const localVarQueryParameter = {} as any;
+
+ // authentication bearer required
+ // http bearer authentication required
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
+
+ if (limit !== undefined) {
+ localVarQueryParameter['limit'] = limit;
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameter['offset'] = offset;
+ }
+
+
+
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+ return {
+ url: toPathString(localVarUrlObj),
+ options: localVarRequestOptions,
+ };
+ },
/**
* ログインしているユーザーのアカウント配下でIDで指定されたタイピストグループを取得します
* @summary
@@ -2256,6 +2391,50 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateTypistGroupRequest, localVarRequestOptions, configuration)
+ return {
+ url: toPathString(localVarUrlObj),
+ options: localVarRequestOptions,
+ };
+ },
+ /**
+ *
+ * @summary
+ * @param {number} id Worktypeの内部ID
+ * @param {UpdateWorktypesRequest} updateWorktypesRequest
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ updateWorktype: async (id: number, updateWorktypesRequest: UpdateWorktypesRequest, options: AxiosRequestConfig = {}): Promise => {
+ // verify required parameter 'id' is not null or undefined
+ assertParamExists('updateWorktype', 'id', id)
+ // verify required parameter 'updateWorktypesRequest' is not null or undefined
+ assertParamExists('updateWorktype', 'updateWorktypesRequest', updateWorktypesRequest)
+ const localVarPath = `/accounts/worktypes/{id}`
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
+ // 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(updateWorktypesRequest, localVarRequestOptions, configuration)
+
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
@@ -2379,6 +2558,18 @@ export const AccountsApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPartnerLicenses(getPartnerLicensesRequest, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
+ /**
+ *
+ * @summary
+ * @param {number} limit 取得件数
+ * @param {number} offset 開始位置
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async getPartners(limit: number, offset: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> {
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPartners(limit, offset, options);
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
+ },
/**
* ログインしているユーザーのアカウント配下でIDで指定されたタイピストグループを取得します
* @summary
@@ -2443,6 +2634,18 @@ export const AccountsApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateTypistGroup(typistGroupId, updateTypistGroupRequest, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
+ /**
+ *
+ * @summary
+ * @param {number} id Worktypeの内部ID
+ * @param {UpdateWorktypesRequest} updateWorktypesRequest
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ async updateWorktype(id: number, updateWorktypesRequest: UpdateWorktypesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise
-
diff --git a/dictation_client/src/pages/WorkTypeIdSettingPage/editWorktypeIdPopup.tsx b/dictation_client/src/pages/WorkTypeIdSettingPage/editWorktypeIdPopup.tsx
new file mode 100644
index 0000000..248005b
--- /dev/null
+++ b/dictation_client/src/pages/WorkTypeIdSettingPage/editWorktypeIdPopup.tsx
@@ -0,0 +1,162 @@
+import React, { useCallback, useState } from "react";
+import { useTranslation } from "react-i18next";
+import styles from "styles/app.module.scss";
+import { useDispatch, useSelector } from "react-redux";
+import {
+ editWorktypeAsync,
+ changeDescription,
+ changeWorktypeId,
+ cleanupWorktype,
+ listWorktypesAsync,
+ selectDescription,
+ selectHasErrorWorktypeId,
+ selectIsEditLoading,
+ selectWorktypeId,
+} from "features/workflow/worktype";
+import { AppDispatch } from "app/store";
+import { getTranslationID } from "translation";
+import close from "../../assets/images/close.svg";
+import progress_activit from "../../assets/images/progress_activit.svg";
+
+// popupのpropsの型定義
+interface EditWorktypeIdPopupProps {
+ onClose: () => void;
+ isOpen: boolean;
+}
+
+export const EditWorktypeIdPopup: React.FC = (
+ props: EditWorktypeIdPopupProps
+): JSX.Element => {
+ const { onClose, isOpen } = props;
+ const [t] = useTranslation();
+ const dispatch: AppDispatch = useDispatch();
+ const isEditLoading = useSelector(selectIsEditLoading);
+ const worktypeId = useSelector(selectWorktypeId);
+ const description = useSelector(selectDescription);
+ // 保存ボタンを押したかどうか
+ const [isPushSaveButton, setIsPushSaveButton] = useState(false);
+ // WorktypeIdのバリデーションチェック
+ const { hasIncorrectPatternWorktypeId, isEmptyWorktypeId } = useSelector(
+ selectHasErrorWorktypeId
+ );
+
+ // ×ボタンを押した時の処理
+ const closePopup = useCallback(() => {
+ if (isEditLoading) {
+ return;
+ }
+ dispatch(cleanupWorktype());
+ setIsPushSaveButton(false);
+ onClose();
+ }, [onClose, dispatch, isEditLoading]);
+
+ // 保存ボタンを押した時の処理
+ const saveWorktypeId = useCallback(async () => {
+ setIsPushSaveButton(true);
+ if (isEmptyWorktypeId || hasIncorrectPatternWorktypeId) {
+ return;
+ }
+ const { meta } = await dispatch(editWorktypeAsync());
+ if (meta.requestStatus === "fulfilled") {
+ dispatch(listWorktypesAsync());
+ closePopup();
+ }
+ }, [closePopup, dispatch, hasIncorrectPatternWorktypeId, isEmptyWorktypeId]);
+
+ return (
+
+
+
+ {t(getTranslationID("worktypeIdSetting.label.editWorktypeId"))}
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions */}
+
+
+
+
+
+ );
+};
diff --git a/dictation_client/src/pages/WorkTypeIdSettingPage/index.tsx b/dictation_client/src/pages/WorkTypeIdSettingPage/index.tsx
index ef20581..6d3e7cf 100644
--- a/dictation_client/src/pages/WorkTypeIdSettingPage/index.tsx
+++ b/dictation_client/src/pages/WorkTypeIdSettingPage/index.tsx
@@ -10,12 +10,16 @@ import progress_activit from "assets/images/progress_activit.svg";
import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import {
+ changeSelectedId,
+ changeWorktypeId,
+ changeDescription,
listWorktypesAsync,
selectIsLoading,
selectWorktypes,
} from "features/workflow/worktype";
import { AppDispatch } from "app/store";
import { AddWorktypeIdPopup } from "./addWorktypeIdPopup";
+import { EditWorktypeIdPopup } from "./editWorktypeIdPopup";
const WorktypeIdSettingPage: React.FC = (): JSX.Element => {
const dispatch: AppDispatch = useDispatch();
@@ -25,6 +29,8 @@ const WorktypeIdSettingPage: React.FC = (): JSX.Element => {
const [selectedRow, setSelectedRow] = useState(NaN);
// 追加Popupの表示制御
const [isShowAddPopup, setIsShowAddPopup] = useState(false);
+ // 編集Popupの表示制御
+ const [isShowEditPopup, setIsShowEditPopup] = useState(false);
useEffect(() => {
dispatch(listWorktypesAsync());
}, [dispatch]);
@@ -37,6 +43,12 @@ const WorktypeIdSettingPage: React.FC = (): JSX.Element => {
}}
isOpen={isShowAddPopup}
/>
+ {
+ setIsShowEditPopup(false);
+ }}
+ isOpen={isShowEditPopup}
+ />
@@ -131,9 +143,23 @@ const WorktypeIdSettingPage: React.FC = (): JSX.Element => {
className={`${styles.menuAction} ${styles.inTable}`}
>
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
{
+ dispatch(changeSelectedId({ id: worktype.id }));
+ dispatch(
+ changeWorktypeId({
+ worktypeId: worktype.worktypeId,
+ })
+ );
+ dispatch(
+ changeDescription({
+ description: worktype.description,
+ })
+ );
+ setIsShowEditPopup(true);
+ }}
>
{t(getTranslationID("common.label.edit"))}
diff --git a/dictation_client/src/translation/de.json b/dictation_client/src/translation/de.json
index db871fe..5a7bd67 100644
--- a/dictation_client/src/translation/de.json
+++ b/dictation_client/src/translation/de.json
@@ -390,8 +390,10 @@
"description": "(de)Description",
"descriptionOptional": "(de)Description (Optional)",
"optionItem": "(de)Option Item",
- "worktypeIdTerms": "(de)WorktypeID should be alphanumeric and symbols,\n but not include: \\ / : * ? “ < > | .",
- "addWorktype": "(de)Add Worktype"
+ "worktypeIdTerms": "(de)WorktypeID should be alphanumeric and symbols,\nbut not include: \\ / : * ? “ < > | .",
+ "addWorktype": "(de)Add Worktype",
+ "editWorktypeId": "(de)Edit Worktype ID",
+ "saveChange": "(de)Save Changes"
},
"message": {
"worktypeIdIncorrectError": "(de)入力されたWorktypeIDがルールを満たしていません。下記のルールを満たすWorktypeIDを入力してください",
@@ -414,4 +416,4 @@
"deleteAccount": "(de)Delete Account"
}
}
-}
+}
\ No newline at end of file
diff --git a/dictation_client/src/translation/en.json b/dictation_client/src/translation/en.json
index a041725..63ce4e3 100644
--- a/dictation_client/src/translation/en.json
+++ b/dictation_client/src/translation/en.json
@@ -390,8 +390,10 @@
"description": "Description",
"descriptionOptional": "Description (Optional)",
"optionItem": "Option Item",
- "worktypeIdTerms": "WorktypeID should be alphanumeric and symbols,\n but not include: \\ / : * ? “ < > | .",
- "addWorktype": "Add Worktype"
+ "worktypeIdTerms": "WorktypeID should be alphanumeric and symbols,\nbut not include: \\ / : * ? “ < > | .",
+ "addWorktype": "Add Worktype",
+ "editWorktypeId": "Edit Worktype ID",
+ "saveChange": "Save Changes"
},
"message": {
"worktypeIdIncorrectError": "入力されたWorktypeIDがルールを満たしていません。下記のルールを満たすWorktypeIDを入力してください",
@@ -414,4 +416,4 @@
"deleteAccount": "Delete Account"
}
}
-}
+}
\ No newline at end of file
diff --git a/dictation_client/src/translation/es.json b/dictation_client/src/translation/es.json
index 3fe365a..3edb794 100644
--- a/dictation_client/src/translation/es.json
+++ b/dictation_client/src/translation/es.json
@@ -390,8 +390,10 @@
"description": "(es)Description",
"descriptionOptional": "(es)Description (Optional)",
"optionItem": "(es)Option Item",
- "worktypeIdTerms": "(es)WorktypeID should be alphanumeric and symbols,\n but not include: \\ / : * ? “ < > | .",
- "addWorktype": "(es)Add Worktype"
+ "worktypeIdTerms": "(es)WorktypeID should be alphanumeric and symbols,\nbut not include: \\ / : * ? “ < > | .",
+ "addWorktype": "(es)Add Worktype",
+ "editWorktypeId": "(es)Edit Worktype ID",
+ "saveChange": "(es)Save Changes"
},
"message": {
"worktypeIdIncorrectError": "(es)入力されたWorktypeIDがルールを満たしていません。下記のルールを満たすWorktypeIDを入力してください",
@@ -414,4 +416,4 @@
"deleteAccount": "(es)Delete Account"
}
}
-}
+}
\ No newline at end of file
diff --git a/dictation_client/src/translation/fr.json b/dictation_client/src/translation/fr.json
index 741646d..5ccc10f 100644
--- a/dictation_client/src/translation/fr.json
+++ b/dictation_client/src/translation/fr.json
@@ -390,8 +390,10 @@
"description": "(fr)Description",
"descriptionOptional": "(fr)Description (Optional)",
"optionItem": "(fr)Option Item",
- "worktypeIdTerms": "(fr)WorktypeID should be alphanumeric and symbols,\n but not include: \\ / : * ? “ < > | .",
- "addWorktype": "(fr)Add Worktype"
+ "worktypeIdTerms": "(fr)WorktypeID should be alphanumeric and symbols,\nbut not include: \\ / : * ? “ < > | .",
+ "addWorktype": "(fr)Add Worktype",
+ "editWorktypeId": "(fr)Edit Worktype ID",
+ "saveChange": "(fr)Save Changes"
},
"message": {
"worktypeIdIncorrectError": "(fr)入力されたWorktypeIDがルールを満たしていません。下記のルールを満たすWorktypeIDを入力してください",
@@ -414,4 +416,4 @@
"deleteAccount": "(fr)Delete Account"
}
}
-}
+}
\ No newline at end of file