diff --git a/dictation_client/src/api/api.ts b/dictation_client/src/api/api.ts index 64cc0dc..1e8b108 100644 --- a/dictation_client/src/api/api.ts +++ b/dictation_client/src/api/api.ts @@ -49,6 +49,19 @@ export interface Account { */ 'accountId': number; } +/** + * + * @export + * @interface ActivateCardLicensesRequest + */ +export interface ActivateCardLicensesRequest { + /** + * + * @type {string} + * @memberof ActivateCardLicensesRequest + */ + 'cardLicenseKey': string; +} /** * * @export @@ -426,7 +439,7 @@ export interface GetLicenseSummaryResponse { * @type {boolean} * @memberof GetLicenseSummaryResponse */ - 'isAccountLock': boolean; + 'isStorageAvailable': boolean; } /** * @@ -2034,6 +2047,46 @@ export class FilesApi extends BaseAPI { */ export const LicensesApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @summary + * @param {ActivateCardLicensesRequest} activateCardLicensesRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + activateCardLicenses: async (activateCardLicensesRequest: ActivateCardLicensesRequest, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'activateCardLicensesRequest' is not null or undefined + assertParamExists('activateCardLicenses', 'activateCardLicensesRequest', activateCardLicensesRequest) + const localVarPath = `/licenses/cards/activate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearer required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(activateCardLicensesRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @summary @@ -2124,6 +2177,17 @@ export const LicensesApiAxiosParamCreator = function (configuration?: Configurat export const LicensesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = LicensesApiAxiosParamCreator(configuration) return { + /** + * + * @summary + * @param {ActivateCardLicensesRequest} activateCardLicensesRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async activateCardLicenses(activateCardLicensesRequest: ActivateCardLicensesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.activateCardLicenses(activateCardLicensesRequest, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @summary @@ -2156,6 +2220,16 @@ export const LicensesApiFp = function(configuration?: Configuration) { export const LicensesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = LicensesApiFp(configuration) return { + /** + * + * @summary + * @param {ActivateCardLicensesRequest} activateCardLicensesRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + activateCardLicenses(activateCardLicensesRequest: ActivateCardLicensesRequest, options?: any): AxiosPromise { + return localVarFp.activateCardLicenses(activateCardLicensesRequest, options).then((request) => request(axios, basePath)); + }, /** * * @summary @@ -2186,6 +2260,18 @@ export const LicensesApiFactory = function (configuration?: Configuration, baseP * @extends {BaseAPI} */ export class LicensesApi extends BaseAPI { + /** + * + * @summary + * @param {ActivateCardLicensesRequest} activateCardLicensesRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LicensesApi + */ + public activateCardLicenses(activateCardLicensesRequest: ActivateCardLicensesRequest, options?: AxiosRequestConfig) { + return LicensesApiFp(this.configuration).activateCardLicenses(activateCardLicensesRequest, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @summary diff --git a/dictation_client/src/assets/images/block.svg b/dictation_client/src/assets/images/block.svg new file mode 100644 index 0000000..7a1f8ef --- /dev/null +++ b/dictation_client/src/assets/images/block.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/dictation_client/src/features/license/licenseSummary/licenseSummarySlice.ts b/dictation_client/src/features/license/licenseSummary/licenseSummarySlice.ts index 82cfadf..3888909 100644 --- a/dictation_client/src/features/license/licenseSummary/licenseSummarySlice.ts +++ b/dictation_client/src/features/license/licenseSummary/licenseSummarySlice.ts @@ -14,7 +14,7 @@ const initialState: LicenseSummaryState = { shortage: 0, storageSize: 0, usedSize: 0, - isAccountLock: false, + isStorageAvailable: false, }, apps: { isLoading: false, diff --git a/dictation_client/src/features/license/licenseSummary/state.ts b/dictation_client/src/features/license/licenseSummary/state.ts index 4a0d07f..6402581 100644 --- a/dictation_client/src/features/license/licenseSummary/state.ts +++ b/dictation_client/src/features/license/licenseSummary/state.ts @@ -14,7 +14,7 @@ export interface Domain { shortage: number; storageSize: number; usedSize: number; - isAccountLock: boolean; + isStorageAvailable: boolean; } export interface Apps { diff --git a/dictation_client/src/pages/LicensePage/licenseSummary.tsx b/dictation_client/src/pages/LicensePage/licenseSummary.tsx index 9d0d129..bf3bfa1 100644 --- a/dictation_client/src/pages/LicensePage/licenseSummary.tsx +++ b/dictation_client/src/pages/LicensePage/licenseSummary.tsx @@ -14,8 +14,8 @@ import { import postAdd from "../../assets/images/post_add.svg"; import history from "../../assets/images/history.svg"; import key from "../../assets/images/key.svg"; -import lock from "../../assets/images/lock.svg"; -import lockOpen from "../../assets/images/lock_open.svg"; +import block from "../../assets/images/block.svg"; +import circle from "../../assets/images/circle.svg"; import { LicenseOrderPopup } from "./licenseOrderPopup"; import { CardLicenseActivatePopup } from "./cardLicenseActivatePopup"; @@ -188,19 +188,17 @@ const LicenseSummary: React.FC = (): JSX.Element => {
{licenseSummaryInfo.usedSize}GB
{t( - getTranslationID("LicenseSummaryPage.label.accountLock") + getTranslationID( + "LicenseSummaryPage.label.storageAvailable" + ) )}
- {licenseSummaryInfo.isAccountLock && ( - + {licenseSummaryInfo.isStorageAvailable && ( + )} - {!licenseSummaryInfo.isAccountLock && ( - + {!licenseSummaryInfo.isStorageAvailable && ( + )}
diff --git a/dictation_client/src/styles/app.module.scss b/dictation_client/src/styles/app.module.scss index 6545500..fd3c27c 100644 --- a/dictation_client/src/styles/app.module.scss +++ b/dictation_client/src/styles/app.module.scss @@ -1493,12 +1493,12 @@ tr.isSelected .menuInTable li a { vertical-align: bottom; } -.license .listVertical dd img[src*="circle.svg"] { +.license .listVertical dd img[src*="circle"] { filter: brightness(0) saturate(100%) invert(58%) sepia(41%) saturate(5814%) hue-rotate(143deg) brightness(96%) contrast(101%); } -.license .listVertical dd img[src*="block.svg"] { +.license .listVertical dd img[src*="block"] { filter: brightness(0) saturate(100%) invert(45%) sepia(77%) saturate(2633%) hue-rotate(340deg) brightness(102%) contrast(101%); } diff --git a/dictation_client/src/translation/de.json b/dictation_client/src/translation/de.json index dbd6bef..42dc3b5 100644 --- a/dictation_client/src/translation/de.json +++ b/dictation_client/src/translation/de.json @@ -152,7 +152,7 @@ "shortage": "(de)Shortage", "storageSize": "(de)Storage Size", "usedSize": "(de)Used Size", - "accountLock": "(de)Account Lock" + "storageAvailable": "(de)Storage Available" } }, "licenseOrderPage": { diff --git a/dictation_client/src/translation/en.json b/dictation_client/src/translation/en.json index e5d040d..a7f3f7b 100644 --- a/dictation_client/src/translation/en.json +++ b/dictation_client/src/translation/en.json @@ -152,7 +152,7 @@ "shortage": "Shortage", "storageSize": "Storage Size", "usedSize": "Used Size", - "accountLock": "Account Lock" + "storageAvailable": "Storage Available" } }, "licenseOrderPage": { diff --git a/dictation_client/src/translation/es.json b/dictation_client/src/translation/es.json index 69a14fc..85e871c 100644 --- a/dictation_client/src/translation/es.json +++ b/dictation_client/src/translation/es.json @@ -152,7 +152,7 @@ "shortage": "(es)Shortage", "storageSize": "(es)Storage Size", "usedSize": "(es)Used Size", - "accountLock": "(es)Account Lock" + "storageAvailable": "(es)Storage Available" } }, "licenseOrderPage": { diff --git a/dictation_client/src/translation/fr.json b/dictation_client/src/translation/fr.json index f057711..4dfaae3 100644 --- a/dictation_client/src/translation/fr.json +++ b/dictation_client/src/translation/fr.json @@ -152,7 +152,7 @@ "shortage": "(fr)Shortage", "storageSize": "(fr)Storage Size", "usedSize": "(fr)Used Size", - "accountLock": "(fr)Account Lock" + "storageAvailable": "(fr)Storage Available" } }, "licenseOrderPage": { diff --git a/dictation_server/src/api/odms/openapi.json b/dictation_server/src/api/odms/openapi.json index 845329c..8ed0a96 100644 --- a/dictation_server/src/api/odms/openapi.json +++ b/dictation_server/src/api/odms/openapi.json @@ -1681,7 +1681,7 @@ "shortage": { "type": "number" }, "storageSize": { "type": "number" }, "usedSize": { "type": "number" }, - "isAccountLock": { "type": "boolean" } + "isStorageAvailable": { "type": "boolean" } }, "required": [ "totalLicense", @@ -1694,7 +1694,7 @@ "shortage", "storageSize", "usedSize", - "isAccountLock" + "isStorageAvailable" ] }, "Account": { diff --git a/dictation_server/src/features/accounts/accounts.service.spec.ts b/dictation_server/src/features/accounts/accounts.service.spec.ts index 636e023..c315cc8 100644 --- a/dictation_server/src/features/accounts/accounts.service.spec.ts +++ b/dictation_server/src/features/accounts/accounts.service.spec.ts @@ -212,7 +212,7 @@ const expectedAccountLisenceCounts = { shortage: 0, storageSize: 0, usedSize: 0, - isAccountLock: false, + isStorageAvailable: false, }; const userInfo = { diff --git a/dictation_server/src/features/accounts/accounts.service.ts b/dictation_server/src/features/accounts/accounts.service.ts index 4eeffd7..2a1ffa1 100644 --- a/dictation_server/src/features/accounts/accounts.service.ts +++ b/dictation_server/src/features/accounts/accounts.service.ts @@ -51,7 +51,7 @@ export class AccountsService { // システム上有効期限日付の23時59分59秒999ミリ秒までライセンスは有効なため、各値最大値をセット expiringSoonDate.setHours(23, 59, 59, 999); - const { licenseSummary, isAccountLock } = + const { licenseSummary, isStorageAvailable } = await this.accountRepository.getLicenseSummaryInfo( accountId, currentDate, @@ -83,7 +83,7 @@ export class AccountsService { storageSize: 0, // XXX PBI1201対象外 usedSize: 0, // XXX PBI1201対象外 shortage, - isAccountLock, + isStorageAvailable, }; return licenseSummaryResponse; } catch (e) { diff --git a/dictation_server/src/features/accounts/test/accounts.service.mock.ts b/dictation_server/src/features/accounts/test/accounts.service.mock.ts index 42d4565..4100f78 100644 --- a/dictation_server/src/features/accounts/test/accounts.service.mock.ts +++ b/dictation_server/src/features/accounts/test/accounts.service.mock.ts @@ -36,7 +36,7 @@ export type SendGridMockValue = { export type AccountsRepositoryMockValue = { getLicenseSummaryInfo: { licenseSummary: LicenseSummaryInfo; - isAccountLock: boolean; + isStorageAvailable: boolean; }; }; export const makeAccountsServiceMock = async ( @@ -86,7 +86,7 @@ export const makeAccountsRepositoryMock = ( .fn< Promise<{ licenseSummary: LicenseSummaryInfo; - isAccountLock: boolean; + isStorageAvailable: boolean; }>, [] >() @@ -173,7 +173,7 @@ export const makeDefaultAccountsRepositoryMockValue = return { getLicenseSummaryInfo: { licenseSummary: licenseSummaryInfo, - isAccountLock: false, + isStorageAvailable: false, }, }; }; diff --git a/dictation_server/src/features/accounts/types/types.ts b/dictation_server/src/features/accounts/types/types.ts index 90fa518..f7dd877 100644 --- a/dictation_server/src/features/accounts/types/types.ts +++ b/dictation_server/src/features/accounts/types/types.ts @@ -75,7 +75,7 @@ export class GetLicenseSummaryResponse { usedSize: number; @ApiProperty() - isAccountLock: boolean; + isStorageAvailable: boolean; } export class Account { diff --git a/dictation_server/src/repositories/accounts/accounts.repository.service.ts b/dictation_server/src/repositories/accounts/accounts.repository.service.ts index 5d26257..8e5a2fd 100644 --- a/dictation_server/src/repositories/accounts/accounts.repository.service.ts +++ b/dictation_server/src/repositories/accounts/accounts.repository.service.ts @@ -174,7 +174,7 @@ export class AccountsRepositoryService { id: number, currentDate: Date, expiringSoonDate: Date, - ): Promise<{ licenseSummary: LicenseSummaryInfo; isAccountLock: boolean }> { + ): Promise<{ licenseSummary: LicenseSummaryInfo; isStorageAvailable: boolean }> { return await this.dataSource.transaction(async (entityManager) => { const license = entityManager.getRepository(License); const licenseOrder = entityManager.getRepository(LicenseOrder); @@ -271,7 +271,7 @@ export class AccountsRepositoryService { }); // アカウントのロック状態を取得する - const isAccountLock = (await this.findAccountById(id)).locked; + const isStorageAvailable = (await this.findAccountById(id)).locked; let licenseSummary = new LicenseSummaryInfo(); licenseSummary = { @@ -284,7 +284,7 @@ export class AccountsRepositoryService { issueRequesting: issueRequesting, numberOfRequesting: numberOfRequesting, }; - return { licenseSummary: licenseSummary, isAccountLock }; + return { licenseSummary: licenseSummary, isStorageAvailable }; }); } }