Merge branch 'develop' into main

This commit is contained in:
maruyama.t 2024-01-18 13:23:29 +09:00
commit e732db08d8
56 changed files with 441 additions and 683 deletions

View File

@ -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/

View File

@ -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}

View File

@ -1,7 +1,5 @@
import React from "react";
import styles from "styles/app.module.scss";
import { useTranslation } from "react-i18next";
import logo from "../../assets/images/OMS_logo_black.svg";
import { HEADER_NAME } from "./constants";
@ -13,7 +11,6 @@ const NotLoginHeader: React.FC<NotLoginHeaderProps> = (
props: NotLoginHeaderProps
) => {
const { isMobile } = props;
const { t } = useTranslation();
return (
<header className={`${styles.header} ${isMobile && styles.home}`}>
<div className={`${styles.headerLogo}`}>

View File

@ -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",
@ -99,3 +99,8 @@ export const INIT_DISPLAY_INFO: DisplayInfoType = {
export const BACKUP_POPUP_LIST_SIZE = 10;
export const BACKUP_POPUP_LIST_STATUS = [STATUS.FINISHED, STATUS.BACKUP];
export const PRIORITY = {
NORMAL: "Normal",
HIGH: "High",
} as const;

View File

@ -5,5 +5,6 @@
export const TERMS_DOCUMENT_TYPE = {
DPA: "DPA",
EULA: "EULA",
// eslint-disable-next-line @typescript-eslint/naming-convention
PRIVACY_NOTICE: "PrivacyNotice",
} as const;

View File

@ -164,7 +164,6 @@ export const updateUserAsync = createAsyncThunk<
encryptionPassword,
prompt,
autoRenew: updateUser.autoRenew,
licenseAlart: updateUser.licenseAlert,
notification: updateUser.notification,
},
{

View File

@ -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を返却する

View File

@ -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;
}

View File

@ -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,

View File

@ -102,6 +102,7 @@ const AccountPage: React.FC = (): JSX.Element => {
<section className={styles.account}>
<div className={styles.boxFlex}>
{/* File Delete Setting
<ul className={`${styles.menuAction} ${styles.box100}`}>
<li>
<a
@ -119,6 +120,7 @@ const AccountPage: React.FC = (): JSX.Element => {
</a>
</li>
</ul>
*/}
<div className={styles.marginRgt3}>
<dl className={styles.listVertical}>

View File

@ -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,11 +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
console.log({ loginResult }); // TODO:loading画面から遷移できない事象の調査用ログ。事象解消後削除eslint-disable含めてする。
if (loginResult && loginResult.account) {
const { homeAccountId, idTokenClaims } = loginResult.account;
if (idTokenClaims && idTokenClaims.aud) {
@ -44,11 +80,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含めてする。

View File

@ -1,7 +1,11 @@
import React, { useCallback } from "react";
import styles from "styles/app.module.scss";
import { useSelector } from "react-redux";
import { selectSelectedFileTask, selectIsLoading } from "features/dictation";
import {
selectSelectedFileTask,
selectIsLoading,
PRIORITY,
} from "features/dictation";
import { getTranslationID } from "translation";
import { useTranslation } from "react-i18next";
import close from "../../assets/images/close.svg";
@ -51,7 +55,11 @@ export const FilePropertyPopup: React.FC<FilePropertyPopupProps> = (props) => {
<dt>{t(getTranslationID("dictationPage.label.workType"))}</dt>
<dd>{selectedFileTask?.workType ?? ""}</dd>
<dt>{t(getTranslationID("dictationPage.label.priority"))}</dt>
<dd>{selectedFileTask?.priority ?? ""}</dd>
<dd>
{selectedFileTask?.priority === "01"
? PRIORITY.HIGH
: PRIORITY.NORMAL}
</dd>
<dt>
{t(getTranslationID("dictationPage.label.recordingStartedDate"))}
</dt>
@ -114,6 +122,7 @@ export const FilePropertyPopup: React.FC<FilePropertyPopupProps> = (props) => {
<dt>{t(getTranslationID("dictationPage.label.transcriptionist"))}</dt>
<dd>{selectedFileTask?.typist?.name ?? ""}</dd>
<dd className={`${styles.full} ${styles.alignRight}`}>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
<a onClick={closePopup} className={`${styles.buttonText}`}>
<img src={close} className={styles.modalTitleIcon} alt="close" />
{t(getTranslationID("filePropertyPopup.label.close"))}

View File

@ -32,6 +32,7 @@ import {
selectIsLoading,
playbackAsync,
cancelAsync,
PRIORITY,
} from "features/dictation";
import { getTranslationID } from "translation";
import { Task } from "api/api";
@ -1148,6 +1149,7 @@ const DictationPage: React.FC = (): JSX.Element => {
)}
</a>
</li>
{/* CCB
<li>
<a>
{t(
@ -1156,7 +1158,8 @@ const DictationPage: React.FC = (): JSX.Element => {
)
)}
</a>
</li>
</li>
*/}
</ul>
</td>
{displayColumn.JobNumber && (
@ -1189,7 +1192,9 @@ const DictationPage: React.FC = (): JSX.Element => {
)}
{displayColumn.Priority && (
<td className={styles.clm3}>
{x.priority === "01" ? "High" : "Normal"}
{x.priority === "01"
? PRIORITY.HIGH
: PRIORITY.NORMAL}
</td>
)}
{displayColumn.Encryption && (

View File

@ -289,13 +289,17 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
)
)}
</dt>
<dd>{licenseSummaryInfo.storageSize}GB</dd>
{/* Storage Usedの値表示をハイフンに置き換え */}
{/* <dd>{licenseSummaryInfo.storageSize}GB</dd> */}
<dd>-</dd>
<dt>
{t(
getTranslationID("LicenseSummaryPage.label.usedSize")
)}
</dt>
<dd>{licenseSummaryInfo.usedSize}GB</dd>
{/* Storage Usedの値表示をハイフンに置き換え */}
{/* <dd>{licenseSummaryInfo.usedSize}GB</dd> */}
<dd>-</dd>
<dt className={styles.overLine}>
{t(
getTranslationID(

View File

@ -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)) {

View File

@ -185,6 +185,7 @@ const PartnerPage: React.FC = (): JSX.Element => {
<tr>
<td className={styles.clm0}>
<ul className={styles.menuInTable}>
{/* CCB
{isVisibleButton && (
<li>
<a>
@ -196,6 +197,7 @@ const PartnerPage: React.FC = (): JSX.Element => {
</a>
</li>
)}
*/}
{isVisibleDealerManagement && (
<li>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}

View File

@ -39,7 +39,11 @@ const SignupInput: React.FC = (): JSX.Element => {
const navigate = useNavigate();
const [isPasswordHide, setIsPasswordHide] = useState<boolean>(true);
const [isOpenPolicy, setIsOpenPolicy] = useState<boolean>(false);
const [isAgreePolicy, setIsAgreePolicy] = useState<boolean>(false);
const [isOpenPrivacyNotice, setIsOpenPrivacyNoyice] =
useState<boolean>(false);
const [isCheckedEula, setIsCheckedEula] = useState<boolean>(false);
const [isCheckedPrivacyNotice, setIsCheckedPrivacyNotice] =
useState<boolean>(false);
const [isPushCreateButton, setIsPushCreateButton] = useState<boolean>(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"))}
</a>
{` ${t(getTranslationID("signupPage.label.termsLinkFor"))} `}
{` ${t(getTranslationID("signupPage.label.forOdms"))} `}
<br />
<label htmlFor="check-box">
<label htmlFor="checkboxEula">
<input
id="check-box"
id="checkboxEula"
type="checkbox"
checked={isCheckedEula}
className={styles.formCheck}
disabled={!isOpenPolicy}
onChange={(e) => {
setIsAgreePolicy(e.target.checked);
setIsCheckedEula(e.target.checked);
}}
/>
{t(getTranslationID("signupPage.label.termsCheckBox"))}
</label>
</dd>
<dd className={`${styles.full} ${styles.alignCenter}`}>
<a
href="/"
target="_blank"
className={styles.linkTx}
onClick={() => {
setIsOpenPrivacyNoyice(true);
}}
>
{t(
getTranslationID("signupPage.label.linkOfPrivacyNotice")
)}
</a>
{` ${t(getTranslationID("signupPage.label.forOdms"))} `}
<br />
<label htmlFor="checkboxPrivacyNotice">
<input
id="checkboxPrivacyNotice"
type="checkbox"
checked={isCheckedPrivacyNotice}
className={styles.formCheck}
disabled={!isOpenPrivacyNotice}
onChange={(e) => {
setIsCheckedPrivacyNotice(e.target.checked);
}}
/>
{t(getTranslationID("signupPage.label.termsCheckBox"))}
@ -396,8 +433,9 @@ const SignupInput: React.FC = (): JSX.Element => {
getTranslationID("signupPage.label.createAccountButton")
)}
className={`${styles.formSubmit}
${isAgreePolicy && styles.isActive}
${styles.marginBtm0}`}
${styles.marginBtm0}
${canClickButton() ? styles.isActive : ""}
`}
onClick={() => {
setIsPushCreateButton(true);
onSubmit();

View File

@ -101,6 +101,7 @@ export const TemplateFilePage: React.FC = () => {
<td>{template.name}</td>
<td>
<ul className={`${styles.menuAction} ${styles.inTable}`}>
{/* CCB
<li>
<a
href=""
@ -109,6 +110,7 @@ export const TemplateFilePage: React.FC = () => {
{t(getTranslationID("common.label.delete"))}
</a>
</li>
*/}
</ul>
</td>
</tr>

View File

@ -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 }));
@ -129,8 +166,9 @@ const TermsPage: React.FC = (): JSX.Element => {
{` ${t(getTranslationID("termsPage.label.forOdms"))}`}
</p>
<p>
<label>
<label htmlFor="checkboxEula">
<input
id="checkboxEula"
type="checkbox"
checked={isCheckedEula}
className={styles.formCheck}
@ -162,8 +200,9 @@ const TermsPage: React.FC = (): JSX.Element => {
{` ${t(getTranslationID("termsPage.label.forOdms"))}`}
</p>
<p>
<label>
<label htmlFor="checkboxPrivacyNotice">
<input
id="checkboxPrivacyNotice"
type="checkbox"
checked={isCheckedPrivacyNotice}
className={styles.formCheck}
@ -197,8 +236,9 @@ const TermsPage: React.FC = (): JSX.Element => {
{` ${t(getTranslationID("termsPage.label.forOdms"))}`}
</p>
<p>
<label>
<label htmlFor="checkboxDpa">
<input
id="checkboxDpa"
type="checkbox"
checked={isCheckedDpa}
className={styles.formCheck}

View File

@ -174,9 +174,6 @@ const UserListPage: React.FC = (): JSX.Element => {
<th>
{t(getTranslationID("userListPage.label.autoRenew"))}
</th>
<th>
{t(getTranslationID("userListPage.label.licenseAlert"))}
</th>
<th>
{t(getTranslationID("userListPage.label.notification"))}
</th>
@ -246,6 +243,7 @@ const UserListPage: React.FC = (): JSX.Element => {
</li>
</>
)}
{/* CCB
<li>
<a href="">
{t(
@ -255,6 +253,7 @@ const UserListPage: React.FC = (): JSX.Element => {
)}
</a>
</li>
*/}
</ul>
</td>
<td> {user.name}</td>
@ -292,7 +291,6 @@ const UserListPage: React.FC = (): JSX.Element => {
</span>
</td>
<td>{boolToElement(user.autoRenew)}</td>
<td>{boolToElement(user.licenseAlert)}</td>
<td>{boolToElement(user.notification)}</td>
<td>{boolToElement(user.emailVerified)}</td>
</tr>

View File

@ -10,7 +10,6 @@ import {
changeRole,
changeAuthorId,
changeAutoRenew,
changeLicenseAlert,
changeNotification,
cleanupAddUser,
addUserAsync,
@ -324,22 +323,6 @@ export const UserAddPopup: React.FC<UserAddPopupProps> = (props) => {
{t(getTranslationID("userListPage.label.autoRenew"))}
</label>
</p>
<p>
<label htmlFor="add_LicenseAlert">
<input
type="checkbox"
id="add_LicenseAlert"
checked={addUser.licenseAlert}
className={styles.formCheck}
onChange={(e) => {
dispatch(
changeLicenseAlert({ licenseAlert: e.target.checked })
);
}}
/>
{t(getTranslationID("userListPage.label.licenseAlert"))}
</label>
</p>
<p>
<label htmlFor="add_Notification">
<input

View File

@ -9,7 +9,6 @@ import {
changeUpdateAutoRenew,
changeUpdateEncryption,
changeUpdateEncryptionPassword,
changeUpdateLicenseAlert,
changeUpdateNotification,
changeUpdatePrompt,
changeUpdateRole,
@ -336,24 +335,6 @@ export const UserUpdatePopup: React.FC<UserUpdatePopupProps> = (props) => {
{t(getTranslationID("userListPage.label.autoRenew"))}
</label>
</p>
<p>
<label htmlFor="edit_LicenseAlert">
<input
type="checkbox"
id="edit_LicenseAlert"
className={styles.formCheck}
checked={user.licenseAlert}
onChange={(e) => {
dispatch(
changeUpdateLicenseAlert({
licenseAlert: e.target.checked,
})
);
}}
/>
{t(getTranslationID("userListPage.label.licenseAlert"))}
</label>
</p>
<p>
<label htmlFor="edit_Notification">
<input

View File

@ -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 {

View File

@ -73,9 +73,9 @@
"adminName": "Name des Administrators",
"email": "E-Mail-Addresse",
"password": "Passwort",
"termsLink": "Klicken Sie hier, um die Nutzungsbedingungen zu lesen.",
"termsLinkFor": "für ODMS Cloud.",
"termsCheckBox": "Ja, ich stimme den Nutzungsbedingungen zu.",
"linkOfEula": "Klicken Sie hier, um die Endbenutzer-Lizenzvereinbarung zu lesen.",
"linkOfPrivacyNotice": "Klicken Sie hier, um die Datenschutzerklärung zu lesen.",
"forOdms": "für ODMS Cloud.",
"createAccountButton": "Einreichen"
}
},
@ -555,4 +555,4 @@
"close": "(de)Close"
}
}
}
}

View File

@ -73,8 +73,9 @@
"adminName": "Administrators Name",
"email": "Email Address",
"password": "Password",
"termsLink": "Click here to read the terms of use",
"termsLinkFor": "for OMDS Cloud.",
"linkOfEula": "Click here to read the End User License Agreement.",
"linkOfPrivacyNotice": "Click here to read the Privacy Notice.",
"forOdms": "for ODMS Cloud.",
"termsCheckBox": "Yes, I agree to the terms of use.",
"createAccountButton": "Submit"
}
@ -555,4 +556,4 @@
"close": "Close"
}
}
}
}

View File

@ -73,8 +73,9 @@
"adminName": "Nombre del administrador",
"email": "Dirección de correo electrónico",
"password": "Contraseña",
"termsLink": "Haga clic aquí para leer el término de uso.",
"termsLinkFor": "para la nube ODMS.",
"linkOfEula": "Haga clic aquí para leer el Acuerdo de licencia de usuario final.",
"linkOfPrivacyNotice": "Haga clic aquí para leer el Aviso de Privacidad.",
"forOdms": "para la nube ODMS.",
"termsCheckBox": "Sí, estoy de acuerdo con los términos de uso.",
"createAccountButton": "Entregar"
}
@ -555,4 +556,4 @@
"close": "(es)Close"
}
}
}
}

View File

@ -73,8 +73,9 @@
"adminName": "Nom de l'administrateur",
"email": "Adresse e-mail",
"password": "Mot de passe",
"termsLink": "Cliquez ici pour lire les conditions d'utilisation.",
"termsLinkFor": "pour ODMS Cloud.",
"linkOfEula": "Cliquez ici pour lire le contrat de licence utilisateur final.",
"linkOfPrivacyNotice": "Cliquez ici pour lire l'avis de confidentialité.",
"forOdms": "pour ODMS Cloud.",
"termsCheckBox": "Oui, j'accepte les conditions d'utilisation.",
"createAccountButton": "Soumettre"
}
@ -555,4 +556,4 @@
"close": "(fr)Close"
}
}
}
}

View File

@ -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",

View File

@ -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",

View File

@ -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) {

View File

@ -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

View File

@ -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);

View File

@ -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 'ライセンスの期限切れ通知をするかどうか';

View File

@ -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`;

View File

@ -4087,7 +4087,6 @@
"email": { "type": "string" },
"emailVerified": { "type": "boolean" },
"autoRenew": { "type": "boolean" },
"licenseAlert": { "type": "boolean" },
"notification": { "type": "boolean" },
"encryption": { "type": "boolean" },
"prompt": { "type": "boolean" },
@ -4106,7 +4105,6 @@
"email",
"emailVerified",
"autoRenew",
"licenseAlert",
"notification",
"encryption",
"prompt",
@ -4131,20 +4129,12 @@
"authorId": { "type": "string" },
"email": { "type": "string" },
"autoRenew": { "type": "boolean" },
"licenseAlert": { "type": "boolean" },
"notification": { "type": "boolean" },
"encryption": { "type": "boolean" },
"encryptionPassword": { "type": "string" },
"prompt": { "type": "boolean" }
},
"required": [
"name",
"role",
"email",
"autoRenew",
"licenseAlert",
"notification"
]
"required": ["name", "role", "email", "autoRenew", "notification"]
},
"SignupResponse": { "type": "object", "properties": {} },
"OptionItem": {
@ -4260,13 +4250,12 @@
"role": { "type": "string", "description": "none/author/typist" },
"authorId": { "type": "string" },
"autoRenew": { "type": "boolean" },
"licenseAlart": { "type": "boolean" },
"notification": { "type": "boolean" },
"encryption": { "type": "boolean" },
"encryptionPassword": { "type": "string" },
"prompt": { "type": "boolean" }
},
"required": ["id", "role", "autoRenew", "licenseAlart", "notification"]
"required": ["id", "role", "autoRenew", "notification"]
},
"PostUpdateUserResponse": { "type": "object", "properties": {} },
"AllocateLicenseRequest": {

View File

@ -80,11 +80,6 @@ export const overrideAdB2cService = <TService>(
export const overrideSendgridService = <TService>(
service: TService,
overrides: {
createMailContentFromEmailConfirmForNormalUser?: (
accountId: number,
userId: number,
email: string,
) => Promise<{ subject: string; text: string; html: string }>;
sendMail?: (
context: Context,
to: string,
@ -113,17 +108,6 @@ export const overrideSendgridService = <TService>(
writable: true,
});
}
if (overrides.createMailContentFromEmailConfirmForNormalUser) {
Object.defineProperty(
obj,
obj.createMailContentFromEmailConfirmForNormalUser.name,
{
value: overrides.createMailContentFromEmailConfirmForNormalUser,
writable: true,
},
);
}
};
/**

View File

@ -187,7 +187,6 @@ export const makeTestAccount = async (
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
email_verified: d?.email_verified ?? true,
auto_renew: d?.auto_renew ?? true,
license_alert: d?.license_alert ?? true,
notification: d?.notification ?? true,
encryption: d?.encryption ?? true,
encryption_password: d?.encryption_password ?? 'password',
@ -295,7 +294,6 @@ export const makeTestUser = async (
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
email_verified: d?.email_verified ?? true,
auto_renew: d?.auto_renew ?? true,
license_alert: d?.license_alert ?? true,
notification: d?.notification ?? true,
encryption: d?.encryption ?? true,
encryption_password: d?.encryption_password,

View File

@ -798,14 +798,7 @@ describe('createPartnerAccount', () => {
},
});
overrideSendgridService(service, {
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
sendMail: async () => {
return;
},
});
overrideSendgridService(service, {});
overrideBlobstorageService(service, {
createContainer: async () => {
@ -874,14 +867,7 @@ describe('createPartnerAccount', () => {
},
});
overrideSendgridService(service, {
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
sendMail: async () => {
return;
},
});
overrideSendgridService(service, {});
overrideBlobstorageService(service, {
createContainer: async () => {
@ -954,14 +940,7 @@ describe('createPartnerAccount', () => {
deleteUser: jest.fn(),
});
overrideSendgridService(service, {
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
sendMail: async () => {
return;
},
});
overrideSendgridService(service, {});
overrideAccountsRepositoryService(service, {
createAccount: async () => {
throw new Error('DB Error');
@ -1043,14 +1022,7 @@ describe('createPartnerAccount', () => {
deleteUser: jest.fn().mockRejectedValue(new Error('ADB2C Error')),
});
overrideSendgridService(service, {
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
sendMail: async () => {
return;
},
});
overrideSendgridService(service, {});
overrideAccountsRepositoryService(service, {
createAccount: async () => {
throw new Error('DB Error');
@ -1133,14 +1105,7 @@ describe('createPartnerAccount', () => {
deleteUser: jest.fn(),
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
overrideBlobstorageService(service, {
createContainer: async () => {
@ -1215,14 +1180,7 @@ describe('createPartnerAccount', () => {
deleteUser: jest.fn().mockRejectedValue(new Error('ADB2C Error')),
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
overrideAccountsRepositoryService(service, {
deleteAccount: jest.fn().mockRejectedValue(new Error('DB Error')),
@ -1311,9 +1269,6 @@ describe('createPartnerAccount', () => {
sendMail: async () => {
throw new Error();
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideBlobstorageService(service, {
@ -1403,9 +1358,6 @@ describe('createPartnerAccount', () => {
sendMail: async () => {
throw new Error();
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideAccountsRepositoryService(service, {
@ -1493,14 +1445,7 @@ describe('createPartnerAccount', () => {
},
});
overrideSendgridService(service, {
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
sendMail: async () => {
return;
},
});
overrideSendgridService(service, {});
overrideBlobstorageService(service, {
createContainer: async () => {

View File

@ -1,5 +1,4 @@
import { HttpException, HttpStatus, Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { SendGridService } from '../../gateways/sendgrid/sendgrid.service';
import { UsersRepositoryService } from '../../repositories/users/users.repository.service';
import { AccountsRepositoryService } from '../../repositories/accounts/accounts.repository.service';
@ -75,8 +74,6 @@ import { getUserNameAndMailAddress } from '../../gateways/adb2c/utils/utils';
@Injectable()
export class AccountsService {
private readonly mailFrom =
this.configService.getOrThrow<string>('MAIL_FROM');
constructor(
private readonly accountRepository: AccountsRepositoryService,
private readonly licensesRepository: LicensesRepositoryService,
@ -86,7 +83,6 @@ export class AccountsService {
private readonly adB2cService: AdB2cService,
private readonly sendgridService: SendGridService,
private readonly blobStorageService: BlobstorageService,
private readonly configService: ConfigService,
) {}
private readonly logger = new Logger(AccountsService.name);
/**
@ -731,16 +727,17 @@ export class AccountsService {
);
try {
let myAccountId: number;
let creatorAccountId: number;
let creatorAccountName: string | null;
try {
// アクセストークンからユーザーIDを取得する
myAccountId = (
await this.usersRepository.findUserByExternalId(
context,
creatorUserId,
)
).account_id;
const creatorAccount = await this.usersRepository.findUserByExternalId(
context,
creatorUserId,
);
creatorAccountId = creatorAccount.account_id;
// メール送信処理で使用するため、追加パートナーの上位階層アカウントの会社名を取得する
creatorAccountName = creatorAccount.account?.company_name ?? null;
} catch (e) {
this.logger.error(`[${context.getTrackingId()}] error=${e}`);
if (e instanceof UserNotFoundError) {
@ -792,7 +789,7 @@ export class AccountsService {
context,
companyName,
country,
myAccountId,
creatorAccountId,
creatorAccountTier + 1,
externalUser.sub,
USER_ROLES.NONE,
@ -841,23 +838,22 @@ export class AccountsService {
);
}
// メール送信処理
try {
const { subject, text, html } =
await this.sendgridService.createMailContentFromEmailConfirmForNormalUser(
context,
account.id,
user.id,
email,
if (creatorAccountName === null) {
throw new Error(
`Account is not found. creatorUserId: ${creatorUserId}`,
);
await this.sendgridService.sendMail(
}
await this.sendgridService.sendMailWithU114(
context,
[email],
[],
this.mailFrom,
subject,
text,
html,
account.id,
user.id,
email,
creatorAccountName,
);
return { accountId: account.id };
} catch (e) {
this.logger.error(`[${context.getTrackingId()}] error=${e}`);

View File

@ -44,11 +44,6 @@ export type AdB2cMockValue = {
getUsers: AdB2cUser[] | Error;
};
export type SendGridMockValue = {
createMailContentFromEmailConfirmForNormalUser: {
subject: string;
text: string;
html: string;
};
sendMail: undefined | Error;
};
export type ConfigMockValue = {
@ -237,16 +232,8 @@ export const makeConfigMock = (value: ConfigMockValue) => {
};
};
export const makeSendGridServiceMock = (value: SendGridMockValue) => {
const { createMailContentFromEmailConfirmForNormalUser, sendMail } = value;
const { sendMail } = value;
return {
createMailContentFromEmailConfirmForNormalUser:
createMailContentFromEmailConfirmForNormalUser instanceof Error
? jest
.fn<Promise<void>, []>()
.mockRejectedValue(createMailContentFromEmailConfirmForNormalUser)
: jest
.fn<Promise<{ subject: string; text: string; html: string }>, []>()
.mockResolvedValue(createMailContentFromEmailConfirmForNormalUser),
sendMail:
sendMail instanceof Error
? jest.fn<Promise<void>, []>().mockRejectedValue(sendMail)
@ -322,7 +309,6 @@ export const makeDefaultAccountsRepositoryMockValue =
user.accepted_dpa_version = '1.0';
user.email_verified = true;
user.auto_renew = false;
user.license_alert = false;
user.notification = false;
user.deleted_at = null;
user.created_by = 'test';
@ -352,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
user.accepted_dpa_version = '1.0';
user.email_verified = true;
user.auto_renew = false;
user.license_alert = false;
user.notification = false;
user.deleted_at = null;
user.created_by = 'test';
@ -401,7 +386,6 @@ export const makeDefaultUserGroupsRepositoryMockValue =
user.accepted_dpa_version = '1.0';
user.email_verified = true;
user.auto_renew = false;
user.license_alert = false;
user.notification = false;
user.deleted_at = null;
user.created_by = 'test';
@ -456,14 +440,7 @@ export const makeDefaultAdB2cMockValue = (): AdB2cMockValue => {
};
};
export const makeDefaultSendGridlValue = (): SendGridMockValue => {
return {
sendMail: undefined,
createMailContentFromEmailConfirmForNormalUser: {
subject: 'Verify your new account',
text: `The verification URL.`,
html: `<p>The verification URL.<p>`,
},
};
return { sendMail: undefined };
};
export const makeDefaultLicensesRepositoryMockValue =
(): LicensesRepositoryMockValue => {

View File

@ -483,7 +483,6 @@ export class UpdateTypistGroupResponse {}
export class CreatePartnerAccountResponse {}
export class PartnerLicenseInfo {
@ApiProperty({ description: 'アカウントID' })
accountId: number;
@ -523,7 +522,6 @@ export class GetPartnerLicensesResponse {
childrenPartnerLicenses: PartnerLicenseInfo[];
}
export class LicenseOrder {
@ApiProperty({ description: '注文日付' })
orderDate: string;
@ -546,7 +544,6 @@ export class GetOrderHistoriesResponse {
export class IssueLicenseResponse {}
export class Dealer {
@ApiProperty({ description: 'アカウントID' })
id: number;
@ -563,7 +560,6 @@ export class GetDealersResponse {
export class CancelIssueResponse {}
export class Worktype {
@ApiProperty({ description: 'WorktypeのID' })
id: number;
@ -588,7 +584,6 @@ export class CreateWorktypeResponse {}
export class UpdateWorktypeResponse {}
export class GetWorktypeOptionItem extends PostWorktypeOptionItem {
@ApiProperty()
id: number;
@ -609,7 +604,6 @@ export class DeleteWorktypeResponse {}
export class PostActiveWorktypeResponse {}
export class Partner {
@ApiProperty({ description: '会社名' })
name: string;
@ -678,4 +672,4 @@ export type PartnerInfoFromDb = {
country: string;
primaryAccountExternalId: string;
dealerManagement: boolean;
};
};

View File

@ -148,7 +148,6 @@ export const makeDefaultUsersRepositoryMockValue =
updated_by: null,
updated_at: new Date(),
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,

View File

@ -120,7 +120,6 @@ export const makeDefaultUsersRepositoryMockValue =
user1.accepted_dpa_version = '1.0';
user1.email_verified = true;
user1.auto_renew = false;
user1.license_alert = false;
user1.notification = false;
user1.encryption = false;
user1.prompt = false;

View File

@ -82,7 +82,6 @@ export const makeDefaultUsersRepositoryMockValue =
user.accepted_dpa_version = '1.0';
user.email_verified = true;
user.auto_renew = false;
user.license_alert = false;
user.notification = false;
user.deleted_at = null;
user.created_by = 'test';

View File

@ -338,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
user1.role = 'admin';
user1.email_verified = true;
user1.auto_renew = false;
user1.license_alert = false;
user1.notification = false;
user1.deleted_at = null;
user1.created_by = 'test';
@ -482,7 +481,6 @@ const defaultTasksRepositoryMockValue: {
accepted_dpa_version: '',
email_verified: true,
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,

View File

@ -48,11 +48,7 @@ export type AdB2cMockValue = {
};
export type SendGridMockValue = {
createMailContentFromEmailConfirmForNormalUser:
| { subject: string; text: string; html: string }
| Error;
sendMail: undefined | Error;
sendMailWithU113: undefined | Error;
};
export type ConfigMockValue = {
@ -246,21 +242,13 @@ export const makeLicensesRepositoryMock = (): LicensesRepositoryMockValue => {
};
export const makeSendGridMock = (value: SendGridMockValue) => {
const { sendMail, createMailContentFromEmailConfirmForNormalUser } = value;
const { sendMail } = value;
return {
sendMail:
sendMail instanceof Error
? jest.fn<Promise<void>, []>().mockRejectedValue(sendMail)
: jest.fn<Promise<void>, []>().mockResolvedValue(sendMail),
createMailContentFromEmailConfirmForNormalUser:
createMailContentFromEmailConfirmForNormalUser instanceof Error
? jest
.fn<Promise<void>, []>()
.mockRejectedValue(createMailContentFromEmailConfirmForNormalUser)
: jest
.fn<Promise<{ subject: string; text: string; html: string }>, []>()
.mockResolvedValue(createMailContentFromEmailConfirmForNormalUser),
};
};
@ -276,15 +264,7 @@ export const makeConfigMock = (value: ConfigMockValue) => {
};
export const makeDefaultSendGridlValue = (): SendGridMockValue => {
return {
sendMail: undefined,
createMailContentFromEmailConfirmForNormalUser: {
subject: 'test',
text: 'test',
html: 'test',
},
sendMailWithU113: undefined,
};
return { sendMail: undefined };
};
export const makeDefaultConfigValue = (): ConfigMockValue => {
@ -351,7 +331,6 @@ export const makeDefaultUsersRepositoryMockValue =
user1.accepted_dpa_version = '1.0';
user1.email_verified = true;
user1.auto_renew = false;
user1.license_alert = false;
user1.notification = false;
user1.encryption = false;
user1.prompt = false;
@ -371,7 +350,6 @@ export const makeDefaultUsersRepositoryMockValue =
user2.accepted_dpa_version = '1.0';
user2.email_verified = true;
user2.auto_renew = false;
user2.license_alert = false;
user2.notification = false;
user2.encryption = false;
user2.prompt = false;

View File

@ -1,5 +1,12 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsEmail, IsIn, IsInt, IsOptional, MaxLength } from 'class-validator';
import {
IsBoolean,
IsEmail,
IsIn,
IsInt,
IsOptional,
MaxLength,
} from 'class-validator';
import {
TASK_LIST_SORTABLE_ATTRIBUTES,
USER_LICENSE_STATUS,
@ -44,9 +51,6 @@ export class User {
@ApiProperty()
autoRenew: boolean;
@ApiProperty()
licenseAlert: boolean;
@ApiProperty()
notification: boolean;
@ -97,11 +101,6 @@ export class SignupRequest {
@IsBoolean()
autoRenew: boolean;
@ApiProperty()
@Type(() => Boolean)
@IsBoolean()
licenseAlert: boolean;
@ApiProperty()
@Type(() => Boolean)
@IsBoolean()
@ -233,11 +232,6 @@ export class PostUpdateUserRequest {
@IsBoolean()
autoRenew: boolean;
@ApiProperty()
@Type(() => Boolean)
@IsBoolean()
licenseAlart: boolean;
@ApiProperty()
@Type(() => Boolean)
@IsBoolean()

View File

@ -249,7 +249,6 @@ export class UsersController {
role,
email,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -301,7 +300,6 @@ export class UsersController {
role as UserRoles,
email,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -569,7 +567,6 @@ export class UsersController {
role,
authorId,
autoRenew,
licenseAlart,
notification,
encryption,
encryptionPassword,
@ -619,7 +616,6 @@ export class UsersController {
role,
authorId,
autoRenew,
licenseAlart,
notification,
encryption,
encryptionPassword,

View File

@ -221,7 +221,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
updated_by: 'string;',
updated_at: new Date(),
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,
@ -273,7 +272,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
updated_by: 'string;',
updated_at: new Date(),
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,
@ -324,7 +322,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
updated_by: 'string;',
updated_at: new Date(),
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,
@ -380,7 +377,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
updated_by: 'string;',
updated_at: new Date(),
auto_renew: true,
license_alert: true,
notification: true,
encryption: false,
prompt: false,
@ -484,14 +480,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
expect(
await service.createUser(
@ -501,7 +490,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
),
).toEqual(undefined);
@ -514,7 +502,6 @@ describe('UsersService.createUser', () => {
expect(user?.author_id).toEqual(null);
expect(user?.email_verified).toEqual(false);
expect(user?.auto_renew).toEqual(autoRenew);
expect(user?.license_alert).toEqual(licenseAlert);
expect(user?.notification).toEqual(notification);
expect(user?.encryption).toEqual(false);
expect(user?.encryption_password).toEqual(null);
@ -571,14 +558,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
expect(
await service.createUser(
@ -588,7 +568,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -605,7 +584,6 @@ describe('UsersService.createUser', () => {
expect(user?.author_id).toEqual(authorId);
expect(user?.email_verified).toEqual(false);
expect(user?.auto_renew).toEqual(autoRenew);
expect(user?.license_alert).toEqual(licenseAlert);
expect(user?.notification).toEqual(notification);
expect(user?.encryption).toEqual(encryption);
expect(user?.encryption_password).toEqual(encryptionPassword);
@ -661,14 +639,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
expect(
await service.createUser(
@ -678,7 +649,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -695,7 +665,6 @@ describe('UsersService.createUser', () => {
expect(user?.author_id).toEqual(authorId);
expect(user?.email_verified).toEqual(false);
expect(user?.auto_renew).toEqual(autoRenew);
expect(user?.license_alert).toEqual(licenseAlert);
expect(user?.notification).toEqual(notification);
expect(user?.encryption).toEqual(encryption);
expect(user?.encryption_password).toBeNull();
@ -748,14 +717,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
expect(
await service.createUser(
@ -765,7 +727,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
),
).toEqual(undefined);
@ -778,7 +739,6 @@ describe('UsersService.createUser', () => {
expect(user?.author_id).toBeNull();
expect(user?.email_verified).toEqual(false);
expect(user?.auto_renew).toEqual(autoRenew);
expect(user?.license_alert).toEqual(licenseAlert);
expect(user?.notification).toEqual(notification);
expect(user?.encryption).toEqual(false);
expect(user?.encryption_password).toBeNull();
@ -828,14 +788,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
// DBエラーを発生させる
overrideUsersRepositoryService(service, {
@ -852,7 +805,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -914,14 +866,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
// DBエラーを発生させる
overrideUsersRepositoryService(service, {
@ -938,7 +883,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -990,14 +934,7 @@ describe('UsersService.createUser', () => {
throw new Error('ADB2C error');
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
try {
await service.createUser(
@ -1007,7 +944,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -1057,14 +993,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
try {
await service.createUser(
@ -1074,7 +1003,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -1132,14 +1060,7 @@ describe('UsersService.createUser', () => {
};
},
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
expect(
await service.createUser(
@ -1149,7 +1070,6 @@ describe('UsersService.createUser', () => {
role,
email_1,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -1190,7 +1110,6 @@ describe('UsersService.createUser', () => {
role,
email_2,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -1255,14 +1174,7 @@ describe('UsersService.createUser', () => {
},
deleteUser: jest.fn(),
});
overrideSendgridService(service, {
sendMail: async () => {
return;
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
// AuthorIDのUNIQUE制約エラーを発生させる
overrideUsersRepositoryService(service, {
@ -1279,7 +1191,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -1344,14 +1255,7 @@ describe('UsersService.createUser', () => {
},
deleteUser: jest.fn(),
});
overrideSendgridService(service, {
sendMail: async () => {
throw new Error();
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideSendgridService(service, {});
try {
await service.createUser(
@ -1361,7 +1265,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -1423,9 +1326,6 @@ describe('UsersService.createUser', () => {
sendMail: async () => {
throw new Error();
},
createMailContentFromEmailConfirmForNormalUser: async () => {
return { html: '', text: '', subject: '' };
},
});
overrideUsersRepositoryService(service, {
deleteNormalUser: async () => {
@ -1441,7 +1341,6 @@ describe('UsersService.createUser', () => {
role,
email,
autoRenew,
licenseAlert,
notification,
);
} catch (e) {
@ -1538,7 +1437,6 @@ describe('UsersService.getUsers', () => {
email: 'test1@mail.com',
emailVerified: true,
autoRenew: true,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -1555,7 +1453,6 @@ describe('UsersService.getUsers', () => {
email: 'test2@mail.com',
emailVerified: true,
autoRenew: true,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -1572,7 +1469,6 @@ describe('UsersService.getUsers', () => {
email: 'test3@mail.com',
emailVerified: true,
autoRenew: true,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -1651,7 +1547,6 @@ describe('UsersService.getUsers', () => {
email: 'test1@mail.com',
emailVerified: true,
autoRenew: true,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -1670,7 +1565,6 @@ describe('UsersService.getUsers', () => {
email: 'test2@mail.com',
emailVerified: true,
autoRenew: true,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -1689,7 +1583,6 @@ describe('UsersService.getUsers', () => {
email: 'test3@mail.com',
emailVerified: true,
autoRenew: false,
licenseAlert: true,
notification: true,
encryption: false,
prompt: false,
@ -2007,7 +1900,6 @@ describe('UsersService.updateUser', () => {
undefined,
false,
false,
false,
undefined,
undefined,
undefined,
@ -2020,7 +1912,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.NONE);
expect(createdUser?.author_id).toBeNull();
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(false);
expect(createdUser?.encryption_password).toBeNull();
@ -2067,7 +1958,6 @@ describe('UsersService.updateUser', () => {
undefined,
false,
false,
false,
undefined,
undefined,
undefined,
@ -2080,7 +1970,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
expect(createdUser?.author_id).toBeNull();
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(false);
expect(createdUser?.encryption_password).toBeNull();
@ -2127,7 +2016,6 @@ describe('UsersService.updateUser', () => {
'AUTHOR_ID',
false,
false,
false,
true,
'new_password',
true,
@ -2140,7 +2028,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
expect(createdUser?.author_id).toBe('AUTHOR_ID');
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(true);
expect(createdUser?.encryption_password).toBe('new_password');
@ -2187,7 +2074,6 @@ describe('UsersService.updateUser', () => {
undefined,
false,
false,
false,
undefined,
undefined,
undefined,
@ -2200,7 +2086,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
expect(createdUser?.author_id).toBeNull();
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(false);
expect(createdUser?.encryption_password).toBeNull();
@ -2248,7 +2133,6 @@ describe('UsersService.updateUser', () => {
false,
false,
false,
false,
undefined,
false,
),
@ -2260,7 +2144,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
expect(createdUser?.author_id).toBe('AUTHOR_ID');
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(false);
expect(createdUser?.encryption_password).toBeNull();
@ -2307,7 +2190,6 @@ describe('UsersService.updateUser', () => {
undefined,
false,
false,
false,
undefined,
undefined,
undefined,
@ -2357,7 +2239,6 @@ describe('UsersService.updateUser', () => {
'AUTHOR_ID',
false,
false,
false,
true,
undefined,
true,
@ -2370,7 +2251,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
expect(createdUser?.author_id).toBe('AUTHOR_ID');
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(true);
expect(createdUser?.encryption_password).toBe('password');
@ -2418,7 +2298,6 @@ describe('UsersService.updateUser', () => {
false,
false,
false,
false,
'password',
true,
),
@ -2430,7 +2309,6 @@ describe('UsersService.updateUser', () => {
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
expect(createdUser?.author_id).toBe('AUTHOR_ID');
expect(createdUser?.auto_renew).toBe(false);
expect(createdUser?.license_alert).toBe(false);
expect(createdUser?.notification).toBe(false);
expect(createdUser?.encryption).toBe(false);
expect(createdUser?.encryption_password).toBeNull();
@ -2477,7 +2355,6 @@ describe('UsersService.updateUser', () => {
'AUTHOR_ID',
false,
false,
false,
true,
undefined,
true,
@ -2538,7 +2415,6 @@ describe('UsersService.updateUser', () => {
'AUTHOR_ID2',
false,
false,
false,
true,
undefined,
true,

View File

@ -148,18 +148,18 @@ export class UsersService {
/**
* Creates user
* @param accessToken
* @param context
* @param externalId
* @param name
* @param role
* @param email
* @param autoRenew
* @param licenseAlert
* @param notification
* @param [authorId]
* @param [encryption]
* @param [encryptionPassword]
* @param [prompt]
* @returns void
* @returns user
*/
async createUser(
context: Context,
@ -168,7 +168,6 @@ export class UsersService {
role: UserRoles,
email: string,
autoRenew: boolean,
licenseAlert: boolean,
notification: boolean,
authorId?: string | undefined,
encryption?: boolean | undefined,
@ -180,7 +179,6 @@ export class UsersService {
`externalId: ${externalId}, ` +
`role: ${role}, ` +
`autoRenew: ${autoRenew}, ` +
`licenseAlert: ${licenseAlert}, ` +
`notification: ${notification}, ` +
`authorId: ${authorId}, ` +
`encryption: ${encryption}, ` +
@ -272,7 +270,6 @@ export class UsersService {
accountId,
externalUser.sub,
autoRenew,
licenseAlert,
notification,
authorId,
encryption,
@ -408,7 +405,6 @@ export class UsersService {
accountId: number,
externalId: string,
autoRenew: boolean,
licenseAlert: boolean,
notification: boolean,
authorId?: string | undefined,
encryption?: boolean | undefined,
@ -424,7 +420,6 @@ export class UsersService {
`authorId: ${authorId}, ` +
`externalId: ${externalId}, ` +
`autoRenew: ${autoRenew}, ` +
`licenseAlert: ${licenseAlert}, ` +
`notification: ${notification}, ` +
`authorId: ${authorId}, ` +
`encryption: ${encryption}, ` +
@ -438,7 +433,6 @@ export class UsersService {
account_id: accountId,
external_id: externalId,
auto_renew: autoRenew,
license_alert: licenseAlert,
notification,
role,
accepted_dpa_version: null,
@ -454,7 +448,6 @@ export class UsersService {
account_id: accountId,
external_id: externalId,
auto_renew: autoRenew,
license_alert: licenseAlert,
notification,
role,
author_id: authorId ?? null,
@ -671,7 +664,6 @@ export class UsersService {
email: mail,
emailVerified: dbUser.email_verified,
autoRenew: dbUser.auto_renew,
licenseAlert: dbUser.license_alert,
notification: dbUser.notification,
encryption: dbUser.encryption,
prompt: dbUser.prompt,
@ -901,14 +893,13 @@ export class UsersService {
}
/**
*
* Updates user
* @param context
* @param extarnalId
* @param id
* @param role
* @param authorId
* @param autoRenew
* @param licenseAlart
* @param notification
* @param encryption
* @param encryptionPassword
@ -922,7 +913,6 @@ export class UsersService {
role: string,
authorId: string | undefined,
autoRenew: boolean,
licenseAlart: boolean,
notification: boolean,
encryption: boolean | undefined,
encryptionPassword: string | undefined,
@ -938,7 +928,6 @@ export class UsersService {
`role: ${role}, ` +
`authorId: ${authorId}, ` +
`autoRenew: ${autoRenew}, ` +
`licenseAlart: ${licenseAlart}, ` +
`notification: ${notification}, ` +
`encryption: ${encryption}, ` +
`prompt: ${prompt} }`,
@ -957,7 +946,6 @@ export class UsersService {
role,
authorId,
autoRenew,
licenseAlart,
notification,
encryption,
encryptionPassword,

View File

@ -28,8 +28,6 @@ export class SendGridService {
private readonly emailConfirmLifetime: number;
private readonly appDomain: string;
private readonly mailFrom: string;
private readonly templateEmailVerifyHtml: string;
private readonly templateEmailVerifyText: string;
private readonly templateU101Html: string;
private readonly templateU101Text: string;
private readonly templateU102Html: string;
@ -71,15 +69,6 @@ export class SendGridService {
// メールテンプレートを読み込む
{
this.templateEmailVerifyHtml = readFileSync(
path.resolve(__dirname, `../../templates/template_email_verify.html`),
'utf-8',
);
this.templateEmailVerifyText = readFileSync(
path.resolve(__dirname, `../../templates/template_email_verify.txt`),
'utf-8',
);
this.templateU101Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_101.html`),
'utf-8',
@ -96,7 +85,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_102.txt`),
'utf-8',
);
this.templateU105Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_105.html`),
'utf-8',
@ -105,7 +93,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_105.txt`),
'utf-8',
);
this.templateU106Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_106.html`),
'utf-8',
@ -114,7 +101,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_106.txt`),
'utf-8',
);
this.templateU107Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_107.html`),
'utf-8',
@ -123,7 +109,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_107.txt`),
'utf-8',
);
this.templateU108Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_108.html`),
'utf-8',
@ -132,7 +117,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_108.txt`),
'utf-8',
);
this.templateU109Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_109.html`),
'utf-8',
@ -149,7 +133,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_111.txt`),
'utf-8',
);
this.templateU112Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_112.html`),
'utf-8',
@ -193,7 +176,6 @@ export class SendGridService {
path.resolve(__dirname, `../../templates/template_U_115.txt`),
'utf-8',
);
this.templateU117Html = readFileSync(
path.resolve(__dirname, `../../templates/template_U_117.html`),
'utf-8',
@ -205,47 +187,6 @@ export class SendGridService {
}
}
/**
* Email認証用のメールコンテンツを作成する()
* @param accountId ID
* @param userId ID
* @param email
* @returns
*/
//TODO [Task2163] 中身が管理ユーザ向けのままなので、修正の必要あり
async createMailContentFromEmailConfirmForNormalUser(
context: Context,
accountId: number,
userId: number,
email: string,
): Promise<{ subject: string; text: string; html: string }> {
this.logger.log(
`[IN] [${context.getTrackingId()}] ${
this.createMailContentFromEmailConfirmForNormalUser.name
} | params: { ` +
`accountId: ${accountId},` +
`userId: ${userId} };`,
);
const privateKey = getPrivateKey(this.configService);
const token = sign<{ accountId: number; userId: number; email: string }>(
{
accountId,
userId,
email,
},
this.emailConfirmLifetime,
privateKey,
);
const path = 'mail-confirm/user/';
return {
subject: 'Verify your new account',
text: `The verification URL. ${this.appDomain}${path}?verify=${token}`,
html: `<p>The verification URL.<p><a href="${this.appDomain}${path}?verify=${token}">${this.appDomain}${path}?verify=${token}</a>`,
};
}
/**
* U-101使
* @param context
@ -376,7 +317,7 @@ export class SendGridService {
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
customerMails,
dealerEmails,
@ -431,7 +372,7 @@ export class SendGridService {
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
customerMails,
dealerEmails,
@ -486,7 +427,7 @@ export class SendGridService {
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
customerMails,
dealerEmails,
@ -502,61 +443,6 @@ export class SendGridService {
}
}
/**
* U-109使
* @param context context
* @param dealerEmails (primary/secondary)
* @param dealerAccountName
* @param lisenceCount
* @param poNumber PO番号
* @param customerMails (primary/secondary)
* @param customerAccountName
* @returns
*/
async sendMailWithU109(
context: Context,
dealerEmails: string[],
dealerAccountName: string,
lisenceCount: number,
poNumber: string,
customerMails: string[],
customerAccountName: string,
): Promise<void> {
this.logger.log(
`[IN] [${context.getTrackingId()}] ${this.sendMailWithU109.name}`,
);
try {
const subject = 'License Returned Notification [U-109]';
// メールの本文を作成する
const html = this.templateU109Html
.replaceAll(CUSTOMER_NAME, customerAccountName)
.replaceAll(DEALER_NAME, dealerAccountName)
.replaceAll(PO_NUMBER, poNumber)
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
const text = this.templateU109Text
.replaceAll(CUSTOMER_NAME, customerAccountName)
.replaceAll(DEALER_NAME, dealerAccountName)
.replaceAll(PO_NUMBER, poNumber)
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
// メールを送信する
this.sendMail(
context,
dealerEmails,
customerMails,
this.mailFrom,
subject,
text,
html,
);
} finally {
this.logger.log(
`[OUT] [${context.getTrackingId()}] ${this.sendMailWithU109.name}`,
);
}
}
/**
* U-108使
* @param context
@ -598,7 +484,7 @@ export class SendGridService {
const ccAddress = customerAdminMails.includes(userMail) ? [] : [userMail];
// メールを送信する
this.sendMail(
await this.sendMail(
context,
customerAdminMails,
ccAddress,
@ -614,6 +500,61 @@ export class SendGridService {
}
}
/**
* U-109使
* @param context context
* @param dealerEmails (primary/secondary)
* @param dealerAccountName
* @param lisenceCount
* @param poNumber PO番号
* @param customerMails (primary/secondary)
* @param customerAccountName
* @returns
*/
async sendMailWithU109(
context: Context,
dealerEmails: string[],
dealerAccountName: string,
lisenceCount: number,
poNumber: string,
customerMails: string[],
customerAccountName: string,
): Promise<void> {
this.logger.log(
`[IN] [${context.getTrackingId()}] ${this.sendMailWithU109.name}`,
);
try {
const subject = 'License Returned Notification [U-109]';
// メールの本文を作成する
const html = this.templateU109Html
.replaceAll(CUSTOMER_NAME, customerAccountName)
.replaceAll(DEALER_NAME, dealerAccountName)
.replaceAll(PO_NUMBER, poNumber)
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
const text = this.templateU109Text
.replaceAll(CUSTOMER_NAME, customerAccountName)
.replaceAll(DEALER_NAME, dealerAccountName)
.replaceAll(PO_NUMBER, poNumber)
.replaceAll(LICENSE_QUANTITY, `${lisenceCount}`);
// メールを送信する
await this.sendMail(
context,
dealerEmails,
customerMails,
this.mailFrom,
subject,
text,
html,
);
} finally {
this.logger.log(
`[OUT] [${context.getTrackingId()}] ${this.sendMailWithU109.name}`,
);
}
}
/**
* U-111使
* @param context
@ -646,7 +587,7 @@ export class SendGridService {
.replaceAll(TOP_URL, this.appDomain);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[primaryAdminMail],
[],
@ -712,7 +653,7 @@ export class SendGridService {
}
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[primaryAdminMail],
[],
@ -757,7 +698,7 @@ export class SendGridService {
.replaceAll(TEMPORARY_PASSWORD, temporaryPassword);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[userMail],
[],
@ -818,7 +759,7 @@ export class SendGridService {
.replaceAll(VERIFY_LINK, verifyLink);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[userMail],
[],
@ -868,7 +809,7 @@ export class SendGridService {
const ccAdminMails = adminMails.filter((x) => x !== userMail);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[userMail],
ccAdminMails,
@ -923,7 +864,7 @@ export class SendGridService {
.replaceAll(PRIMARY_ADMIN_NAME, adminName);
// メールを送信する
this.sendMail(
await this.sendMail(
context,
[authorEmail, typistEmail],
[],

View File

@ -59,7 +59,11 @@ import {
deleteEntity,
} from '../../common/repository';
import { Context } from '../../common/log';
import { LicenseSummaryInfo, PartnerInfoFromDb, PartnerLicenseInfoForRepository } from '../../features/accounts/types/types';
import {
LicenseSummaryInfo,
PartnerInfoFromDb,
PartnerLicenseInfoForRepository,
} from '../../features/accounts/types/types';
@Injectable()
export class AccountsRepositoryService {

View File

@ -46,9 +46,6 @@ export class User {
@Column({ default: true })
auto_renew: boolean;
@Column({ default: true })
license_alert: boolean;
@Column({ default: true })
notification: boolean;
@ -127,9 +124,6 @@ export class UserArchive {
@Column()
auto_renew: boolean;
@Column()
license_alert: boolean;
@Column()
notification: boolean;

View File

@ -67,7 +67,6 @@ export class UsersRepositoryService {
external_id: externalUserId,
role,
auto_renew,
license_alert,
notification,
author_id,
accepted_eula_version,
@ -82,7 +81,6 @@ export class UsersRepositoryService {
userEntity.account_id = accountId;
userEntity.external_id = externalUserId;
userEntity.auto_renew = auto_renew;
userEntity.license_alert = license_alert;
userEntity.notification = notification;
userEntity.author_id = author_id;
userEntity.accepted_eula_version = accepted_eula_version;
@ -278,7 +276,6 @@ export class UsersRepositoryService {
role: string,
authorId: string | undefined,
autoRenew: boolean,
licenseAlart: boolean,
notification: boolean,
encryption: boolean | undefined,
encryptionPassword: string | undefined,
@ -345,7 +342,6 @@ export class UsersRepositoryService {
// 共通項目を更新
targetUser.role = role;
targetUser.auto_renew = autoRenew;
targetUser.license_alert = licenseAlart;
targetUser.notification = notification;
const result = await updateEntity(

View File

@ -12,7 +12,7 @@
password for security reasons. To change your password, click on [Forgot
your password?] link on the ODMS Cloud Sign in screen.
</p>
<p>Temporary password:$TEMPORARY_PASSWORD$</p>
<p>Temporary password: $TEMPORARY_PASSWORD$</p>
<p>
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?].
</p>
<p>Temporäres Passwort:$TEMPORARY_PASSWORD$</p>
<p>Temporäres Passwort: $TEMPORARY_PASSWORD$</p>
<p>
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.
</p>
<p>Temporary password:$TEMPORARY_PASSWORD$</p>
<p>Temporary password: $TEMPORARY_PASSWORD$</p>
<p>
Si vous avez besoin d'assistance concernant ODMS Cloud, veuillez
contacter $PRIMARY_ADMIN_NAME$.

View File

@ -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$.