From c4efaf1a1aaa274df7f28af2d60a65ace9dae802 Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Thu, 11 Jan 2024 06:58:01 +0000 Subject: [PATCH 01/17] =?UTF-8?q?Merged=20PR=20671:=20=E3=80=8CLicenseAler?= =?UTF-8?q?t=E3=80=8D=E3=82=92=E6=B6=88=E3=81=99=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3381: 対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3381) - 以下の画面から「LicenseAlert」を削除 - ユーザー追加Popup - ユーザー更新Popup - ユーザー一覧画面 - 以下のAPIの引数から「LicenseAlert」の設定をするパラメータを削除 - ユーザー作成API(users/signup) - ユーザー更新API(users/update) - ユーザー一覧取得APIのレスポンスから「LicenseAlert」を削除 - usersEntityから「LicenseAlert」を削除 - クライアントのAPI呼び出し部分を自動生成するopenapi-generator-cliのバージョンを7.1.0で固定 - 最新バージョン(7.2.0)はaxiosのバージョン1.x用になるため - https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.2.0 ## レビューポイント - openapi-generator-cliのバージョンを固定するのではなく、axiosのバージョンを上げたほうがよいか - axiosのバージョン1.xが出たのがおととしになるのでそろそろ上げてもいい? - このタイミングでメジャーバージョンを上げるのはどうか - 基本的な仕様について大きくは変わってない模様 - 実際に上げてみて軽く動作確認してみたが問題なかった ## UIの変更 - Before/Afterのスクショなど - 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/Task3381?csf=1&web=1&e=TpXHES ## 補足 - 相談、参考資料などがあれば --- dictation_client/codegen.sh | 2 +- dictation_client/src/api/api.ts | 18 -------- .../src/features/user/operations.ts | 1 - .../src/features/user/selectors.ts | 2 - dictation_client/src/features/user/types.ts | 3 -- .../src/features/user/userSlice.ts | 21 --------- .../src/pages/UserListPage/index.tsx | 4 -- .../src/pages/UserListPage/popup.tsx | 17 ------- .../src/pages/UserListPage/updatePopup.tsx | 19 -------- dictation_server/src/api/odms/openapi.json | 15 +------ dictation_server/src/common/test/utility.ts | 2 - .../accounts/test/accounts.service.mock.ts | 3 -- .../src/features/accounts/types/types.ts | 8 +--- .../features/files/test/files.service.mock.ts | 1 - .../licenses/test/liscense.service.mock.ts | 1 - .../test/notification.service.mock.ts | 1 - .../features/tasks/test/tasks.service.mock.ts | 2 - .../features/users/test/users.service.mock.ts | 2 - .../src/features/users/types/types.ts | 22 ++++------ .../src/features/users/users.controller.ts | 4 -- .../src/features/users/users.service.spec.ts | 44 ------------------- .../src/features/users/users.service.ts | 20 ++------- .../accounts/accounts.repository.service.ts | 6 ++- .../repositories/users/entity/user.entity.ts | 6 --- .../users/users.repository.service.ts | 4 -- 25 files changed, 21 insertions(+), 207 deletions(-) diff --git a/dictation_client/codegen.sh b/dictation_client/codegen.sh index 5d09ae3..d165c0c 100644 --- a/dictation_client/codegen.sh +++ b/dictation_client/codegen.sh @@ -1,2 +1,2 @@ -npx openapi-generator-cli version-manager set latest +npx openapi-generator-cli version-manager set 7.1.0 npx openapi-generator-cli generate -g typescript-axios -i /app/dictation_server/src/api/odms/openapi.json -o /app/dictation_client/src/api/ diff --git a/dictation_client/src/api/api.ts b/dictation_client/src/api/api.ts index 1c1ac87..645f058 100644 --- a/dictation_client/src/api/api.ts +++ b/dictation_client/src/api/api.ts @@ -1549,12 +1549,6 @@ export interface PostUpdateUserRequest { * @memberof PostUpdateUserRequest */ 'autoRenew': boolean; - /** - * - * @type {boolean} - * @memberof PostUpdateUserRequest - */ - 'licenseAlart': boolean; /** * * @type {boolean} @@ -1660,12 +1654,6 @@ export interface SignupRequest { * @memberof SignupRequest */ 'autoRenew': boolean; - /** - * - * @type {boolean} - * @memberof SignupRequest - */ - 'licenseAlert': boolean; /** * * @type {boolean} @@ -2212,12 +2200,6 @@ export interface User { * @memberof User */ 'autoRenew': boolean; - /** - * - * @type {boolean} - * @memberof User - */ - 'licenseAlert': boolean; /** * * @type {boolean} diff --git a/dictation_client/src/features/user/operations.ts b/dictation_client/src/features/user/operations.ts index f02e38c..b7ca2b0 100644 --- a/dictation_client/src/features/user/operations.ts +++ b/dictation_client/src/features/user/operations.ts @@ -164,7 +164,6 @@ export const updateUserAsync = createAsyncThunk< encryptionPassword, prompt, autoRenew: updateUser.autoRenew, - licenseAlart: updateUser.licenseAlert, notification: updateUser.notification, }, { diff --git a/dictation_client/src/features/user/selectors.ts b/dictation_client/src/features/user/selectors.ts index e1e3cf1..ee1f3fa 100644 --- a/dictation_client/src/features/user/selectors.ts +++ b/dictation_client/src/features/user/selectors.ts @@ -131,8 +131,6 @@ export const selectAuthorId = (state: RootState) => state.user.apps.addUser.authorId; export const selectAutoRenew = (state: RootState) => state.user.apps.addUser.autoRenew; -export const selectLicenseAlert = (state: RootState) => - state.user.apps.addUser.licenseAlert; export const selectNotification = (state: RootState) => state.user.apps.addUser.notification; // AddUserを返却する diff --git a/dictation_client/src/features/user/types.ts b/dictation_client/src/features/user/types.ts index 7f41187..649b63f 100644 --- a/dictation_client/src/features/user/types.ts +++ b/dictation_client/src/features/user/types.ts @@ -16,7 +16,6 @@ export interface UserView encryption: boolean | string; emailVerified: boolean; autoRenew: boolean; - licenseAlert: boolean; notification: boolean; name: string; email: string; @@ -28,7 +27,6 @@ export interface AddUser { role: RoleType; email: string; autoRenew: boolean; - licenseAlert: boolean; notification: boolean; authorId?: string; encryption?: boolean; @@ -46,7 +44,6 @@ export interface UpdateUser { encryptionPassword?: string | undefined; prompt?: boolean | undefined; autoRenew: boolean; - licenseAlert: boolean; notification: boolean; } diff --git a/dictation_client/src/features/user/userSlice.ts b/dictation_client/src/features/user/userSlice.ts index 52ffbc4..ef0589a 100644 --- a/dictation_client/src/features/user/userSlice.ts +++ b/dictation_client/src/features/user/userSlice.ts @@ -23,7 +23,6 @@ const initialState: UsersState = { encryptionPassword: undefined, prompt: undefined, autoRenew: true, - licenseAlert: true, notification: true, }, selectedUser: { @@ -36,7 +35,6 @@ const initialState: UsersState = { encryptionPassword: undefined, prompt: undefined, autoRenew: true, - licenseAlert: true, notification: true, }, addUser: { @@ -44,7 +42,6 @@ const initialState: UsersState = { role: USER_ROLES.NONE, email: "", autoRenew: true, - licenseAlert: true, notification: true, authorId: undefined, encryption: false, @@ -93,13 +90,6 @@ export const userSlice = createSlice({ const { autoRenew } = action.payload; state.apps.addUser.autoRenew = autoRenew; }, - changeLicenseAlert: ( - state, - action: PayloadAction<{ licenseAlert: boolean }> - ) => { - const { licenseAlert } = action.payload; - state.apps.addUser.licenseAlert = licenseAlert; - }, changeEncryption: ( state, action: PayloadAction<{ encryption: boolean }> @@ -149,7 +139,6 @@ export const userSlice = createSlice({ state.apps.updateUser.encryptionPassword = undefined; state.apps.updateUser.prompt = user.prompt; state.apps.updateUser.autoRenew = user.autoRenew; - state.apps.updateUser.licenseAlert = user.licenseAlert; state.apps.updateUser.notification = user.notification; state.apps.selectedUser.id = user.id; @@ -161,7 +150,6 @@ export const userSlice = createSlice({ state.apps.selectedUser.encryptionPassword = undefined; state.apps.selectedUser.prompt = user.prompt; state.apps.selectedUser.autoRenew = user.autoRenew; - state.apps.selectedUser.licenseAlert = user.licenseAlert; state.apps.selectedUser.notification = user.notification; state.apps.hasPasswordMask = user.encryption; @@ -211,13 +199,6 @@ export const userSlice = createSlice({ const { autoRenew } = action.payload; state.apps.updateUser.autoRenew = autoRenew; }, - changeUpdateLicenseAlert: ( - state, - action: PayloadAction<{ licenseAlert: boolean }> - ) => { - const { licenseAlert } = action.payload; - state.apps.updateUser.licenseAlert = licenseAlert; - }, changeUpdateNotification: ( state, action: PayloadAction<{ notification: boolean }> @@ -318,7 +299,6 @@ export const { changeRole, changeAuthorId, changeAutoRenew, - changeLicenseAlert, changeNotification, cleanupAddUser, changeUpdateUser, @@ -328,7 +308,6 @@ export const { changeUpdateEncryptionPassword, changeUpdatePrompt, changeUpdateAutoRenew, - changeUpdateLicenseAlert, changeUpdateNotification, cleanupUpdateUser, changeEncryption, diff --git a/dictation_client/src/pages/UserListPage/index.tsx b/dictation_client/src/pages/UserListPage/index.tsx index 46f1223..a1de616 100644 --- a/dictation_client/src/pages/UserListPage/index.tsx +++ b/dictation_client/src/pages/UserListPage/index.tsx @@ -174,9 +174,6 @@ const UserListPage: React.FC = (): JSX.Element => { {t(getTranslationID("userListPage.label.autoRenew"))} - - {t(getTranslationID("userListPage.label.licenseAlert"))} - {t(getTranslationID("userListPage.label.notification"))} @@ -292,7 +289,6 @@ const UserListPage: React.FC = (): JSX.Element => { {boolToElement(user.autoRenew)} - {boolToElement(user.licenseAlert)} {boolToElement(user.notification)} {boolToElement(user.emailVerified)} diff --git a/dictation_client/src/pages/UserListPage/popup.tsx b/dictation_client/src/pages/UserListPage/popup.tsx index 50ed98f..97b3301 100644 --- a/dictation_client/src/pages/UserListPage/popup.tsx +++ b/dictation_client/src/pages/UserListPage/popup.tsx @@ -10,7 +10,6 @@ import { changeRole, changeAuthorId, changeAutoRenew, - changeLicenseAlert, changeNotification, cleanupAddUser, addUserAsync, @@ -324,22 +323,6 @@ export const UserAddPopup: React.FC = (props) => { {t(getTranslationID("userListPage.label.autoRenew"))}

-

- -

-

- -

-

Temporary password:$TEMPORARY_PASSWORD$

+

Temporary password: $TEMPORARY_PASSWORD$

If you need support regarding ODMS Cloud, please contact $PRIMARY_ADMIN_NAME$. @@ -34,7 +34,7 @@ Passwort zu ändern, klicken Sie auf dem ODMS Cloud-Anmeldebildschirm auf den Link [Kennwort vergessen?].

-

Temporäres Passwort:$TEMPORARY_PASSWORD$

+

Temporäres Passwort: $TEMPORARY_PASSWORD$

Wenn Sie Unterstützung bezüglich ODMS Cloud benötigen, wenden Sie sich bitte an $PRIMARY_ADMIN_NAME$. @@ -57,7 +57,7 @@ lien [Vous avez oublié votre mot de passe ?] sur l'écran de connexion ODMS Cloud.

-

Temporary password:$TEMPORARY_PASSWORD$

+

Temporary password: $TEMPORARY_PASSWORD$

Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter $PRIMARY_ADMIN_NAME$. diff --git a/dictation_server/src/templates/template_U_113.txt b/dictation_server/src/templates/template_U_113.txt index 5c444c6..f84bd50 100644 --- a/dictation_server/src/templates/template_U_113.txt +++ b/dictation_server/src/templates/template_U_113.txt @@ -2,7 +2,7 @@ Your user registration has been completed. Please login to ODMS Cloud with the following temporary password. You may continue using your temporary password; however, we strongly recommend that you change your password for security reasons. To change your password, click on [Forgot your password?] link on the ODMS Cloud Sign in screen. -Temporary password:$TEMPORARY_PASSWORD$ +Temporary password: $TEMPORARY_PASSWORD$ If you need support regarding ODMS Cloud, please contact $PRIMARY_ADMIN_NAME$. @@ -13,7 +13,7 @@ This is an automatically generated e-mail and this mailbox is not monitored. P Ihre Benutzerregistrierung ist abgeschlossen. Bitte melden Sie sich mit dem folgenden temporären Passwort bei ODMS Cloud an. Sie können Ihr temporäres Passwort weiterhin verwenden; Aus Sicherheitsgründen empfehlen wir Ihnen jedoch dringend, Ihr Passwort zu ändern. Um Ihr Passwort zu ändern, klicken Sie auf dem ODMS Cloud-Anmeldebildschirm auf den Link [Kennwort vergessen?]. -Temporäres Passwort:$TEMPORARY_PASSWORD$ +Temporäres Passwort: $TEMPORARY_PASSWORD$ Wenn Sie Unterstützung bezüglich ODMS Cloud benötigen, wenden Sie sich bitte an $PRIMARY_ADMIN_NAME$. @@ -24,7 +24,7 @@ Dies ist eine automatisch generierte E-Mail und dieses Postfach wird nicht über Votre inscription d'utilisateur est terminée. Veuillez vous connecter à ODMS Cloud avec le mot de passe temporaire suivant. Vous pouvez continuer à utiliser votre mot de passe temporaire ; cependant, nous vous recommandons fortement de changer votre mot de passe pour des raisons de sécurité. Pour modifier votre mot de passe, cliquez sur le lien [Vous avez oublié votre mot de passe ?] sur l'écran de connexion ODMS Cloud. -Temporary password:$TEMPORARY_PASSWORD$ +Temporary password: $TEMPORARY_PASSWORD$ Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez contacter $PRIMARY_ADMIN_NAME$. From 6111583678e1c51ff1e00660f68eb4d5c3f3c745 Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Thu, 11 Jan 2024 08:22:31 +0000 Subject: [PATCH 03/17] =?UTF-8?q?Merged=20PR=20673:=20=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E7=94=BB=E9=9D=A2=E3=81=B8=E3=81=AE=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=82=A6=E3=82=B6=E3=83=90=E3=83=83=E3=82=AF=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=83=AD=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3380: ログイン画面へのブラウザバック時のローディング対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3380) - ログイン済み後にブラウザバックした際にローディング画面からログイン後の画面に遷移する処理を追加しました。 - loginPage - AuthPage - TermsPage ## レビューポイント - 対応ページと対応する箇所は適切でしょうか? - 既存のuseEffectの中に処理を追加しています。 ## UIの変更 - なし ## 動作確認状況 - ローカルで確認 --- dictation_client/src/pages/AuthPage/index.tsx | 41 ++++++++++ .../pages/DictationPage/filePropertyPopup.tsx | 2 +- .../src/pages/LoginPage/index.tsx | 81 ++++++++++++------- .../src/pages/TermsPage/index.tsx | 37 +++++++++ 4 files changed, 129 insertions(+), 32 deletions(-) diff --git a/dictation_client/src/pages/AuthPage/index.tsx b/dictation_client/src/pages/AuthPage/index.tsx index a1559bd..a17880d 100644 --- a/dictation_client/src/pages/AuthPage/index.tsx +++ b/dictation_client/src/pages/AuthPage/index.tsx @@ -10,6 +10,14 @@ import { import React, { useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; +import { + clearToken, + isAdminUser, + isApproveTier, + isStandardUser, + loadAccessToken, +} from "features/auth"; +import { TIERS } from "components/auth/constants"; const AuthPage: React.FC = (): JSX.Element => { const { instance } = useMsal(); @@ -26,6 +34,39 @@ const AuthPage: React.FC = (): JSX.Element => { (async () => { try { + // ログイン済みの場合、ログイン後の遷移先を決定する + if (loadAccessToken()) { + // 第一~第四階層の管理者はライセンス画面へ遷移 + if ( + isApproveTier([ + TIERS.TIER1, + TIERS.TIER2, + TIERS.TIER3, + TIERS.TIER4, + ]) && + isAdminUser() + ) { + navigate("/license"); + return; + } + // 第五階層の管理者はユーザー画面へ遷移 + if (isApproveTier([TIERS.TIER5]) && isAdminUser()) { + navigate("/user"); + return; + } + // 一般ユーザーはdictationPageへ遷移 + if (isStandardUser()) { + navigate("/dictations"); + return; + } + // それ以外は認証エラー画面へ遷移 + instance.logoutRedirect({ + postLogoutRedirectUri: "/AuthError", + }); + clearToken(); + return; + } + const loginResult = await instance.handleRedirectPromise(); // eslint-disable-next-line diff --git a/dictation_client/src/pages/DictationPage/filePropertyPopup.tsx b/dictation_client/src/pages/DictationPage/filePropertyPopup.tsx index 0bcd5ba..1a4104c 100644 --- a/dictation_client/src/pages/DictationPage/filePropertyPopup.tsx +++ b/dictation_client/src/pages/DictationPage/filePropertyPopup.tsx @@ -122,7 +122,7 @@ export const FilePropertyPopup: React.FC = (props) => {

{t(getTranslationID("dictationPage.label.transcriptionist"))}
{selectedFileTask?.typist?.name ?? ""}
- {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */} close {t(getTranslationID("filePropertyPopup.label.close"))} diff --git a/dictation_client/src/pages/LoginPage/index.tsx b/dictation_client/src/pages/LoginPage/index.tsx index e298c40..c335bd3 100644 --- a/dictation_client/src/pages/LoginPage/index.tsx +++ b/dictation_client/src/pages/LoginPage/index.tsx @@ -28,6 +28,33 @@ const LoginPage: React.FC = (): JSX.Element => { selectLocalStorageKeyforIdToken ); + // ログイン後の遷移先を決定する + const navigateToLoginedPage = useCallback(() => { + // 第一~第四階層の管理者はライセンス画面へ遷移 + if ( + isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) && + isAdminUser() + ) { + navigate("/license"); + return; + } + // 第五階層の管理者はユーザー画面へ遷移 + if (isApproveTier([TIERS.TIER5]) && isAdminUser()) { + navigate("/user"); + return; + } + // 一般ユーザーはdictationPageへ遷移 + if (isStandardUser()) { + navigate("/dictations"); + return; + } + // それ以外は認証エラー画面へ遷移 + instance.logoutRedirect({ + postLogoutRedirectUri: "/AuthError", + }); + clearToken(); + }, [instance, navigate]); + const tokenSet = useCallback( async (idToken: string) => { // ログイン処理呼び出し @@ -59,44 +86,36 @@ const LoginPage: React.FC = (): JSX.Element => { document.body.appendChild(a); a.click(); document.body.removeChild(a); - // 第一~第四階層の管理者はライセンス画面へ遷移 - if ( - isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) && - isAdminUser() - ) { - navigate("/license"); - return; - } - // 第五階層の管理者はユーザー画面へ遷移 - if (isApproveTier([TIERS.TIER5]) && isAdminUser()) { - navigate("/user"); - return; - } - // 一般ユーザーはdictationPageへ遷移 - if (isStandardUser()) { - navigate("/dictations"); - return; - } - // それ以外は認証エラー画面へ遷移 - instance.logoutRedirect({ - postLogoutRedirectUri: "/AuthError", - }); - clearToken(); + + // ログイン成功した場合、適切なページに遷移する + navigateToLoginedPage(); } }, - [dispatch, i18n.language, instance, navigate] + [dispatch, i18n.language, instance, navigate, navigateToLoginedPage] ); useEffect(() => { - // AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する - if (!localStorageKeyforIdToken) { - navigate("/"); - return; - } - + // idTokenStringがあるか⇒認証中 + // accessTokenがある場合⇒ログイン済み + // どちらもなければ直打ち (async () => { - // IDトークンの取得 + if (loadAccessToken()) { + navigateToLoginedPage(); + return; + } + + // AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する + if (!localStorageKeyforIdToken) { + navigate("/"); + return; + } const idTokenString = localStorage.getItem(localStorageKeyforIdToken); + + if (idTokenString === null) { + navigate("/"); + return; + } + if (idTokenString) { const idTokenObject = JSON.parse(idTokenString); if (isIdToken(idTokenObject)) { diff --git a/dictation_client/src/pages/TermsPage/index.tsx b/dictation_client/src/pages/TermsPage/index.tsx index 974487e..52f2a0b 100644 --- a/dictation_client/src/pages/TermsPage/index.tsx +++ b/dictation_client/src/pages/TermsPage/index.tsx @@ -18,10 +18,19 @@ import { } from "features//terms"; import { selectLocalStorageKeyforIdToken } from "features/login"; import { useNavigate } from "react-router-dom"; +import { + clearToken, + isAdminUser, + isApproveTier, + isStandardUser, + loadAccessToken, +} from "features/auth"; +import { useMsal } from "@azure/msal-react"; const TermsPage: React.FC = (): JSX.Element => { const [t] = useTranslation(); const dispatch: AppDispatch = useDispatch(); + const { instance } = useMsal(); const navigate = useNavigate(); const updateAccceptVersions = useSelector(selectTermVersions); const localStorageKeyforIdToken = useSelector( @@ -40,6 +49,34 @@ const TermsPage: React.FC = (): JSX.Element => { // 画面起動時 useEffect(() => { + // ログイン済みの場合、ログイン後の遷移先を決定する + if (loadAccessToken()) { + // 第一~第四階層の管理者はライセンス画面へ遷移 + if ( + isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) && + isAdminUser() + ) { + navigate("/license"); + return; + } + // 第五階層の管理者はユーザー画面へ遷移 + if (isApproveTier([TIERS.TIER5]) && isAdminUser()) { + navigate("/user"); + return; + } + // 一般ユーザーはdictationPageへ遷移 + if (isStandardUser()) { + navigate("/dictations"); + return; + } + // それ以外は認証エラー画面へ遷移 + instance.logoutRedirect({ + postLogoutRedirectUri: "/AuthError", + }); + clearToken(); + return; + } + dispatch(getTermsInfoAsync()); if (localStorageKeyforIdToken) { dispatch(getAccountInfoMinimalAccessAsync({ localStorageKeyforIdToken })); From 0edad18545dacf219bf758cdf5f0ce052b695e45 Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Fri, 12 Jan 2024 07:03:59 +0000 Subject: [PATCH 04/17] =?UTF-8?q?Merged=20PR=20674:=20DB=E3=81=8B=E3=82=89?= =?UTF-8?q?LicenseAlert=E3=82=AB=E3=83=A9=E3=83=A0=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3429: DBから該当カラム削除](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3429) - UsersテーブルからLicenseAlertを削除 ## レビューポイント - 追加したマイグレーションファイルの内容に認識違いはないか ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば --- dictation_server/db/migrations/051-delete-license-alert.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 dictation_server/db/migrations/051-delete-license-alert.sql diff --git a/dictation_server/db/migrations/051-delete-license-alert.sql b/dictation_server/db/migrations/051-delete-license-alert.sql new file mode 100644 index 0000000..e191a81 --- /dev/null +++ b/dictation_server/db/migrations/051-delete-license-alert.sql @@ -0,0 +1,6 @@ +-- +migrate Up +ALTER TABLE `users` DROP COLUMN `license_alert`; + + +-- +migrate Down +ALTER TABLE `users` ADD COLUMN `license_alert` BOOLEAN DEFAULT TRUE NOT NULL COMMENT 'ライセンスの期限切れ通知をするかどうか'; \ No newline at end of file From d627bb8a0979aa32617e63e6c043e647f454278f Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Mon, 15 Jan 2024 08:54:14 +0000 Subject: [PATCH 05/17] =?UTF-8?q?Merged=20PR=20684:=20=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E4=B8=80=E8=A6=A7=E3=81=AE=E8=A1=A8=E7=A4=BA=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E3=82=92=E5=A2=97=E3=82=84=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3447: タスク一覧の表示件数を増やす](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3447) - タイトルの通り ## レビューポイント - 特になし ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば --- dictation_client/src/features/dictation/constants.ts | 2 +- dictation_client/src/styles/app.module.scss | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dictation_client/src/features/dictation/constants.ts b/dictation_client/src/features/dictation/constants.ts index de262e0..69eae60 100644 --- a/dictation_client/src/features/dictation/constants.ts +++ b/dictation_client/src/features/dictation/constants.ts @@ -8,7 +8,7 @@ export const STATUS = { export type StatusType = typeof STATUS[keyof typeof STATUS]; -export const LIMIT_TASK_NUM = 20; +export const LIMIT_TASK_NUM = 100; export const SORTABLE_COLUMN = { JobNumber: "JOB_NUMBER", diff --git a/dictation_client/src/styles/app.module.scss b/dictation_client/src/styles/app.module.scss index f5399f2..2435346 100644 --- a/dictation_client/src/styles/app.module.scss +++ b/dictation_client/src/styles/app.module.scss @@ -2047,7 +2047,7 @@ tr.isSelected .menuInTable li a.isDisable { position: sticky; top: 0; background: #282828; - z-index: 1; + z-index: 3; } .dictation .table.dictation tr.tableHeader th.clm0 { width: 0px; @@ -2482,8 +2482,8 @@ tr.isSelected .menuInTable li a.isDisable { } .formChange ul.chooseMember li input:checked + label:hover, .formChange ul.holdMember li input:checked + label:hover { - background: #e6e6e6 url(../assets/images/arrow_circle_right.svg) no-repeat - right center; + background: #e6e6e6 url(../assets/images/arrow_circle_right.svg) no-repeat right + center; background-size: 1.3rem; } .formChange > p { From 4c527b1959648838450f7be4913d6ec8e0ec4664 Mon Sep 17 00:00:00 2001 From: "maruyama.t" Date: Tue, 16 Jan 2024 06:55:11 +0000 Subject: [PATCH 06/17] =?UTF-8?q?Merged=20PR=20685:=20auth=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=A7instance=E3=81=AE=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=AB=E5=A4=B1=E6=95=97=E3=81=97=E3=81=9F=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=A7=E3=82=82=E3=83=AD=E3=82=B0=E3=82=A4=E3=83=B3=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E9=81=B7=E7=A7=BB=E3=81=95=E3=81=9B?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3476: authページでinstanceの取得に失敗した場合でもログインページに遷移させる](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3476) 以下暫定対応です。 `const loginResult = await instance.handleRedirectPromise();` 推測としては、この処理でloginResultがnullになってしまうことがあり、 結果、ページ遷移などが発生しないままになってまうため、loading表示で固まる。 そのため、いかなる場合でも最終的にはログインページに遷移させるよう修正した。 これによって、loginResultがnullの場合は、ログインページに遷移後トップページに遷移し、ユーザは再度ログイン処理を行うことができる。 一旦この状態でテストは継続していただいて、根本原因調査は裏で行う。 ## レビューポイント - console.log({ loginResult }); はDEV環境での動作確認後に削除いたします。 ## UIの変更 なし ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば --- dictation_client/src/pages/AuthPage/index.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dictation_client/src/pages/AuthPage/index.tsx b/dictation_client/src/pages/AuthPage/index.tsx index a17880d..5a66e4c 100644 --- a/dictation_client/src/pages/AuthPage/index.tsx +++ b/dictation_client/src/pages/AuthPage/index.tsx @@ -66,12 +66,10 @@ const AuthPage: React.FC = (): JSX.Element => { clearToken(); return; } - const loginResult = await instance.handleRedirectPromise(); // eslint-disable-next-line console.log({ loginResult }); // TODO:loading画面から遷移できない事象の調査用ログ。事象解消後削除(eslint-disable含めて)する。 - if (loginResult && loginResult.account) { const { homeAccountId, idTokenClaims } = loginResult.account; if (idTokenClaims && idTokenClaims.aud) { @@ -85,11 +83,11 @@ const AuthPage: React.FC = (): JSX.Element => { localStorageKeyforIdToken, }) ); - - // トークン取得と設定を行う - navigate("/login"); } } + // ログインページに遷移し、トークン取得と設定を行う + // 何らかの原因で、loginResultがnullの場合でも、ログイン画面に遷移する(ログイン画面でトップページに戻る) + navigate("/login"); } catch (e) { // eslint-disable-next-line console.log({ e }); // TODO:loading画面から遷移できない事象の調査用ログ。事象解消後削除(eslint-disable含めて)する。 From 6b1020be8f6a11a81063045dae93e4774118e36b Mon Sep 17 00:00:00 2001 From: "maruyama.t" Date: Tue, 16 Jan 2024 08:32:25 +0000 Subject: [PATCH 07/17] =?UTF-8?q?Merged=20PR=20690:=20dev=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D&=E7=A2=BA=E8=AA=8D=E5=BE=8C?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=BD=E3=83=BC=E3=83=AB=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=81=AEloginResult=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3478: dev動作確認&確認後コンソールログのloginResultを削除する](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3478) - 元PBI or タスクへのリンク(内容・目的などはそちらにあるはず) - 何をどう変更したか、追加したライブラリなど - このPull Requestでの対象/対象外 - 影響範囲(他の機能にも影響があるか) ## レビューポイント - 特にレビューしてほしい箇所 - 軽微なものや自明なものは記載不要 - 修正範囲が大きい場合などに記載 - 全体的にや仕様を満たしているか等は本当に必要な時のみ記載 ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認、develop環境で確認など ## 補足 - 相談、参考資料などがあれば --- dictation_client/src/pages/AuthPage/index.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/dictation_client/src/pages/AuthPage/index.tsx b/dictation_client/src/pages/AuthPage/index.tsx index 5a66e4c..e8d81f9 100644 --- a/dictation_client/src/pages/AuthPage/index.tsx +++ b/dictation_client/src/pages/AuthPage/index.tsx @@ -67,9 +67,6 @@ const AuthPage: React.FC = (): JSX.Element => { return; } const loginResult = await instance.handleRedirectPromise(); - - // eslint-disable-next-line - console.log({ loginResult }); // TODO:loading画面から遷移できない事象の調査用ログ。事象解消後削除(eslint-disable含めて)する。 if (loginResult && loginResult.account) { const { homeAccountId, idTokenClaims } = loginResult.account; if (idTokenClaims && idTokenClaims.aud) { From 658de1c1aea5792c2ae7f17baf202bb12d1baf46 Mon Sep 17 00:00:00 2001 From: "maruyama.t" Date: Tue, 16 Jan 2024 09:51:37 +0000 Subject: [PATCH 08/17] =?UTF-8?q?Merged=20PR=20691:=20=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=BB=E3=83=B3=E3=82=B9=E8=87=AA=E5=8B=95=E5=89=B2=E3=82=8A?= =?UTF-8?q?=E5=BD=93=E3=81=A6=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E7=B5=90=E6=9E=9C=E3=81=8C=E7=95=B0?= =?UTF-8?q?=E5=B8=B8=E3=81=AB=E3=81=AA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3486: ライセンス自動割り当てのテストコードの結果が異常になる](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3486) 現在時刻と明示的に定義した日付の比較を行っていたことで、年を跨ぎ異常となっていた ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認、develop環境で確認など ## 補足 - 相談、参考資料などがあれば --- .../src/test/licenseAutoAllocation.spec.ts | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/dictation_function/src/test/licenseAutoAllocation.spec.ts b/dictation_function/src/test/licenseAutoAllocation.spec.ts index 170862a..d0bf9ef 100644 --- a/dictation_function/src/test/licenseAutoAllocation.spec.ts +++ b/dictation_function/src/test/licenseAutoAllocation.spec.ts @@ -282,13 +282,9 @@ describe("licenseAutoAllocation", () => { it("有効期限が指定日のライセンスが自動更新されること(リトライ用)", async () => { if (!source) fail(); const context = new InvocationContext(); - // 11/22の日付を作成 - const dateSeptember22 = new Date(); - dateSeptember22.setMonth(11); - dateSeptember22.setDate(22); - dateSeptember22.setHours(23, 59, 59); - const currentDateEndTime = new DateWithDayEndTime(dateSeptember22); - + // 2023/11/22の日付を作成 + const date1122 = new Date(2023, 10, 22, 23, 59, 59); + const currentDateEndTime = new DateWithDayEndTime(date1122); // アカウント const account1 = await makeTestAccount( source, @@ -328,7 +324,7 @@ describe("licenseAutoAllocation", () => { auto_renew: false, }); - // 割り当て済みで有効期限が12/31のライセンス + // 割り当て済みで有効期限が11/22のライセンス await createLicense( source, 1, @@ -389,10 +385,9 @@ describe("licenseAutoAllocation", () => { null, null ); - // 割り当て済みの更新対象ではないライセンス const nextDate = new Date(); - nextDate.setDate(dateSeptember22.getDate() + 1); + nextDate.setDate(date1122.getDate() + 1); nextDate.setHours(23, 59, 59); // 時分秒を"23:59:59"に固定 nextDate.setMilliseconds(0); await createLicense( @@ -407,15 +402,13 @@ describe("licenseAutoAllocation", () => { null, null ); - // 有効期限が先の未割当ライセンスを作成 // idが100のものは有効期限が当日なので自動割り当て対象外 // idが101のものから割り当てられる for (let i = 0; i < 10; i++) { - const date = new Date(); - date.setDate(dateSeptember22.getDate() + i); - date.setHours(23, 59, 59); // 時分秒を"23:59:59"に固定 - date.setMilliseconds(0); + // 2023/11/22の日付を作成 + const date = new Date(2023, 10, 22, 23, 59, 59); + date.setDate(date.getDate() + i); await createLicense( source, i + 100, @@ -446,8 +439,7 @@ describe("licenseAutoAllocation", () => { null, null ); - - await licenseAutoAllocationProcessing(context, source, dateSeptember22); + await licenseAutoAllocationProcessing(context, source, date1122); const user1Allocated = await selectLicenseByAllocatedUser(source, user1.id); const user2Allocated = await selectLicenseByAllocatedUser(source, user2.id); const user3Allocated = await selectLicenseByAllocatedUser(source, user3.id); From 4c427d2632bf508fcc51512313780b5b535b23f3 Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Tue, 16 Jan 2024 10:15:56 +0000 Subject: [PATCH 09/17] =?UTF-8?q?Merged=20PR=20692:=20=E3=83=9E=E3=82=A4?= =?UTF-8?q?=E3=82=B0=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3487: マイグレーションファイル適用](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3487) - DB定義に齟齬が出てしまうため、DBマイグレーションファイルをCCBからdevelopにも適用します。 ## レビューポイント - 適用内容は適切でしょうか? --- dictation_server/db/migrations/052-add-task-index.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 dictation_server/db/migrations/052-add-task-index.sql diff --git a/dictation_server/db/migrations/052-add-task-index.sql b/dictation_server/db/migrations/052-add-task-index.sql new file mode 100644 index 0000000..459a54f --- /dev/null +++ b/dictation_server/db/migrations/052-add-task-index.sql @@ -0,0 +1,5 @@ +-- +migrate Up +ALTER TABLE `tasks` ADD INDEX `idx_account_id_and_audio_file_id` (account_id,audio_file_id); + +-- +migrate Down +ALTER TABLE `tasks` DROP INDEX `idx_account_id_and_audio_file_id`; \ No newline at end of file From 7075c2a9ebed38e2d5e6ad3c9069cf419e31a2c4 Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Tue, 16 Jan 2024 10:37:12 +0000 Subject: [PATCH 10/17] =?UTF-8?q?Merged=20PR=20686:=20=E3=81=84=E3=82=8D?= =?UTF-8?q?=E3=81=84=E3=82=8D=E6=B6=88=E3=81=99=EF=BC=86=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=A4=89=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3328: いろいろ消す&表示変える](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3328) - CCB後回し分の部分について表示を削除、修正しました。 - ユーザー一覧画面の「Delete user」を消す - タスク一覧画面の「Delete dictation」を削す - テンプレートファイル一覧画面の「Delete」を消す - アカウント情報画面の「File Delete Setting」を消す - パートナー一覧画面の「Delete Account」を消す - ライセンスページの「Storage Available」と「Storage Used」の値をハイフン表示に修正 ※変更部分はまた使う予定なのでコメントアウトで対応しています。 ## レビューポイント - 対応箇所は認識通りでしょうか? - 対応内容は認識通りでしょうか? ## UIの変更 - [Task3328](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/Task3328?csf=1&web=1&e=9y7y6P) ## 動作確認状況 - ローカルで確認 --- dictation_client/src/pages/AccountPage/index.tsx | 2 ++ dictation_client/src/pages/DictationPage/index.tsx | 4 +++- dictation_client/src/pages/LicensePage/licenseSummary.tsx | 8 ++++++-- dictation_client/src/pages/PartnerPage/index.tsx | 2 ++ dictation_client/src/pages/TemplateFilePage/index.tsx | 2 ++ dictation_client/src/pages/UserListPage/index.tsx | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dictation_client/src/pages/AccountPage/index.tsx b/dictation_client/src/pages/AccountPage/index.tsx index 79963ae..6fd0877 100644 --- a/dictation_client/src/pages/AccountPage/index.tsx +++ b/dictation_client/src/pages/AccountPage/index.tsx @@ -102,6 +102,7 @@ const AccountPage: React.FC = (): JSX.Element => {
+ {/* File Delete Setting は現状不要のため非表示 + */}
diff --git a/dictation_client/src/pages/DictationPage/index.tsx b/dictation_client/src/pages/DictationPage/index.tsx index b2591d3..bb70c47 100644 --- a/dictation_client/src/pages/DictationPage/index.tsx +++ b/dictation_client/src/pages/DictationPage/index.tsx @@ -1149,6 +1149,7 @@ const DictationPage: React.FC = (): JSX.Element => { )} + {/* タスク削除はCCB後回し分なので今は非表示
  • {t( @@ -1157,7 +1158,8 @@ const DictationPage: React.FC = (): JSX.Element => { ) )} -
  • + + */} {displayColumn.JobNumber && ( diff --git a/dictation_client/src/pages/LicensePage/licenseSummary.tsx b/dictation_client/src/pages/LicensePage/licenseSummary.tsx index 058350d..a343fa5 100644 --- a/dictation_client/src/pages/LicensePage/licenseSummary.tsx +++ b/dictation_client/src/pages/LicensePage/licenseSummary.tsx @@ -289,13 +289,17 @@ export const LicenseSummary: React.FC = ( ) )} -
    {licenseSummaryInfo.storageSize}GB
    + {/* Storage Usedの値表示をハイフンに置き換え */} + {/*
    {licenseSummaryInfo.storageSize}GB
    */} +
    -
    {t( getTranslationID("LicenseSummaryPage.label.usedSize") )}
    -
    {licenseSummaryInfo.usedSize}GB
    + {/* Storage Usedの値表示をハイフンに置き換え */} + {/*
    {licenseSummaryInfo.usedSize}GB
    */} +
    -
    {t( getTranslationID( diff --git a/dictation_client/src/pages/PartnerPage/index.tsx b/dictation_client/src/pages/PartnerPage/index.tsx index 7f73f66..835cfa3 100644 --- a/dictation_client/src/pages/PartnerPage/index.tsx +++ b/dictation_client/src/pages/PartnerPage/index.tsx @@ -185,6 +185,7 @@ const PartnerPage: React.FC = (): JSX.Element => {
      + {/* パートナーアカウント削除はCCB後回し分なので非表示 {isVisibleButton && (
    • @@ -196,6 +197,7 @@ const PartnerPage: React.FC = (): JSX.Element => {
    • )} + */} {isVisibleDealerManagement && (
    • {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */} diff --git a/dictation_client/src/pages/TemplateFilePage/index.tsx b/dictation_client/src/pages/TemplateFilePage/index.tsx index d72ef6f..59ef540 100644 --- a/dictation_client/src/pages/TemplateFilePage/index.tsx +++ b/dictation_client/src/pages/TemplateFilePage/index.tsx @@ -101,6 +101,7 @@ export const TemplateFilePage: React.FC = () => { {template.name} diff --git a/dictation_client/src/pages/UserListPage/index.tsx b/dictation_client/src/pages/UserListPage/index.tsx index a1de616..48e0805 100644 --- a/dictation_client/src/pages/UserListPage/index.tsx +++ b/dictation_client/src/pages/UserListPage/index.tsx @@ -243,6 +243,7 @@ const UserListPage: React.FC = (): JSX.Element => {
    • )} + {/* ユーザー削除 CCB後回し分なので今は非表示
    • {t( @@ -252,6 +253,7 @@ const UserListPage: React.FC = (): JSX.Element => { )}
    • + */}
    {user.name} From 46fdef854ee98f378a6ad6982e7fa1e8075c51f7 Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Wed, 17 Jan 2024 06:02:20 +0000 Subject: [PATCH 11/17] =?UTF-8?q?Merged=20PR=20689:=20licenseAlert?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3275: licenseAlertのテスト修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3275) - redisをモックに切り替えてテストを行うように修正 - redisのモックは`redis-mock`というライブラリを使用 ## レビューポイント - 使用したライブラリに問題はありそうか - https://www.npmjs.com/package/redis-mock/v/0.56.3 - テスト用に使用しているだけなので大きな問題になることはない認識 ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認、Pipeline上でテストが通ることを確認 ## 補足 - 相談、参考資料などがあれば --- dictation_function/package-lock.json | 20 +++++++++++ dictation_function/package.json | 2 ++ .../src/functions/licenseAlert.ts | 2 +- .../src/test/licenseAlert.spec.ts | 36 +++++++++++-------- 4 files changed, 45 insertions(+), 15 deletions(-) diff --git a/dictation_function/package-lock.json b/dictation_function/package-lock.json index 4da5447..8ebaf00 100644 --- a/dictation_function/package-lock.json +++ b/dictation_function/package-lock.json @@ -20,8 +20,10 @@ "@types/jest": "^27.5.0", "@types/node": "18.x", "@types/redis": "^2.8.13", + "@types/redis-mock": "^0.17.3", "azure-functions-core-tools": "^4.x", "jest": "^28.0.3", + "redis-mock": "^0.56.3", "rimraf": "^5.0.0", "sqlite3": "^5.1.6", "supertest": "^6.1.3", @@ -2000,6 +2002,15 @@ "@types/node": "*" } }, + "node_modules/@types/redis-mock": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@types/redis-mock/-/redis-mock-0.17.3.tgz", + "integrity": "sha512-1baXyGxRKEDog8p1ReiypODwiST2n3/0pBbgUKEuv9pBXnY6ttRzKATcW5Xz20ZOl9qkKtPIeq20tHgHSdQBAQ==", + "dev": true, + "dependencies": { + "@types/redis": "^2.8.0" + } + }, "node_modules/@types/stack-utils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", @@ -6409,6 +6420,15 @@ "node": ">=4" } }, + "node_modules/redis-mock": { + "version": "0.56.3", + "resolved": "https://registry.npmjs.org/redis-mock/-/redis-mock-0.56.3.tgz", + "integrity": "sha512-ynaJhqk0Qf3Qajnwvy4aOjS4Mdf9IBkELWtjd+NYhpiqu4QCNq6Vf3Q7c++XRPGiKiwRj9HWr0crcwy7EiPjYQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/redis-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", diff --git a/dictation_function/package.json b/dictation_function/package.json index 8a6260d..33f2287 100644 --- a/dictation_function/package.json +++ b/dictation_function/package.json @@ -25,8 +25,10 @@ "@types/jest": "^27.5.0", "@types/node": "18.x", "@types/redis": "^2.8.13", + "@types/redis-mock": "^0.17.3", "azure-functions-core-tools": "^4.x", "jest": "^28.0.3", + "redis-mock": "^0.56.3", "rimraf": "^5.0.0", "sqlite3": "^5.1.6", "supertest": "^6.1.3", diff --git a/dictation_function/src/functions/licenseAlert.ts b/dictation_function/src/functions/licenseAlert.ts index bbab8b0..ad4119f 100644 --- a/dictation_function/src/functions/licenseAlert.ts +++ b/dictation_function/src/functions/licenseAlert.ts @@ -77,7 +77,7 @@ export async function licenseAlertProcessing( const keys = await keysAsync(`${SEND_COMPLETE_PREFIX}${formattedDate}*`); console.log(`delete terget:${keys}`); if (keys.length > 0) { - const delResult = await delAsync(...keys); + const delResult = await delAsync(keys); console.log(`delete number:${delResult}`); } } catch (e) { diff --git a/dictation_function/src/test/licenseAlert.spec.ts b/dictation_function/src/test/licenseAlert.spec.ts index 390dc18..c3891a0 100644 --- a/dictation_function/src/test/licenseAlert.spec.ts +++ b/dictation_function/src/test/licenseAlert.spec.ts @@ -13,13 +13,15 @@ import { ADB2C_SIGN_IN_TYPE } from "../constants"; import { SendGridService } from "../sendgrid/sendgrid"; import { AdB2cService } from "../adb2c/adb2c"; import { InvocationContext } from "@azure/functions"; -import { RedisClient } from "redis"; -import { createRedisClient } from "../redis/redis"; +import { RedisClient, createClient } from "redis-mock"; +import { promisify } from "util"; describe("licenseAlert", () => { dotenv.config({ path: ".env" }); dotenv.config({ path: ".env.local", override: true }); let source: DataSource | null = null; + const redisClient = createClient(); + beforeEach(async () => { source = new DataSource({ type: "sqlite", @@ -35,17 +37,15 @@ describe("licenseAlert", () => { if (!source) return; await source.destroy(); source = null; + //licenseAlertProcessingの処理の最後にキャッシュ削除処理があるため、ここでクリーンアップは行わない }); - it("テストを通すための仮", async () => {}); - /* - it("ライセンス在庫不足メールが送信され、ライセンス失効警告メールが送信されないこと", async () => { if (!source) fail(); const context = new InvocationContext(); const sendgridMock = new SendGridServiceMock() as SendGridService; const adb2cMock = new AdB2cServiceMock() as AdB2cService; - const redisClient = createRedisClient(); + // 呼び出し回数でテスト成否を判定 const spySend = jest.spyOn(sendgridMock, "sendMail"); @@ -77,7 +77,10 @@ describe("licenseAlert", () => { adb2cMock ); expect(spySend.mock.calls).toHaveLength(1); - redisClient.quit; + // redisからキャッシュが削除されていることを確認 + const getAsync = promisify(redisClient.keys).bind(redisClient); + const keys = await getAsync(`*`); + expect(keys).toHaveLength(0); }); it("ライセンス在庫不足メール、ライセンス失効警告メールが送信されること", async () => { @@ -85,7 +88,6 @@ describe("licenseAlert", () => { const context = new InvocationContext(); const sendgridMock = new SendGridServiceMock() as SendGridService; const adb2cMock = new AdB2cServiceMock() as AdB2cService; - const redisClient = createRedisClient(); // 呼び出し回数でテスト成否を判定 const spySend = jest.spyOn(sendgridMock, "sendMail"); @@ -118,7 +120,10 @@ describe("licenseAlert", () => { adb2cMock ); expect(spySend.mock.calls).toHaveLength(2); - redisClient.quit; + // redisからキャッシュが削除されていることを確認 + const getAsync = promisify(redisClient.keys).bind(redisClient); + const keys = await getAsync(`*`); + expect(keys).toHaveLength(0); }); it("在庫があるため、ライセンス在庫不足メールが送信されないこと", async () => { @@ -126,7 +131,6 @@ describe("licenseAlert", () => { const context = new InvocationContext(); const sendgridMock = new SendGridServiceMock() as SendGridService; const adb2cMock = new AdB2cServiceMock() as AdB2cService; - const redisClient = createRedisClient(); // 呼び出し回数でテスト成否を判定 const spySend = jest.spyOn(sendgridMock, "sendMail"); @@ -172,7 +176,10 @@ describe("licenseAlert", () => { adb2cMock ); expect(spySend.mock.calls).toHaveLength(0); - redisClient.quit; + // redisからキャッシュが削除されていることを確認 + const getAsync = promisify(redisClient.keys).bind(redisClient); + const keys = await getAsync(`*`); + expect(keys).toHaveLength(0); }); it("AutoRenewがtureのため、ライセンス失効警告メールが送信されないこと", async () => { @@ -180,7 +187,6 @@ describe("licenseAlert", () => { const context = new InvocationContext(); const sendgridMock = new SendGridServiceMock() as SendGridService; const adb2cMock = new AdB2cServiceMock() as AdB2cService; - const redisClient = createRedisClient(); // 呼び出し回数でテスト成否を判定 const spySend = jest.spyOn(sendgridMock, "sendMail"); @@ -213,9 +219,11 @@ describe("licenseAlert", () => { adb2cMock ); expect(spySend.mock.calls).toHaveLength(1); - redisClient.quit; + // redisからキャッシュが削除されていることを確認 + const getAsync = promisify(redisClient.keys).bind(redisClient); + const keys = await getAsync(`*`); + expect(keys).toHaveLength(0); }); - */ }); // テスト用sendgrid From 1ad3cb70c6e1ed55a39c6bd32c54a420cb31fcb5 Mon Sep 17 00:00:00 2001 From: "maruyama.t" Date: Wed, 17 Jan 2024 06:06:08 +0000 Subject: [PATCH 12/17] =?UTF-8?q?Merged=20PR=20687:=20=E3=82=A2=E3=82=AB?= =?UTF-8?q?=E3=82=A6=E3=83=B3=E3=83=88=E7=99=BB=E9=8C=B2=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3437: アカウント登録画面修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3437) - アカウント登録時にPrivacyNoticeに同意できるよう修正(サーバに処理自体は入っていたが、画面修正だけが漏れていた) - アカウント登録画面と利用規約同意画面で文言が統一されていなかったのを修正。 - 利用規約同意画面で、規約に同意する文言のlabel→label htmlForに修正 (文言にマウスオーバーするとカーソルが矢印から指に代わるが、チェックボックスを押さないかぎりチェックが付かなかったのを、文言を押してもチェックが付くように修正) ## レビューポイント とくになし ## UIの変更 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/Task3437?csf=1&web=1&e=wGHFhu ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば --- .../src/pages/SignupPage/signupInput.tsx | 54 ++++++++++++++++--- .../src/pages/TermsPage/index.tsx | 9 ++-- dictation_client/src/translation/de.json | 8 +-- dictation_client/src/translation/en.json | 7 +-- dictation_client/src/translation/es.json | 7 +-- dictation_client/src/translation/fr.json | 7 +-- 6 files changed, 68 insertions(+), 24 deletions(-) diff --git a/dictation_client/src/pages/SignupPage/signupInput.tsx b/dictation_client/src/pages/SignupPage/signupInput.tsx index 3f388ce..be83cf7 100644 --- a/dictation_client/src/pages/SignupPage/signupInput.tsx +++ b/dictation_client/src/pages/SignupPage/signupInput.tsx @@ -39,7 +39,11 @@ const SignupInput: React.FC = (): JSX.Element => { const navigate = useNavigate(); const [isPasswordHide, setIsPasswordHide] = useState(true); const [isOpenPolicy, setIsOpenPolicy] = useState(false); - const [isAgreePolicy, setIsAgreePolicy] = useState(false); + const [isOpenPrivacyNotice, setIsOpenPrivacyNoyice] = + useState(false); + const [isCheckedEula, setIsCheckedEula] = useState(false); + const [isCheckedPrivacyNotice, setIsCheckedPrivacyNotice] = + useState(false); const [isPushCreateButton, setIsPushCreateButton] = useState(false); const { hasErrorEmptyAdminName, @@ -90,6 +94,9 @@ const SignupInput: React.FC = (): JSX.Element => { dispatch(getLatestEulaVersionAsync()); }, [dispatch]); + // ボタン押下可否判定ロジック + const canClickButton = () => isCheckedEula && isCheckedPrivacyNotice; + useEffect(() => { // 外部のWebサイトからの遷移時にURLのパラメータを取得 // 以下のようなURLで遷移してきた場合に、Dealerと言語を変更する @@ -371,18 +378,48 @@ const SignupInput: React.FC = (): JSX.Element => { setIsOpenPolicy(true); }} > - {t(getTranslationID("signupPage.label.termsLink"))} + {t(getTranslationID("signupPage.label.linkOfEula"))} - {` ${t(getTranslationID("signupPage.label.termsLinkFor"))} `} + {` ${t(getTranslationID("signupPage.label.forOdms"))} `}
    -
    +
    + { + setIsOpenPrivacyNoyice(true); + }} + > + {t( + getTranslationID("signupPage.label.linkOfPrivacyNotice") + )} + + {` ${t(getTranslationID("signupPage.label.forOdms"))} `} +
    +