Merged PR 680: タスク削除API IF実装
## 概要 [Task3456: タスク削除API IF実装](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3456) - タスク削除APIのIFを実装しopenapi.jsonを更新しました。 ## レビューポイント - パス、バリデータは想定通りでしょうか? ## UIの変更 - なし ## 動作確認状況 - ローカルで確認
This commit is contained in:
parent
cbf7622909
commit
81c299dd99
@ -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/
|
npx openapi-generator-cli generate -g typescript-axios -i /app/dictation_server/src/api/odms/openapi.json -o /app/dictation_client/src/api/
|
||||||
|
|||||||
@ -1549,12 +1549,6 @@ export interface PostUpdateUserRequest {
|
|||||||
* @memberof PostUpdateUserRequest
|
* @memberof PostUpdateUserRequest
|
||||||
*/
|
*/
|
||||||
'autoRenew': boolean;
|
'autoRenew': boolean;
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
* @memberof PostUpdateUserRequest
|
|
||||||
*/
|
|
||||||
'licenseAlart': boolean;
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@ -1660,12 +1654,6 @@ export interface SignupRequest {
|
|||||||
* @memberof SignupRequest
|
* @memberof SignupRequest
|
||||||
*/
|
*/
|
||||||
'autoRenew': boolean;
|
'autoRenew': boolean;
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
* @memberof SignupRequest
|
|
||||||
*/
|
|
||||||
'licenseAlert': boolean;
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@ -2212,12 +2200,6 @@ export interface User {
|
|||||||
* @memberof User
|
* @memberof User
|
||||||
*/
|
*/
|
||||||
'autoRenew': boolean;
|
'autoRenew': boolean;
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @type {boolean}
|
|
||||||
* @memberof User
|
|
||||||
*/
|
|
||||||
'licenseAlert': boolean;
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
|||||||
@ -164,7 +164,6 @@ export const updateUserAsync = createAsyncThunk<
|
|||||||
encryptionPassword,
|
encryptionPassword,
|
||||||
prompt,
|
prompt,
|
||||||
autoRenew: updateUser.autoRenew,
|
autoRenew: updateUser.autoRenew,
|
||||||
licenseAlart: updateUser.licenseAlert,
|
|
||||||
notification: updateUser.notification,
|
notification: updateUser.notification,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -131,8 +131,6 @@ export const selectAuthorId = (state: RootState) =>
|
|||||||
state.user.apps.addUser.authorId;
|
state.user.apps.addUser.authorId;
|
||||||
export const selectAutoRenew = (state: RootState) =>
|
export const selectAutoRenew = (state: RootState) =>
|
||||||
state.user.apps.addUser.autoRenew;
|
state.user.apps.addUser.autoRenew;
|
||||||
export const selectLicenseAlert = (state: RootState) =>
|
|
||||||
state.user.apps.addUser.licenseAlert;
|
|
||||||
export const selectNotification = (state: RootState) =>
|
export const selectNotification = (state: RootState) =>
|
||||||
state.user.apps.addUser.notification;
|
state.user.apps.addUser.notification;
|
||||||
// AddUserを返却する
|
// AddUserを返却する
|
||||||
|
|||||||
@ -16,7 +16,6 @@ export interface UserView
|
|||||||
encryption: boolean | string;
|
encryption: boolean | string;
|
||||||
emailVerified: boolean;
|
emailVerified: boolean;
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
licenseAlert: boolean;
|
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
@ -28,7 +27,6 @@ export interface AddUser {
|
|||||||
role: RoleType;
|
role: RoleType;
|
||||||
email: string;
|
email: string;
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
licenseAlert: boolean;
|
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
authorId?: string;
|
authorId?: string;
|
||||||
encryption?: boolean;
|
encryption?: boolean;
|
||||||
@ -46,7 +44,6 @@ export interface UpdateUser {
|
|||||||
encryptionPassword?: string | undefined;
|
encryptionPassword?: string | undefined;
|
||||||
prompt?: boolean | undefined;
|
prompt?: boolean | undefined;
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
licenseAlert: boolean;
|
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ const initialState: UsersState = {
|
|||||||
encryptionPassword: undefined,
|
encryptionPassword: undefined,
|
||||||
prompt: undefined,
|
prompt: undefined,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
},
|
},
|
||||||
selectedUser: {
|
selectedUser: {
|
||||||
@ -36,7 +35,6 @@ const initialState: UsersState = {
|
|||||||
encryptionPassword: undefined,
|
encryptionPassword: undefined,
|
||||||
prompt: undefined,
|
prompt: undefined,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
},
|
},
|
||||||
addUser: {
|
addUser: {
|
||||||
@ -44,7 +42,6 @@ const initialState: UsersState = {
|
|||||||
role: USER_ROLES.NONE,
|
role: USER_ROLES.NONE,
|
||||||
email: "",
|
email: "",
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
authorId: undefined,
|
authorId: undefined,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
@ -93,13 +90,6 @@ export const userSlice = createSlice({
|
|||||||
const { autoRenew } = action.payload;
|
const { autoRenew } = action.payload;
|
||||||
state.apps.addUser.autoRenew = autoRenew;
|
state.apps.addUser.autoRenew = autoRenew;
|
||||||
},
|
},
|
||||||
changeLicenseAlert: (
|
|
||||||
state,
|
|
||||||
action: PayloadAction<{ licenseAlert: boolean }>
|
|
||||||
) => {
|
|
||||||
const { licenseAlert } = action.payload;
|
|
||||||
state.apps.addUser.licenseAlert = licenseAlert;
|
|
||||||
},
|
|
||||||
changeEncryption: (
|
changeEncryption: (
|
||||||
state,
|
state,
|
||||||
action: PayloadAction<{ encryption: boolean }>
|
action: PayloadAction<{ encryption: boolean }>
|
||||||
@ -149,7 +139,6 @@ export const userSlice = createSlice({
|
|||||||
state.apps.updateUser.encryptionPassword = undefined;
|
state.apps.updateUser.encryptionPassword = undefined;
|
||||||
state.apps.updateUser.prompt = user.prompt;
|
state.apps.updateUser.prompt = user.prompt;
|
||||||
state.apps.updateUser.autoRenew = user.autoRenew;
|
state.apps.updateUser.autoRenew = user.autoRenew;
|
||||||
state.apps.updateUser.licenseAlert = user.licenseAlert;
|
|
||||||
state.apps.updateUser.notification = user.notification;
|
state.apps.updateUser.notification = user.notification;
|
||||||
|
|
||||||
state.apps.selectedUser.id = user.id;
|
state.apps.selectedUser.id = user.id;
|
||||||
@ -161,7 +150,6 @@ export const userSlice = createSlice({
|
|||||||
state.apps.selectedUser.encryptionPassword = undefined;
|
state.apps.selectedUser.encryptionPassword = undefined;
|
||||||
state.apps.selectedUser.prompt = user.prompt;
|
state.apps.selectedUser.prompt = user.prompt;
|
||||||
state.apps.selectedUser.autoRenew = user.autoRenew;
|
state.apps.selectedUser.autoRenew = user.autoRenew;
|
||||||
state.apps.selectedUser.licenseAlert = user.licenseAlert;
|
|
||||||
state.apps.selectedUser.notification = user.notification;
|
state.apps.selectedUser.notification = user.notification;
|
||||||
|
|
||||||
state.apps.hasPasswordMask = user.encryption;
|
state.apps.hasPasswordMask = user.encryption;
|
||||||
@ -211,13 +199,6 @@ export const userSlice = createSlice({
|
|||||||
const { autoRenew } = action.payload;
|
const { autoRenew } = action.payload;
|
||||||
state.apps.updateUser.autoRenew = autoRenew;
|
state.apps.updateUser.autoRenew = autoRenew;
|
||||||
},
|
},
|
||||||
changeUpdateLicenseAlert: (
|
|
||||||
state,
|
|
||||||
action: PayloadAction<{ licenseAlert: boolean }>
|
|
||||||
) => {
|
|
||||||
const { licenseAlert } = action.payload;
|
|
||||||
state.apps.updateUser.licenseAlert = licenseAlert;
|
|
||||||
},
|
|
||||||
changeUpdateNotification: (
|
changeUpdateNotification: (
|
||||||
state,
|
state,
|
||||||
action: PayloadAction<{ notification: boolean }>
|
action: PayloadAction<{ notification: boolean }>
|
||||||
@ -318,7 +299,6 @@ export const {
|
|||||||
changeRole,
|
changeRole,
|
||||||
changeAuthorId,
|
changeAuthorId,
|
||||||
changeAutoRenew,
|
changeAutoRenew,
|
||||||
changeLicenseAlert,
|
|
||||||
changeNotification,
|
changeNotification,
|
||||||
cleanupAddUser,
|
cleanupAddUser,
|
||||||
changeUpdateUser,
|
changeUpdateUser,
|
||||||
@ -328,7 +308,6 @@ export const {
|
|||||||
changeUpdateEncryptionPassword,
|
changeUpdateEncryptionPassword,
|
||||||
changeUpdatePrompt,
|
changeUpdatePrompt,
|
||||||
changeUpdateAutoRenew,
|
changeUpdateAutoRenew,
|
||||||
changeUpdateLicenseAlert,
|
|
||||||
changeUpdateNotification,
|
changeUpdateNotification,
|
||||||
cleanupUpdateUser,
|
cleanupUpdateUser,
|
||||||
changeEncryption,
|
changeEncryption,
|
||||||
|
|||||||
@ -10,6 +10,14 @@ import {
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router-dom";
|
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 AuthPage: React.FC = (): JSX.Element => {
|
||||||
const { instance } = useMsal();
|
const { instance } = useMsal();
|
||||||
@ -26,6 +34,39 @@ const AuthPage: React.FC = (): JSX.Element => {
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
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();
|
const loginResult = await instance.handleRedirectPromise();
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
|
|||||||
@ -28,6 +28,33 @@ const LoginPage: React.FC = (): JSX.Element => {
|
|||||||
selectLocalStorageKeyforIdToken
|
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(
|
const tokenSet = useCallback(
|
||||||
async (idToken: string) => {
|
async (idToken: string) => {
|
||||||
// ログイン処理呼び出し
|
// ログイン処理呼び出し
|
||||||
@ -59,44 +86,36 @@ const LoginPage: React.FC = (): JSX.Element => {
|
|||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
// 第一~第四階層の管理者はライセンス画面へ遷移
|
|
||||||
if (
|
// ログイン成功した場合、適切なページに遷移する
|
||||||
isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
|
navigateToLoginedPage();
|
||||||
isAdminUser()
|
|
||||||
) {
|
|
||||||
navigate("/license");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 第五階層の管理者はユーザー画面へ遷移
|
|
||||||
if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
|
|
||||||
navigate("/user");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 一般ユーザーはdictationPageへ遷移
|
|
||||||
if (isStandardUser()) {
|
|
||||||
navigate("/dictations");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// それ以外は認証エラー画面へ遷移
|
|
||||||
instance.logoutRedirect({
|
|
||||||
postLogoutRedirectUri: "/AuthError",
|
|
||||||
});
|
|
||||||
clearToken();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[dispatch, i18n.language, instance, navigate]
|
[dispatch, i18n.language, instance, navigate, navigateToLoginedPage]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// idTokenStringがあるか⇒認証中
|
||||||
|
// accessTokenがある場合⇒ログイン済み
|
||||||
|
// どちらもなければ直打ち
|
||||||
|
(async () => {
|
||||||
|
if (loadAccessToken()) {
|
||||||
|
navigateToLoginedPage();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する
|
// AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する
|
||||||
if (!localStorageKeyforIdToken) {
|
if (!localStorageKeyforIdToken) {
|
||||||
navigate("/");
|
navigate("/");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
|
||||||
// IDトークンの取得
|
|
||||||
const idTokenString = localStorage.getItem(localStorageKeyforIdToken);
|
const idTokenString = localStorage.getItem(localStorageKeyforIdToken);
|
||||||
|
|
||||||
|
if (idTokenString === null) {
|
||||||
|
navigate("/");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (idTokenString) {
|
if (idTokenString) {
|
||||||
const idTokenObject = JSON.parse(idTokenString);
|
const idTokenObject = JSON.parse(idTokenString);
|
||||||
if (isIdToken(idTokenObject)) {
|
if (isIdToken(idTokenObject)) {
|
||||||
|
|||||||
@ -18,10 +18,19 @@ import {
|
|||||||
} from "features//terms";
|
} from "features//terms";
|
||||||
import { selectLocalStorageKeyforIdToken } from "features/login";
|
import { selectLocalStorageKeyforIdToken } from "features/login";
|
||||||
import { useNavigate } from "react-router-dom";
|
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 TermsPage: React.FC = (): JSX.Element => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const dispatch: AppDispatch = useDispatch();
|
const dispatch: AppDispatch = useDispatch();
|
||||||
|
const { instance } = useMsal();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const updateAccceptVersions = useSelector(selectTermVersions);
|
const updateAccceptVersions = useSelector(selectTermVersions);
|
||||||
const localStorageKeyforIdToken = useSelector(
|
const localStorageKeyforIdToken = useSelector(
|
||||||
@ -40,6 +49,34 @@ const TermsPage: React.FC = (): JSX.Element => {
|
|||||||
|
|
||||||
// 画面起動時
|
// 画面起動時
|
||||||
useEffect(() => {
|
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());
|
dispatch(getTermsInfoAsync());
|
||||||
if (localStorageKeyforIdToken) {
|
if (localStorageKeyforIdToken) {
|
||||||
dispatch(getAccountInfoMinimalAccessAsync({ localStorageKeyforIdToken }));
|
dispatch(getAccountInfoMinimalAccessAsync({ localStorageKeyforIdToken }));
|
||||||
|
|||||||
@ -174,9 +174,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
|||||||
<th>
|
<th>
|
||||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||||
</th>
|
</th>
|
||||||
<th>
|
|
||||||
{t(getTranslationID("userListPage.label.licenseAlert"))}
|
|
||||||
</th>
|
|
||||||
<th>
|
<th>
|
||||||
{t(getTranslationID("userListPage.label.notification"))}
|
{t(getTranslationID("userListPage.label.notification"))}
|
||||||
</th>
|
</th>
|
||||||
@ -292,7 +289,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{boolToElement(user.autoRenew)}</td>
|
<td>{boolToElement(user.autoRenew)}</td>
|
||||||
<td>{boolToElement(user.licenseAlert)}</td>
|
|
||||||
<td>{boolToElement(user.notification)}</td>
|
<td>{boolToElement(user.notification)}</td>
|
||||||
<td>{boolToElement(user.emailVerified)}</td>
|
<td>{boolToElement(user.emailVerified)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import {
|
|||||||
changeRole,
|
changeRole,
|
||||||
changeAuthorId,
|
changeAuthorId,
|
||||||
changeAutoRenew,
|
changeAutoRenew,
|
||||||
changeLicenseAlert,
|
|
||||||
changeNotification,
|
changeNotification,
|
||||||
cleanupAddUser,
|
cleanupAddUser,
|
||||||
addUserAsync,
|
addUserAsync,
|
||||||
@ -324,22 +323,6 @@ export const UserAddPopup: React.FC<UserAddPopupProps> = (props) => {
|
|||||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</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>
|
<p>
|
||||||
<label htmlFor="add_Notification">
|
<label htmlFor="add_Notification">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import {
|
|||||||
changeUpdateAutoRenew,
|
changeUpdateAutoRenew,
|
||||||
changeUpdateEncryption,
|
changeUpdateEncryption,
|
||||||
changeUpdateEncryptionPassword,
|
changeUpdateEncryptionPassword,
|
||||||
changeUpdateLicenseAlert,
|
|
||||||
changeUpdateNotification,
|
changeUpdateNotification,
|
||||||
changeUpdatePrompt,
|
changeUpdatePrompt,
|
||||||
changeUpdateRole,
|
changeUpdateRole,
|
||||||
@ -336,24 +335,6 @@ export const UserUpdatePopup: React.FC<UserUpdatePopupProps> = (props) => {
|
|||||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</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>
|
<p>
|
||||||
<label htmlFor="edit_Notification">
|
<label htmlFor="edit_Notification">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@ -2869,6 +2869,60 @@
|
|||||||
"security": [{ "bearer": [] }]
|
"security": [{ "bearer": [] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/tasks/{audioFileId}/delete": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "deleteTask",
|
||||||
|
"summary": "",
|
||||||
|
"description": "指定した文字起こしタスクを削除します。",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "audioFileId",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"description": "ODMS Cloud上の音声ファイルID",
|
||||||
|
"schema": { "type": "number" }
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "成功時のレスポンス",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/PostDeleteTaskResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "不正なパラメータ",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "認証エラー",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "想定外のサーバーエラー",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": ["tasks"],
|
||||||
|
"security": [{ "bearer": [] }]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/licenses/orders": {
|
"/licenses/orders": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "createOrders",
|
"operationId": "createOrders",
|
||||||
@ -4087,7 +4141,6 @@
|
|||||||
"email": { "type": "string" },
|
"email": { "type": "string" },
|
||||||
"emailVerified": { "type": "boolean" },
|
"emailVerified": { "type": "boolean" },
|
||||||
"autoRenew": { "type": "boolean" },
|
"autoRenew": { "type": "boolean" },
|
||||||
"licenseAlert": { "type": "boolean" },
|
|
||||||
"notification": { "type": "boolean" },
|
"notification": { "type": "boolean" },
|
||||||
"encryption": { "type": "boolean" },
|
"encryption": { "type": "boolean" },
|
||||||
"prompt": { "type": "boolean" },
|
"prompt": { "type": "boolean" },
|
||||||
@ -4106,7 +4159,6 @@
|
|||||||
"email",
|
"email",
|
||||||
"emailVerified",
|
"emailVerified",
|
||||||
"autoRenew",
|
"autoRenew",
|
||||||
"licenseAlert",
|
|
||||||
"notification",
|
"notification",
|
||||||
"encryption",
|
"encryption",
|
||||||
"prompt",
|
"prompt",
|
||||||
@ -4131,20 +4183,12 @@
|
|||||||
"authorId": { "type": "string" },
|
"authorId": { "type": "string" },
|
||||||
"email": { "type": "string" },
|
"email": { "type": "string" },
|
||||||
"autoRenew": { "type": "boolean" },
|
"autoRenew": { "type": "boolean" },
|
||||||
"licenseAlert": { "type": "boolean" },
|
|
||||||
"notification": { "type": "boolean" },
|
"notification": { "type": "boolean" },
|
||||||
"encryption": { "type": "boolean" },
|
"encryption": { "type": "boolean" },
|
||||||
"encryptionPassword": { "type": "string" },
|
"encryptionPassword": { "type": "string" },
|
||||||
"prompt": { "type": "boolean" }
|
"prompt": { "type": "boolean" }
|
||||||
},
|
},
|
||||||
"required": [
|
"required": ["name", "role", "email", "autoRenew", "notification"]
|
||||||
"name",
|
|
||||||
"role",
|
|
||||||
"email",
|
|
||||||
"autoRenew",
|
|
||||||
"licenseAlert",
|
|
||||||
"notification"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"SignupResponse": { "type": "object", "properties": {} },
|
"SignupResponse": { "type": "object", "properties": {} },
|
||||||
"OptionItem": {
|
"OptionItem": {
|
||||||
@ -4260,13 +4304,12 @@
|
|||||||
"role": { "type": "string", "description": "none/author/typist" },
|
"role": { "type": "string", "description": "none/author/typist" },
|
||||||
"authorId": { "type": "string" },
|
"authorId": { "type": "string" },
|
||||||
"autoRenew": { "type": "boolean" },
|
"autoRenew": { "type": "boolean" },
|
||||||
"licenseAlart": { "type": "boolean" },
|
|
||||||
"notification": { "type": "boolean" },
|
"notification": { "type": "boolean" },
|
||||||
"encryption": { "type": "boolean" },
|
"encryption": { "type": "boolean" },
|
||||||
"encryptionPassword": { "type": "string" },
|
"encryptionPassword": { "type": "string" },
|
||||||
"prompt": { "type": "boolean" }
|
"prompt": { "type": "boolean" }
|
||||||
},
|
},
|
||||||
"required": ["id", "role", "autoRenew", "licenseAlart", "notification"]
|
"required": ["id", "role", "autoRenew", "notification"]
|
||||||
},
|
},
|
||||||
"PostUpdateUserResponse": { "type": "object", "properties": {} },
|
"PostUpdateUserResponse": { "type": "object", "properties": {} },
|
||||||
"AllocateLicenseRequest": {
|
"AllocateLicenseRequest": {
|
||||||
@ -4611,6 +4654,7 @@
|
|||||||
"required": ["assignees"]
|
"required": ["assignees"]
|
||||||
},
|
},
|
||||||
"PostCheckoutPermissionResponse": { "type": "object", "properties": {} },
|
"PostCheckoutPermissionResponse": { "type": "object", "properties": {} },
|
||||||
|
"PostDeleteTaskResponse": { "type": "object", "properties": {} },
|
||||||
"CreateOrdersRequest": {
|
"CreateOrdersRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
@ -187,7 +187,6 @@ export const makeTestAccount = async (
|
|||||||
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
||||||
email_verified: d?.email_verified ?? true,
|
email_verified: d?.email_verified ?? true,
|
||||||
auto_renew: d?.auto_renew ?? true,
|
auto_renew: d?.auto_renew ?? true,
|
||||||
license_alert: d?.license_alert ?? true,
|
|
||||||
notification: d?.notification ?? true,
|
notification: d?.notification ?? true,
|
||||||
encryption: d?.encryption ?? true,
|
encryption: d?.encryption ?? true,
|
||||||
encryption_password: d?.encryption_password ?? 'password',
|
encryption_password: d?.encryption_password ?? 'password',
|
||||||
@ -295,7 +294,6 @@ export const makeTestUser = async (
|
|||||||
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
||||||
email_verified: d?.email_verified ?? true,
|
email_verified: d?.email_verified ?? true,
|
||||||
auto_renew: d?.auto_renew ?? true,
|
auto_renew: d?.auto_renew ?? true,
|
||||||
license_alert: d?.license_alert ?? true,
|
|
||||||
notification: d?.notification ?? true,
|
notification: d?.notification ?? true,
|
||||||
encryption: d?.encryption ?? true,
|
encryption: d?.encryption ?? true,
|
||||||
encryption_password: d?.encryption_password,
|
encryption_password: d?.encryption_password,
|
||||||
|
|||||||
@ -309,7 +309,6 @@ export const makeDefaultAccountsRepositoryMockValue =
|
|||||||
user.accepted_dpa_version = '1.0';
|
user.accepted_dpa_version = '1.0';
|
||||||
user.email_verified = true;
|
user.email_verified = true;
|
||||||
user.auto_renew = false;
|
user.auto_renew = false;
|
||||||
user.license_alert = false;
|
|
||||||
user.notification = false;
|
user.notification = false;
|
||||||
user.deleted_at = null;
|
user.deleted_at = null;
|
||||||
user.created_by = 'test';
|
user.created_by = 'test';
|
||||||
@ -339,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user.accepted_dpa_version = '1.0';
|
user.accepted_dpa_version = '1.0';
|
||||||
user.email_verified = true;
|
user.email_verified = true;
|
||||||
user.auto_renew = false;
|
user.auto_renew = false;
|
||||||
user.license_alert = false;
|
|
||||||
user.notification = false;
|
user.notification = false;
|
||||||
user.deleted_at = null;
|
user.deleted_at = null;
|
||||||
user.created_by = 'test';
|
user.created_by = 'test';
|
||||||
@ -388,7 +386,6 @@ export const makeDefaultUserGroupsRepositoryMockValue =
|
|||||||
user.accepted_dpa_version = '1.0';
|
user.accepted_dpa_version = '1.0';
|
||||||
user.email_verified = true;
|
user.email_verified = true;
|
||||||
user.auto_renew = false;
|
user.auto_renew = false;
|
||||||
user.license_alert = false;
|
|
||||||
user.notification = false;
|
user.notification = false;
|
||||||
user.deleted_at = null;
|
user.deleted_at = null;
|
||||||
user.created_by = 'test';
|
user.created_by = 'test';
|
||||||
|
|||||||
@ -483,7 +483,6 @@ export class UpdateTypistGroupResponse {}
|
|||||||
|
|
||||||
export class CreatePartnerAccountResponse {}
|
export class CreatePartnerAccountResponse {}
|
||||||
|
|
||||||
|
|
||||||
export class PartnerLicenseInfo {
|
export class PartnerLicenseInfo {
|
||||||
@ApiProperty({ description: 'アカウントID' })
|
@ApiProperty({ description: 'アカウントID' })
|
||||||
accountId: number;
|
accountId: number;
|
||||||
@ -523,7 +522,6 @@ export class GetPartnerLicensesResponse {
|
|||||||
childrenPartnerLicenses: PartnerLicenseInfo[];
|
childrenPartnerLicenses: PartnerLicenseInfo[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export class LicenseOrder {
|
export class LicenseOrder {
|
||||||
@ApiProperty({ description: '注文日付' })
|
@ApiProperty({ description: '注文日付' })
|
||||||
orderDate: string;
|
orderDate: string;
|
||||||
@ -546,7 +544,6 @@ export class GetOrderHistoriesResponse {
|
|||||||
|
|
||||||
export class IssueLicenseResponse {}
|
export class IssueLicenseResponse {}
|
||||||
|
|
||||||
|
|
||||||
export class Dealer {
|
export class Dealer {
|
||||||
@ApiProperty({ description: 'アカウントID' })
|
@ApiProperty({ description: 'アカウントID' })
|
||||||
id: number;
|
id: number;
|
||||||
@ -563,7 +560,6 @@ export class GetDealersResponse {
|
|||||||
|
|
||||||
export class CancelIssueResponse {}
|
export class CancelIssueResponse {}
|
||||||
|
|
||||||
|
|
||||||
export class Worktype {
|
export class Worktype {
|
||||||
@ApiProperty({ description: 'WorktypeのID' })
|
@ApiProperty({ description: 'WorktypeのID' })
|
||||||
id: number;
|
id: number;
|
||||||
@ -588,7 +584,6 @@ export class CreateWorktypeResponse {}
|
|||||||
|
|
||||||
export class UpdateWorktypeResponse {}
|
export class UpdateWorktypeResponse {}
|
||||||
|
|
||||||
|
|
||||||
export class GetWorktypeOptionItem extends PostWorktypeOptionItem {
|
export class GetWorktypeOptionItem extends PostWorktypeOptionItem {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
id: number;
|
id: number;
|
||||||
@ -609,7 +604,6 @@ export class DeleteWorktypeResponse {}
|
|||||||
|
|
||||||
export class PostActiveWorktypeResponse {}
|
export class PostActiveWorktypeResponse {}
|
||||||
|
|
||||||
|
|
||||||
export class Partner {
|
export class Partner {
|
||||||
@ApiProperty({ description: '会社名' })
|
@ApiProperty({ description: '会社名' })
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@ -148,7 +148,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
updated_by: null,
|
updated_by: null,
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
|
|||||||
@ -120,7 +120,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user1.accepted_dpa_version = '1.0';
|
user1.accepted_dpa_version = '1.0';
|
||||||
user1.email_verified = true;
|
user1.email_verified = true;
|
||||||
user1.auto_renew = false;
|
user1.auto_renew = false;
|
||||||
user1.license_alert = false;
|
|
||||||
user1.notification = false;
|
user1.notification = false;
|
||||||
user1.encryption = false;
|
user1.encryption = false;
|
||||||
user1.prompt = false;
|
user1.prompt = false;
|
||||||
|
|||||||
@ -82,7 +82,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user.accepted_dpa_version = '1.0';
|
user.accepted_dpa_version = '1.0';
|
||||||
user.email_verified = true;
|
user.email_verified = true;
|
||||||
user.auto_renew = false;
|
user.auto_renew = false;
|
||||||
user.license_alert = false;
|
|
||||||
user.notification = false;
|
user.notification = false;
|
||||||
user.deleted_at = null;
|
user.deleted_at = null;
|
||||||
user.created_by = 'test';
|
user.created_by = 'test';
|
||||||
|
|||||||
@ -29,6 +29,8 @@ import {
|
|||||||
ChangeStatusResponse,
|
ChangeStatusResponse,
|
||||||
PostCheckoutPermissionRequest,
|
PostCheckoutPermissionRequest,
|
||||||
PostCheckoutPermissionResponse,
|
PostCheckoutPermissionResponse,
|
||||||
|
PostDeleteTaskRequest,
|
||||||
|
PostDeleteTaskResponse,
|
||||||
TasksRequest,
|
TasksRequest,
|
||||||
TasksResponse,
|
TasksResponse,
|
||||||
} from './types/types';
|
} from './types/types';
|
||||||
@ -752,4 +754,82 @@ export class TasksController {
|
|||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post(':audioFileId/delete')
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.OK,
|
||||||
|
type: PostDeleteTaskResponse,
|
||||||
|
description: '成功時のレスポンス',
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.BAD_REQUEST,
|
||||||
|
description: '不正なパラメータ',
|
||||||
|
type: ErrorResponse,
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.UNAUTHORIZED,
|
||||||
|
description: '認証エラー',
|
||||||
|
type: ErrorResponse,
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
|
description: '想定外のサーバーエラー',
|
||||||
|
type: ErrorResponse,
|
||||||
|
})
|
||||||
|
@ApiOperation({
|
||||||
|
operationId: 'deleteTask',
|
||||||
|
description: '指定した文字起こしタスクを削除します。',
|
||||||
|
})
|
||||||
|
@ApiBearerAuth()
|
||||||
|
@UseGuards(AuthGuard)
|
||||||
|
@UseGuards(
|
||||||
|
RoleGuard.requireds({ roles: [ADMIN_ROLES.ADMIN, USER_ROLES.AUTHOR] }),
|
||||||
|
)
|
||||||
|
async deleteTask(
|
||||||
|
@Req() req: Request,
|
||||||
|
@Param() params: PostDeleteTaskRequest,
|
||||||
|
): Promise<PostDeleteTaskResponse> {
|
||||||
|
const { audioFileId } = params;
|
||||||
|
|
||||||
|
// AuthGuardでチェック済みなのでここでのアクセストークンチェックはしない
|
||||||
|
const accessToken = retrieveAuthorizationToken(req);
|
||||||
|
if (!accessToken) {
|
||||||
|
throw new HttpException(
|
||||||
|
makeErrorResponse('E000107'),
|
||||||
|
HttpStatus.UNAUTHORIZED,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const ip = retrieveIp(req);
|
||||||
|
if (!ip) {
|
||||||
|
throw new HttpException(
|
||||||
|
makeErrorResponse('E000401'),
|
||||||
|
HttpStatus.UNAUTHORIZED,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestId = retrieveRequestId(req);
|
||||||
|
if (!requestId) {
|
||||||
|
throw new HttpException(
|
||||||
|
makeErrorResponse('E000501'),
|
||||||
|
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const decodedAccessToken = jwt.decode(accessToken, { json: true });
|
||||||
|
if (!decodedAccessToken) {
|
||||||
|
throw new HttpException(
|
||||||
|
makeErrorResponse('E000101'),
|
||||||
|
HttpStatus.UNAUTHORIZED,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const { userId } = decodedAccessToken as AccessToken;
|
||||||
|
|
||||||
|
const context = makeContext(userId, requestId);
|
||||||
|
this.logger.log(`[${context.getTrackingId()}] ip : ${ip}`);
|
||||||
|
|
||||||
|
// TODO: Task削除処理を実装する
|
||||||
|
console.log(audioFileId);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -338,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user1.role = 'admin';
|
user1.role = 'admin';
|
||||||
user1.email_verified = true;
|
user1.email_verified = true;
|
||||||
user1.auto_renew = false;
|
user1.auto_renew = false;
|
||||||
user1.license_alert = false;
|
|
||||||
user1.notification = false;
|
user1.notification = false;
|
||||||
user1.deleted_at = null;
|
user1.deleted_at = null;
|
||||||
user1.created_by = 'test';
|
user1.created_by = 'test';
|
||||||
@ -482,7 +481,6 @@ const defaultTasksRepositoryMockValue: {
|
|||||||
accepted_dpa_version: '',
|
accepted_dpa_version: '',
|
||||||
email_verified: true,
|
email_verified: true,
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
|
|||||||
@ -227,3 +227,13 @@ export class PostCheckoutPermissionRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class PostCheckoutPermissionResponse {}
|
export class PostCheckoutPermissionResponse {}
|
||||||
|
|
||||||
|
export class PostDeleteTaskRequest {
|
||||||
|
@ApiProperty({ description: 'ODMS Cloud上の音声ファイルID' })
|
||||||
|
@Type(() => Number)
|
||||||
|
@IsInt()
|
||||||
|
@Min(1)
|
||||||
|
audioFileId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PostDeleteTaskResponse {}
|
||||||
|
|||||||
@ -331,7 +331,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user1.accepted_dpa_version = '1.0';
|
user1.accepted_dpa_version = '1.0';
|
||||||
user1.email_verified = true;
|
user1.email_verified = true;
|
||||||
user1.auto_renew = false;
|
user1.auto_renew = false;
|
||||||
user1.license_alert = false;
|
|
||||||
user1.notification = false;
|
user1.notification = false;
|
||||||
user1.encryption = false;
|
user1.encryption = false;
|
||||||
user1.prompt = false;
|
user1.prompt = false;
|
||||||
@ -351,7 +350,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
|||||||
user2.accepted_dpa_version = '1.0';
|
user2.accepted_dpa_version = '1.0';
|
||||||
user2.email_verified = true;
|
user2.email_verified = true;
|
||||||
user2.auto_renew = false;
|
user2.auto_renew = false;
|
||||||
user2.license_alert = false;
|
|
||||||
user2.notification = false;
|
user2.notification = false;
|
||||||
user2.encryption = false;
|
user2.encryption = false;
|
||||||
user2.prompt = false;
|
user2.prompt = false;
|
||||||
|
|||||||
@ -1,5 +1,12 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
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 {
|
import {
|
||||||
TASK_LIST_SORTABLE_ATTRIBUTES,
|
TASK_LIST_SORTABLE_ATTRIBUTES,
|
||||||
USER_LICENSE_STATUS,
|
USER_LICENSE_STATUS,
|
||||||
@ -44,9 +51,6 @@ export class User {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
|
|
||||||
@ApiProperty()
|
|
||||||
licenseAlert: boolean;
|
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
|
|
||||||
@ -97,11 +101,6 @@ export class SignupRequest {
|
|||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
|
|
||||||
@ApiProperty()
|
|
||||||
@Type(() => Boolean)
|
|
||||||
@IsBoolean()
|
|
||||||
licenseAlert: boolean;
|
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@Type(() => Boolean)
|
@Type(() => Boolean)
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
@ -233,11 +232,6 @@ export class PostUpdateUserRequest {
|
|||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
autoRenew: boolean;
|
autoRenew: boolean;
|
||||||
|
|
||||||
@ApiProperty()
|
|
||||||
@Type(() => Boolean)
|
|
||||||
@IsBoolean()
|
|
||||||
licenseAlart: boolean;
|
|
||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@Type(() => Boolean)
|
@Type(() => Boolean)
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
|
|||||||
@ -249,7 +249,6 @@ export class UsersController {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -301,7 +300,6 @@ export class UsersController {
|
|||||||
role as UserRoles,
|
role as UserRoles,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -569,7 +567,6 @@ export class UsersController {
|
|||||||
role,
|
role,
|
||||||
authorId,
|
authorId,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlart,
|
|
||||||
notification,
|
notification,
|
||||||
encryption,
|
encryption,
|
||||||
encryptionPassword,
|
encryptionPassword,
|
||||||
@ -619,7 +616,6 @@ export class UsersController {
|
|||||||
role,
|
role,
|
||||||
authorId,
|
authorId,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlart,
|
|
||||||
notification,
|
notification,
|
||||||
encryption,
|
encryption,
|
||||||
encryptionPassword,
|
encryptionPassword,
|
||||||
|
|||||||
@ -221,7 +221,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
|||||||
updated_by: 'string;',
|
updated_by: 'string;',
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -273,7 +272,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
|||||||
updated_by: 'string;',
|
updated_by: 'string;',
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -324,7 +322,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
|||||||
updated_by: 'string;',
|
updated_by: 'string;',
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -380,7 +377,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
|||||||
updated_by: 'string;',
|
updated_by: 'string;',
|
||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
auto_renew: true,
|
auto_renew: true,
|
||||||
license_alert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -494,7 +490,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
),
|
),
|
||||||
).toEqual(undefined);
|
).toEqual(undefined);
|
||||||
@ -507,7 +502,6 @@ describe('UsersService.createUser', () => {
|
|||||||
expect(user?.author_id).toEqual(null);
|
expect(user?.author_id).toEqual(null);
|
||||||
expect(user?.email_verified).toEqual(false);
|
expect(user?.email_verified).toEqual(false);
|
||||||
expect(user?.auto_renew).toEqual(autoRenew);
|
expect(user?.auto_renew).toEqual(autoRenew);
|
||||||
expect(user?.license_alert).toEqual(licenseAlert);
|
|
||||||
expect(user?.notification).toEqual(notification);
|
expect(user?.notification).toEqual(notification);
|
||||||
expect(user?.encryption).toEqual(false);
|
expect(user?.encryption).toEqual(false);
|
||||||
expect(user?.encryption_password).toEqual(null);
|
expect(user?.encryption_password).toEqual(null);
|
||||||
@ -574,7 +568,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -591,7 +584,6 @@ describe('UsersService.createUser', () => {
|
|||||||
expect(user?.author_id).toEqual(authorId);
|
expect(user?.author_id).toEqual(authorId);
|
||||||
expect(user?.email_verified).toEqual(false);
|
expect(user?.email_verified).toEqual(false);
|
||||||
expect(user?.auto_renew).toEqual(autoRenew);
|
expect(user?.auto_renew).toEqual(autoRenew);
|
||||||
expect(user?.license_alert).toEqual(licenseAlert);
|
|
||||||
expect(user?.notification).toEqual(notification);
|
expect(user?.notification).toEqual(notification);
|
||||||
expect(user?.encryption).toEqual(encryption);
|
expect(user?.encryption).toEqual(encryption);
|
||||||
expect(user?.encryption_password).toEqual(encryptionPassword);
|
expect(user?.encryption_password).toEqual(encryptionPassword);
|
||||||
@ -657,7 +649,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -674,7 +665,6 @@ describe('UsersService.createUser', () => {
|
|||||||
expect(user?.author_id).toEqual(authorId);
|
expect(user?.author_id).toEqual(authorId);
|
||||||
expect(user?.email_verified).toEqual(false);
|
expect(user?.email_verified).toEqual(false);
|
||||||
expect(user?.auto_renew).toEqual(autoRenew);
|
expect(user?.auto_renew).toEqual(autoRenew);
|
||||||
expect(user?.license_alert).toEqual(licenseAlert);
|
|
||||||
expect(user?.notification).toEqual(notification);
|
expect(user?.notification).toEqual(notification);
|
||||||
expect(user?.encryption).toEqual(encryption);
|
expect(user?.encryption).toEqual(encryption);
|
||||||
expect(user?.encryption_password).toBeNull();
|
expect(user?.encryption_password).toBeNull();
|
||||||
@ -737,7 +727,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
),
|
),
|
||||||
).toEqual(undefined);
|
).toEqual(undefined);
|
||||||
@ -750,7 +739,6 @@ describe('UsersService.createUser', () => {
|
|||||||
expect(user?.author_id).toBeNull();
|
expect(user?.author_id).toBeNull();
|
||||||
expect(user?.email_verified).toEqual(false);
|
expect(user?.email_verified).toEqual(false);
|
||||||
expect(user?.auto_renew).toEqual(autoRenew);
|
expect(user?.auto_renew).toEqual(autoRenew);
|
||||||
expect(user?.license_alert).toEqual(licenseAlert);
|
|
||||||
expect(user?.notification).toEqual(notification);
|
expect(user?.notification).toEqual(notification);
|
||||||
expect(user?.encryption).toEqual(false);
|
expect(user?.encryption).toEqual(false);
|
||||||
expect(user?.encryption_password).toBeNull();
|
expect(user?.encryption_password).toBeNull();
|
||||||
@ -817,7 +805,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -896,7 +883,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -958,7 +944,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -1018,7 +1003,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -1086,7 +1070,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email_1,
|
email_1,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -1127,7 +1110,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email_2,
|
email_2,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -1209,7 +1191,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -1284,7 +1265,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -1361,7 +1341,6 @@ describe('UsersService.createUser', () => {
|
|||||||
role,
|
role,
|
||||||
email,
|
email,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -1458,7 +1437,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test1@mail.com',
|
email: 'test1@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1475,7 +1453,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test2@mail.com',
|
email: 'test2@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1492,7 +1469,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test3@mail.com',
|
email: 'test3@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1571,7 +1547,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test1@mail.com',
|
email: 'test1@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1590,7 +1565,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test2@mail.com',
|
email: 'test2@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: true,
|
autoRenew: true,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1609,7 +1583,6 @@ describe('UsersService.getUsers', () => {
|
|||||||
email: 'test3@mail.com',
|
email: 'test3@mail.com',
|
||||||
emailVerified: true,
|
emailVerified: true,
|
||||||
autoRenew: false,
|
autoRenew: false,
|
||||||
licenseAlert: true,
|
|
||||||
notification: true,
|
notification: true,
|
||||||
encryption: false,
|
encryption: false,
|
||||||
prompt: false,
|
prompt: false,
|
||||||
@ -1927,7 +1900,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
undefined,
|
undefined,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
@ -1940,7 +1912,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.NONE);
|
expect(createdUser?.role).toBe(USER_ROLES.NONE);
|
||||||
expect(createdUser?.author_id).toBeNull();
|
expect(createdUser?.author_id).toBeNull();
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(false);
|
expect(createdUser?.encryption).toBe(false);
|
||||||
expect(createdUser?.encryption_password).toBeNull();
|
expect(createdUser?.encryption_password).toBeNull();
|
||||||
@ -1987,7 +1958,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
undefined,
|
undefined,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
@ -2000,7 +1970,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
||||||
expect(createdUser?.author_id).toBeNull();
|
expect(createdUser?.author_id).toBeNull();
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(false);
|
expect(createdUser?.encryption).toBe(false);
|
||||||
expect(createdUser?.encryption_password).toBeNull();
|
expect(createdUser?.encryption_password).toBeNull();
|
||||||
@ -2047,7 +2016,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
'AUTHOR_ID',
|
'AUTHOR_ID',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
'new_password',
|
'new_password',
|
||||||
true,
|
true,
|
||||||
@ -2060,7 +2028,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(true);
|
expect(createdUser?.encryption).toBe(true);
|
||||||
expect(createdUser?.encryption_password).toBe('new_password');
|
expect(createdUser?.encryption_password).toBe('new_password');
|
||||||
@ -2107,7 +2074,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
undefined,
|
undefined,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
@ -2120,7 +2086,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
||||||
expect(createdUser?.author_id).toBeNull();
|
expect(createdUser?.author_id).toBeNull();
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(false);
|
expect(createdUser?.encryption).toBe(false);
|
||||||
expect(createdUser?.encryption_password).toBeNull();
|
expect(createdUser?.encryption_password).toBeNull();
|
||||||
@ -2168,7 +2133,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
undefined,
|
undefined,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
@ -2180,7 +2144,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(false);
|
expect(createdUser?.encryption).toBe(false);
|
||||||
expect(createdUser?.encryption_password).toBeNull();
|
expect(createdUser?.encryption_password).toBeNull();
|
||||||
@ -2227,7 +2190,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
undefined,
|
undefined,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
@ -2277,7 +2239,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
'AUTHOR_ID',
|
'AUTHOR_ID',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true,
|
||||||
@ -2290,7 +2251,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(true);
|
expect(createdUser?.encryption).toBe(true);
|
||||||
expect(createdUser?.encryption_password).toBe('password');
|
expect(createdUser?.encryption_password).toBe('password');
|
||||||
@ -2338,7 +2298,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
'password',
|
'password',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@ -2350,7 +2309,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||||
expect(createdUser?.auto_renew).toBe(false);
|
expect(createdUser?.auto_renew).toBe(false);
|
||||||
expect(createdUser?.license_alert).toBe(false);
|
|
||||||
expect(createdUser?.notification).toBe(false);
|
expect(createdUser?.notification).toBe(false);
|
||||||
expect(createdUser?.encryption).toBe(false);
|
expect(createdUser?.encryption).toBe(false);
|
||||||
expect(createdUser?.encryption_password).toBeNull();
|
expect(createdUser?.encryption_password).toBeNull();
|
||||||
@ -2397,7 +2355,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
'AUTHOR_ID',
|
'AUTHOR_ID',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true,
|
||||||
@ -2458,7 +2415,6 @@ describe('UsersService.updateUser', () => {
|
|||||||
'AUTHOR_ID2',
|
'AUTHOR_ID2',
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
true,
|
true,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true,
|
||||||
|
|||||||
@ -148,18 +148,18 @@ export class UsersService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates user
|
* Creates user
|
||||||
* @param accessToken
|
* @param context
|
||||||
|
* @param externalId
|
||||||
* @param name
|
* @param name
|
||||||
* @param role
|
* @param role
|
||||||
* @param email
|
* @param email
|
||||||
* @param autoRenew
|
* @param autoRenew
|
||||||
* @param licenseAlert
|
|
||||||
* @param notification
|
* @param notification
|
||||||
* @param [authorId]
|
* @param [authorId]
|
||||||
* @param [encryption]
|
* @param [encryption]
|
||||||
* @param [encryptionPassword]
|
* @param [encryptionPassword]
|
||||||
* @param [prompt]
|
* @param [prompt]
|
||||||
* @returns void
|
* @returns user
|
||||||
*/
|
*/
|
||||||
async createUser(
|
async createUser(
|
||||||
context: Context,
|
context: Context,
|
||||||
@ -168,7 +168,6 @@ export class UsersService {
|
|||||||
role: UserRoles,
|
role: UserRoles,
|
||||||
email: string,
|
email: string,
|
||||||
autoRenew: boolean,
|
autoRenew: boolean,
|
||||||
licenseAlert: boolean,
|
|
||||||
notification: boolean,
|
notification: boolean,
|
||||||
authorId?: string | undefined,
|
authorId?: string | undefined,
|
||||||
encryption?: boolean | undefined,
|
encryption?: boolean | undefined,
|
||||||
@ -180,7 +179,6 @@ export class UsersService {
|
|||||||
`externalId: ${externalId}, ` +
|
`externalId: ${externalId}, ` +
|
||||||
`role: ${role}, ` +
|
`role: ${role}, ` +
|
||||||
`autoRenew: ${autoRenew}, ` +
|
`autoRenew: ${autoRenew}, ` +
|
||||||
`licenseAlert: ${licenseAlert}, ` +
|
|
||||||
`notification: ${notification}, ` +
|
`notification: ${notification}, ` +
|
||||||
`authorId: ${authorId}, ` +
|
`authorId: ${authorId}, ` +
|
||||||
`encryption: ${encryption}, ` +
|
`encryption: ${encryption}, ` +
|
||||||
@ -272,7 +270,6 @@ export class UsersService {
|
|||||||
accountId,
|
accountId,
|
||||||
externalUser.sub,
|
externalUser.sub,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
authorId,
|
authorId,
|
||||||
encryption,
|
encryption,
|
||||||
@ -408,7 +405,6 @@ export class UsersService {
|
|||||||
accountId: number,
|
accountId: number,
|
||||||
externalId: string,
|
externalId: string,
|
||||||
autoRenew: boolean,
|
autoRenew: boolean,
|
||||||
licenseAlert: boolean,
|
|
||||||
notification: boolean,
|
notification: boolean,
|
||||||
authorId?: string | undefined,
|
authorId?: string | undefined,
|
||||||
encryption?: boolean | undefined,
|
encryption?: boolean | undefined,
|
||||||
@ -424,7 +420,6 @@ export class UsersService {
|
|||||||
`authorId: ${authorId}, ` +
|
`authorId: ${authorId}, ` +
|
||||||
`externalId: ${externalId}, ` +
|
`externalId: ${externalId}, ` +
|
||||||
`autoRenew: ${autoRenew}, ` +
|
`autoRenew: ${autoRenew}, ` +
|
||||||
`licenseAlert: ${licenseAlert}, ` +
|
|
||||||
`notification: ${notification}, ` +
|
`notification: ${notification}, ` +
|
||||||
`authorId: ${authorId}, ` +
|
`authorId: ${authorId}, ` +
|
||||||
`encryption: ${encryption}, ` +
|
`encryption: ${encryption}, ` +
|
||||||
@ -438,7 +433,6 @@ export class UsersService {
|
|||||||
account_id: accountId,
|
account_id: accountId,
|
||||||
external_id: externalId,
|
external_id: externalId,
|
||||||
auto_renew: autoRenew,
|
auto_renew: autoRenew,
|
||||||
license_alert: licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
role,
|
role,
|
||||||
accepted_dpa_version: null,
|
accepted_dpa_version: null,
|
||||||
@ -454,7 +448,6 @@ export class UsersService {
|
|||||||
account_id: accountId,
|
account_id: accountId,
|
||||||
external_id: externalId,
|
external_id: externalId,
|
||||||
auto_renew: autoRenew,
|
auto_renew: autoRenew,
|
||||||
license_alert: licenseAlert,
|
|
||||||
notification,
|
notification,
|
||||||
role,
|
role,
|
||||||
author_id: authorId ?? null,
|
author_id: authorId ?? null,
|
||||||
@ -671,7 +664,6 @@ export class UsersService {
|
|||||||
email: mail,
|
email: mail,
|
||||||
emailVerified: dbUser.email_verified,
|
emailVerified: dbUser.email_verified,
|
||||||
autoRenew: dbUser.auto_renew,
|
autoRenew: dbUser.auto_renew,
|
||||||
licenseAlert: dbUser.license_alert,
|
|
||||||
notification: dbUser.notification,
|
notification: dbUser.notification,
|
||||||
encryption: dbUser.encryption,
|
encryption: dbUser.encryption,
|
||||||
prompt: dbUser.prompt,
|
prompt: dbUser.prompt,
|
||||||
@ -901,14 +893,13 @@ export class UsersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指定したユーザーの情報を更新します
|
* Updates user
|
||||||
* @param context
|
* @param context
|
||||||
* @param extarnalId
|
* @param extarnalId
|
||||||
* @param id
|
* @param id
|
||||||
* @param role
|
* @param role
|
||||||
* @param authorId
|
* @param authorId
|
||||||
* @param autoRenew
|
* @param autoRenew
|
||||||
* @param licenseAlart
|
|
||||||
* @param notification
|
* @param notification
|
||||||
* @param encryption
|
* @param encryption
|
||||||
* @param encryptionPassword
|
* @param encryptionPassword
|
||||||
@ -922,7 +913,6 @@ export class UsersService {
|
|||||||
role: string,
|
role: string,
|
||||||
authorId: string | undefined,
|
authorId: string | undefined,
|
||||||
autoRenew: boolean,
|
autoRenew: boolean,
|
||||||
licenseAlart: boolean,
|
|
||||||
notification: boolean,
|
notification: boolean,
|
||||||
encryption: boolean | undefined,
|
encryption: boolean | undefined,
|
||||||
encryptionPassword: string | undefined,
|
encryptionPassword: string | undefined,
|
||||||
@ -938,7 +928,6 @@ export class UsersService {
|
|||||||
`role: ${role}, ` +
|
`role: ${role}, ` +
|
||||||
`authorId: ${authorId}, ` +
|
`authorId: ${authorId}, ` +
|
||||||
`autoRenew: ${autoRenew}, ` +
|
`autoRenew: ${autoRenew}, ` +
|
||||||
`licenseAlart: ${licenseAlart}, ` +
|
|
||||||
`notification: ${notification}, ` +
|
`notification: ${notification}, ` +
|
||||||
`encryption: ${encryption}, ` +
|
`encryption: ${encryption}, ` +
|
||||||
`prompt: ${prompt} }`,
|
`prompt: ${prompt} }`,
|
||||||
@ -957,7 +946,6 @@ export class UsersService {
|
|||||||
role,
|
role,
|
||||||
authorId,
|
authorId,
|
||||||
autoRenew,
|
autoRenew,
|
||||||
licenseAlart,
|
|
||||||
notification,
|
notification,
|
||||||
encryption,
|
encryption,
|
||||||
encryptionPassword,
|
encryptionPassword,
|
||||||
|
|||||||
@ -59,7 +59,11 @@ import {
|
|||||||
deleteEntity,
|
deleteEntity,
|
||||||
} from '../../common/repository';
|
} from '../../common/repository';
|
||||||
import { Context } from '../../common/log';
|
import { Context } from '../../common/log';
|
||||||
import { LicenseSummaryInfo, PartnerInfoFromDb, PartnerLicenseInfoForRepository } from '../../features/accounts/types/types';
|
import {
|
||||||
|
LicenseSummaryInfo,
|
||||||
|
PartnerInfoFromDb,
|
||||||
|
PartnerLicenseInfoForRepository,
|
||||||
|
} from '../../features/accounts/types/types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AccountsRepositoryService {
|
export class AccountsRepositoryService {
|
||||||
|
|||||||
@ -46,9 +46,6 @@ export class User {
|
|||||||
@Column({ default: true })
|
@Column({ default: true })
|
||||||
auto_renew: boolean;
|
auto_renew: boolean;
|
||||||
|
|
||||||
@Column({ default: true })
|
|
||||||
license_alert: boolean;
|
|
||||||
|
|
||||||
@Column({ default: true })
|
@Column({ default: true })
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
|
|
||||||
@ -127,9 +124,6 @@ export class UserArchive {
|
|||||||
@Column()
|
@Column()
|
||||||
auto_renew: boolean;
|
auto_renew: boolean;
|
||||||
|
|
||||||
@Column()
|
|
||||||
license_alert: boolean;
|
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
notification: boolean;
|
notification: boolean;
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,6 @@ export class UsersRepositoryService {
|
|||||||
external_id: externalUserId,
|
external_id: externalUserId,
|
||||||
role,
|
role,
|
||||||
auto_renew,
|
auto_renew,
|
||||||
license_alert,
|
|
||||||
notification,
|
notification,
|
||||||
author_id,
|
author_id,
|
||||||
accepted_eula_version,
|
accepted_eula_version,
|
||||||
@ -82,7 +81,6 @@ export class UsersRepositoryService {
|
|||||||
userEntity.account_id = accountId;
|
userEntity.account_id = accountId;
|
||||||
userEntity.external_id = externalUserId;
|
userEntity.external_id = externalUserId;
|
||||||
userEntity.auto_renew = auto_renew;
|
userEntity.auto_renew = auto_renew;
|
||||||
userEntity.license_alert = license_alert;
|
|
||||||
userEntity.notification = notification;
|
userEntity.notification = notification;
|
||||||
userEntity.author_id = author_id;
|
userEntity.author_id = author_id;
|
||||||
userEntity.accepted_eula_version = accepted_eula_version;
|
userEntity.accepted_eula_version = accepted_eula_version;
|
||||||
@ -278,7 +276,6 @@ export class UsersRepositoryService {
|
|||||||
role: string,
|
role: string,
|
||||||
authorId: string | undefined,
|
authorId: string | undefined,
|
||||||
autoRenew: boolean,
|
autoRenew: boolean,
|
||||||
licenseAlart: boolean,
|
|
||||||
notification: boolean,
|
notification: boolean,
|
||||||
encryption: boolean | undefined,
|
encryption: boolean | undefined,
|
||||||
encryptionPassword: string | undefined,
|
encryptionPassword: string | undefined,
|
||||||
@ -345,7 +342,6 @@ export class UsersRepositoryService {
|
|||||||
// 共通項目を更新
|
// 共通項目を更新
|
||||||
targetUser.role = role;
|
targetUser.role = role;
|
||||||
targetUser.auto_renew = autoRenew;
|
targetUser.auto_renew = autoRenew;
|
||||||
targetUser.license_alert = licenseAlart;
|
|
||||||
targetUser.notification = notification;
|
targetUser.notification = notification;
|
||||||
|
|
||||||
const result = await updateEntity(
|
const result = await updateEntity(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user