Compare commits
No commits in common. "main" and "release-2024-05-27-1" have entirely different histories.
main
...
release-20
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
||||
environment_building_tools/logfile.log
|
||||
@ -1,312 +0,0 @@
|
||||
# Pipeline側でKeyVaultやDocker、AppService等に対する操作権限を持ったServiceConenctionを作成しておくこと
|
||||
# また、環境変数 STATIC_DICTATION_DEPLOYMENT_TOKEN の値として静的WebAppsのデプロイトークンを設定しておくこと
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- release-ccb
|
||||
tags:
|
||||
include:
|
||||
- stage-*
|
||||
|
||||
jobs:
|
||||
- job: initialize
|
||||
displayName: Initialize
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
persistCredentials: true
|
||||
- script: |
|
||||
git fetch origin release-ccb:release-ccb
|
||||
if git merge-base --is-ancestor $(Build.SourceVersion) release-ccb; then
|
||||
echo "This commit is in the release-ccb branch."
|
||||
else
|
||||
echo "This commit is not in the release-ccb branch."
|
||||
exit 1
|
||||
fi
|
||||
displayName: 'タグが付けられたCommitがrelease-ccbブランチに存在するか確認'
|
||||
- job: backend_test
|
||||
dependsOn: initialize
|
||||
condition: succeeded('initialize')
|
||||
displayName: UnitTest
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_server/.devcontainer
|
||||
script: |
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_server sudo npm ci
|
||||
docker-compose exec -T dictation_server sudo npm run migrate:up:test
|
||||
docker-compose exec -T dictation_server sudo npm run test
|
||||
- job: backend_build
|
||||
dependsOn: backend_test
|
||||
condition: succeeded('backend_test')
|
||||
displayName: Build And Push Backend Image
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_server
|
||||
verbose: false
|
||||
- task: Docker@0
|
||||
displayName: build
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
dockerFile: DockerfileServerDictation.dockerfile
|
||||
imageName: odmscloud/staging/dictation:$(Build.SourceVersion)
|
||||
buildArguments: |
|
||||
BUILD_VERSION=$(Build.SourceVersion)
|
||||
- task: Docker@0
|
||||
displayName: push
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
action: Push an image
|
||||
imageName: odmscloud/staging/dictation:$(Build.SourceVersion)
|
||||
- job: frontend_build_staging
|
||||
dependsOn: backend_build
|
||||
condition: succeeded('backend_build')
|
||||
displayName: Build Frontend Files(staging)
|
||||
variables:
|
||||
storageAccountName: saomdspipeline
|
||||
environment: staging
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_client
|
||||
verbose: false
|
||||
- task: Bash@3
|
||||
displayName: Bash Script
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: cd dictation_client && npm run build:stg
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: dictation_client/build
|
||||
includeRootFolder: false
|
||||
archiveType: 'zip'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip'
|
||||
replaceExistingArchive: true
|
||||
- task: AzureCLI@2
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
scriptType: 'bash'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
az storage blob upload \
|
||||
--auth-mode login \
|
||||
--account-name $(storageAccountName) \
|
||||
--container-name $(environment) \
|
||||
--name $(Build.SourceVersion).zip \
|
||||
--type block \
|
||||
--overwrite \
|
||||
--file $(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip
|
||||
- job: function_test
|
||||
dependsOn: frontend_build_staging
|
||||
condition: succeeded('frontend_build_staging')
|
||||
displayName: UnitTest
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_function/.devcontainer
|
||||
script: |
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_function sudo npm ci
|
||||
docker-compose exec -T dictation_function sudo npm run test
|
||||
- job: function_build
|
||||
dependsOn: function_test
|
||||
condition: succeeded('function_test')
|
||||
displayName: Build And Push Function Image
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_function
|
||||
verbose: false
|
||||
- task: Docker@0
|
||||
displayName: build
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
dockerFile: DockerfileFunctionDictation.dockerfile
|
||||
imageName: odmscloud/staging/dictation_function:$(Build.SourceVersion)
|
||||
buildArguments: |
|
||||
BUILD_VERSION=$(Build.SourceVersion)
|
||||
- task: Docker@0
|
||||
displayName: push
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
action: Push an image
|
||||
imageName: odmscloud/staging/dictation_function:$(Build.SourceVersion)
|
||||
- job: backend_deploy
|
||||
dependsOn: function_build
|
||||
condition: succeeded('function_build')
|
||||
displayName: Backend Deploy
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureWebAppContainer@1
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
appName: 'app-odms-dictation-stg'
|
||||
deployToSlotOrASE: true
|
||||
resourceGroupName: 'stg-application-rg'
|
||||
slotName: 'staging'
|
||||
containers: 'crodmsregistrymaintenance.azurecr.io/odmscloud/staging/dictation:$(Build.SourceVersion)'
|
||||
- job: frontend_deploy
|
||||
dependsOn: backend_deploy
|
||||
condition: succeeded('backend_deploy')
|
||||
displayName: Deploy Frontend Files
|
||||
variables:
|
||||
storageAccountName: saomdspipeline
|
||||
environment: staging
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureCLI@2
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
scriptType: 'bash'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
az storage blob download \
|
||||
--auth-mode login \
|
||||
--account-name $(storageAccountName) \
|
||||
--container-name $(environment) \
|
||||
--name $(Build.SourceVersion).zip \
|
||||
--file $(Build.SourcesDirectory)/$(Build.SourceVersion).zip
|
||||
- task: Bash@3
|
||||
displayName: Bash Script
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: unzip $(Build.SourcesDirectory)/$(Build.SourceVersion).zip -d $(Build.SourcesDirectory)/$(Build.SourceVersion)
|
||||
- task: AzureStaticWebApp@0
|
||||
displayName: 'Static Web App: '
|
||||
inputs:
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
app_location: '/$(Build.SourceVersion)'
|
||||
config_file_location: /dictation_client
|
||||
skip_app_build: true
|
||||
skip_api_build: true
|
||||
is_static_export: false
|
||||
verbose: false
|
||||
azure_static_web_apps_api_token: $(STATIC_DICTATION_DEPLOYMENT_TOKEN)
|
||||
- job: function_deploy
|
||||
dependsOn: frontend_deploy
|
||||
condition: succeeded('frontend_deploy')
|
||||
displayName: Function Deploy
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureFunctionAppContainer@1
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
appName: 'func-odms-dictation-stg'
|
||||
imageName: 'crodmsregistrymaintenance.azurecr.io/odmscloud/staging/dictation_function:$(Build.SourceVersion)'
|
||||
- job: smoke_test
|
||||
dependsOn: function_deploy
|
||||
condition: succeeded('function_deploy')
|
||||
displayName: 'smoke test'
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
# スモークテスト用にjobを確保
|
||||
- job: swap_slot
|
||||
dependsOn: smoke_test
|
||||
condition: succeeded('smoke_test')
|
||||
displayName: 'Swap Staging and Production'
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureAppServiceManage@0
|
||||
displayName: 'Azure App Service Manage: app-odms-dictation-stg'
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
action: 'Swap Slots'
|
||||
WebAppName: 'app-odms-dictation-stg'
|
||||
ResourceGroupName: 'stg-application-rg'
|
||||
SourceSlot: 'staging'
|
||||
SwapWithProduction: true
|
||||
- job: migration
|
||||
dependsOn: swap_slot
|
||||
condition: succeeded('swap_slot')
|
||||
displayName: DB migration
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureKeyVault@2
|
||||
displayName: 'Azure Key Vault: kv-odms-secret-stg'
|
||||
inputs:
|
||||
ConnectedServiceName: 'omds-service-connection-stg'
|
||||
KeyVaultName: kv-odms-secret-stg
|
||||
- task: CmdLine@2
|
||||
displayName: migration
|
||||
inputs:
|
||||
script: >2
|
||||
# DB接続情報書き換え
|
||||
sed -i -e "s/DB_NAME_CCB/$(db-name-ccb)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_PASS/$(admin-db-pass)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_USERNAME/$(admin-db-user)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_PORT/$(db-port)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_HOST/$(db-host)/g" ./dictation_server/db/dbconfig.yml
|
||||
sql-migrate --version
|
||||
cat ./dictation_server/db/dbconfig.yml
|
||||
# migration実行
|
||||
sql-migrate up -config=./dictation_server/db/dbconfig.yml -env=ci_ccb
|
||||
@ -1,363 +0,0 @@
|
||||
# Pipeline側でKeyVaultやDocker、AppService等に対する操作権限を持ったServiceConnectionを作成しておくこと
|
||||
# また、環境変数 STATIC_DICTATION_DEPLOYMENT_TOKEN の値として静的WebAppsのデプロイトークンを設定しておくこと
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- release-ph1-enhance
|
||||
tags:
|
||||
include:
|
||||
- stage-*
|
||||
|
||||
jobs:
|
||||
- job: initialize
|
||||
displayName: Initialize
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
persistCredentials: true
|
||||
- script: |
|
||||
git fetch origin release-ph1-enhance:release-ph1-enhance
|
||||
if git merge-base --is-ancestor $(Build.SourceVersion) release-ph1-enhance; then
|
||||
echo "This commit is in the release-ph1-enhance branch."
|
||||
else
|
||||
echo "This commit is not in the release-ph1-enhance branch."
|
||||
exit 1
|
||||
fi
|
||||
displayName: 'タグが付けられたCommitがrelease-ph1-enhanceブランチに存在するか確認'
|
||||
- job: backend_test
|
||||
dependsOn: initialize
|
||||
condition: succeeded('initialize')
|
||||
displayName: UnitTest
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_server/.devcontainer
|
||||
script: |
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
docker-compose --version
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_server sudo npm ci
|
||||
docker-compose exec -T dictation_server sudo npm run migrate:up:test
|
||||
docker-compose exec -T dictation_server sudo npm run test
|
||||
- job: backend_build
|
||||
dependsOn: backend_test
|
||||
condition: succeeded('backend_test')
|
||||
displayName: Build And Push Backend Image
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_server
|
||||
verbose: false
|
||||
- task: Docker@0
|
||||
displayName: build
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
dockerFile: DockerfileServerDictation.dockerfile
|
||||
imageName: odmscloud/staging/dictation:$(Build.SourceVersion)
|
||||
buildArguments: |
|
||||
BUILD_VERSION=$(Build.SourceVersion)
|
||||
- task: Docker@0
|
||||
displayName: push
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
action: Push an image
|
||||
imageName: odmscloud/staging/dictation:$(Build.SourceVersion)
|
||||
- job: frontend_build_staging
|
||||
dependsOn: backend_build
|
||||
condition: succeeded('backend_build')
|
||||
displayName: Build Frontend Files(staging)
|
||||
variables:
|
||||
storageAccountName: saomdspipeline
|
||||
environment: staging
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_client
|
||||
verbose: false
|
||||
- task: Bash@3
|
||||
displayName: Bash Script
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: cd dictation_client && npm run build:stg
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: dictation_client/build
|
||||
includeRootFolder: false
|
||||
archiveType: 'zip'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip'
|
||||
replaceExistingArchive: true
|
||||
- task: AzureCLI@2
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
scriptType: 'bash'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
az storage blob upload \
|
||||
--auth-mode login \
|
||||
--account-name $(storageAccountName) \
|
||||
--container-name $(environment) \
|
||||
--name $(Build.SourceVersion).zip \
|
||||
--type block \
|
||||
--overwrite \
|
||||
--file $(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip
|
||||
- job: frontend_build_production
|
||||
dependsOn: frontend_build_staging
|
||||
condition: succeeded('frontend_build_staging')
|
||||
displayName: Build Frontend Files(production)
|
||||
variables:
|
||||
storageAccountName: saomdspipeline
|
||||
environment: production
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_client
|
||||
verbose: false
|
||||
- task: Bash@3
|
||||
displayName: Bash Script
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: cd dictation_client && npm run build:prod
|
||||
- task: ArchiveFiles@2
|
||||
inputs:
|
||||
rootFolderOrFile: dictation_client/build
|
||||
includeRootFolder: false
|
||||
archiveType: 'zip'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip'
|
||||
replaceExistingArchive: true
|
||||
- task: AzureCLI@2
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
scriptType: 'bash'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
az storage blob upload \
|
||||
--auth-mode login \
|
||||
--account-name $(storageAccountName) \
|
||||
--container-name $(environment) \
|
||||
--name $(Build.SourceVersion).zip \
|
||||
--type block \
|
||||
--overwrite \
|
||||
--file $(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip
|
||||
- job: function_test
|
||||
dependsOn: frontend_build_production
|
||||
condition: succeeded('frontend_build_production')
|
||||
displayName: UnitTest
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_function/.devcontainer
|
||||
script: |
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
docker-compose --version
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_function sudo npm ci
|
||||
docker-compose exec -T dictation_function sudo npm run test
|
||||
- job: function_build
|
||||
dependsOn: function_test
|
||||
condition: succeeded('function_test')
|
||||
displayName: Build And Push Function Image
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Npm@1
|
||||
displayName: npm ci
|
||||
inputs:
|
||||
command: ci
|
||||
workingDir: dictation_function
|
||||
verbose: false
|
||||
- task: Docker@0
|
||||
displayName: build
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
dockerFile: DockerfileFunctionDictation.dockerfile
|
||||
imageName: odmscloud/staging/dictation_function:$(Build.SourceVersion)
|
||||
buildArguments: |
|
||||
BUILD_VERSION=$(Build.SourceVersion)
|
||||
- task: Docker@0
|
||||
displayName: push
|
||||
inputs:
|
||||
azureSubscriptionEndpoint: 'omds-service-connection-stg'
|
||||
azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}'
|
||||
action: Push an image
|
||||
imageName: odmscloud/staging/dictation_function:$(Build.SourceVersion)
|
||||
- job: backend_deploy
|
||||
dependsOn: function_build
|
||||
condition: succeeded('function_build')
|
||||
displayName: Backend Deploy
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureWebAppContainer@1
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
appName: 'app-odms-dictation-stg'
|
||||
deployToSlotOrASE: true
|
||||
resourceGroupName: 'stg-application-rg'
|
||||
slotName: 'staging'
|
||||
containers: 'crodmsregistrymaintenance.azurecr.io/odmscloud/staging/dictation:$(Build.SourceVersion)'
|
||||
- job: frontend_deploy
|
||||
dependsOn: backend_deploy
|
||||
condition: succeeded('backend_deploy')
|
||||
displayName: Deploy Frontend Files
|
||||
variables:
|
||||
storageAccountName: saomdspipeline
|
||||
environment: staging
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureCLI@2
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
scriptType: 'bash'
|
||||
scriptLocation: 'inlineScript'
|
||||
inlineScript: |
|
||||
az storage blob download \
|
||||
--auth-mode login \
|
||||
--account-name $(storageAccountName) \
|
||||
--container-name $(environment) \
|
||||
--name $(Build.SourceVersion).zip \
|
||||
--file $(Build.SourcesDirectory)/$(Build.SourceVersion).zip
|
||||
- task: Bash@3
|
||||
displayName: Bash Script
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: unzip $(Build.SourcesDirectory)/$(Build.SourceVersion).zip -d $(Build.SourcesDirectory)/$(Build.SourceVersion)
|
||||
- task: AzureStaticWebApp@0
|
||||
displayName: 'Static Web App: '
|
||||
inputs:
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
app_location: '/$(Build.SourceVersion)'
|
||||
config_file_location: /dictation_client
|
||||
skip_app_build: true
|
||||
skip_api_build: true
|
||||
is_static_export: false
|
||||
verbose: false
|
||||
azure_static_web_apps_api_token: $(STATIC_DICTATION_DEPLOYMENT_TOKEN)
|
||||
- job: function_deploy
|
||||
dependsOn: frontend_deploy
|
||||
condition: succeeded('frontend_deploy')
|
||||
displayName: Function Deploy
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureFunctionAppContainer@1
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
appName: 'func-odms-dictation-stg'
|
||||
imageName: 'crodmsregistrymaintenance.azurecr.io/odmscloud/staging/dictation_function:$(Build.SourceVersion)'
|
||||
- job: smoke_test
|
||||
dependsOn: function_deploy
|
||||
condition: succeeded('function_deploy')
|
||||
displayName: 'smoke test'
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
# スモークテスト用にjobを確保
|
||||
- job: swap_slot
|
||||
dependsOn: smoke_test
|
||||
condition: succeeded('smoke_test')
|
||||
displayName: 'Swap Staging and Production'
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureAppServiceManage@0
|
||||
displayName: 'Azure App Service Manage: app-odms-dictation-stg'
|
||||
inputs:
|
||||
azureSubscription: 'omds-service-connection-stg'
|
||||
action: 'Swap Slots'
|
||||
WebAppName: 'app-odms-dictation-stg'
|
||||
ResourceGroupName: 'stg-application-rg'
|
||||
SourceSlot: 'staging'
|
||||
SwapWithProduction: true
|
||||
- job: migration
|
||||
dependsOn: swap_slot
|
||||
condition: succeeded('swap_slot')
|
||||
displayName: DB migration
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: AzureKeyVault@2
|
||||
displayName: 'Azure Key Vault: kv-odms-secret-stg'
|
||||
inputs:
|
||||
ConnectedServiceName: 'omds-service-connection-stg'
|
||||
KeyVaultName: kv-odms-secret-stg
|
||||
- task: CmdLine@2
|
||||
displayName: migration
|
||||
inputs:
|
||||
script: >2
|
||||
# DB接続情報書き換え
|
||||
sed -i -e "s/DB_NAME/$(db-name-ph1-enhance)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_PASS/$(admin-db-pass)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_USERNAME/$(admin-db-user)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_PORT/$(db-port)/g" ./dictation_server/db/dbconfig.yml
|
||||
sed -i -e "s/DB_HOST/$(db-host)/g" ./dictation_server/db/dbconfig.yml
|
||||
sql-migrate --version
|
||||
cat ./dictation_server/db/dbconfig.yml
|
||||
# migration実行
|
||||
sql-migrate up -config=./dictation_server/db/dbconfig.yml -env=ci
|
||||
@ -43,14 +43,11 @@ jobs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_server/.devcontainer
|
||||
script: |
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
docker-compose --version
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_server sudo npm ci
|
||||
docker-compose exec -T dictation_server sudo npm run migrate:up:test
|
||||
docker-compose exec -T dictation_server sudo npm run test
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_server sudo npm ci
|
||||
docker-compose exec -T dictation_server sudo npm run migrate:up:test
|
||||
docker-compose exec -T dictation_server sudo npm run test
|
||||
- job: backend_build
|
||||
dependsOn: backend_test
|
||||
condition: succeeded('backend_test')
|
||||
@ -173,32 +170,9 @@ jobs:
|
||||
--type block \
|
||||
--overwrite \
|
||||
--file $(Build.ArtifactStagingDirectory)/$(Build.SourceVersion).zip
|
||||
- job: function_test
|
||||
- job: function_build
|
||||
dependsOn: frontend_build_production
|
||||
condition: succeeded('frontend_build_production')
|
||||
displayName: UnitTest
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
fetchDepth: 1
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
workingDirectory: dictation_function/.devcontainer
|
||||
script: |
|
||||
sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
docker-compose --version
|
||||
docker-compose -f pipeline-docker-compose.yml build
|
||||
docker-compose -f pipeline-docker-compose.yml up -d
|
||||
docker-compose exec -T dictation_function sudo npm ci
|
||||
docker-compose exec -T dictation_function sudo npm run test
|
||||
- job: function_build
|
||||
dependsOn: function_test
|
||||
condition: succeeded('function_test')
|
||||
displayName: Build And Push Function Image
|
||||
pool:
|
||||
name: odms-deploy-pipeline
|
||||
@ -212,6 +186,32 @@ jobs:
|
||||
command: ci
|
||||
workingDir: dictation_function
|
||||
verbose: false
|
||||
- task: AzureKeyVault@2
|
||||
displayName: 'Azure Key Vault: kv-odms-secret-stg'
|
||||
inputs:
|
||||
ConnectedServiceName: 'omds-service-connection-stg'
|
||||
KeyVaultName: kv-odms-secret-stg
|
||||
SecretsFilter: '*'
|
||||
- task: Bash@3
|
||||
displayName: Bash Script (Test)
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
cd dictation_function
|
||||
npm run test
|
||||
env:
|
||||
TENANT_NAME: xxxxxxxxxxxx
|
||||
SIGNIN_FLOW_NAME: xxxxxxxxxxxx
|
||||
ADB2C_TENANT_ID: $(adb2c-tenant-id)
|
||||
ADB2C_CLIENT_ID: $(adb2c-client-id)
|
||||
ADB2C_CLIENT_SECRET: $(adb2c-client-secret)
|
||||
ADB2C_ORIGIN: xxxxxx
|
||||
SENDGRID_API_KEY: $(sendgrid-api-key)
|
||||
MAIL_FROM: xxxxxx
|
||||
APP_DOMAIN: http://localhost:8081/
|
||||
REDIS_HOST: xxxxxxxxxxxx
|
||||
REDIS_PORT: 0
|
||||
REDIS_PASSWORD: xxxxxxxxxxxx
|
||||
- task: Docker@0
|
||||
displayName: build
|
||||
inputs:
|
||||
|
||||
@ -17,6 +17,10 @@ RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "$
|
||||
&& apt-get install default-jre -y \
|
||||
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts
|
||||
|
||||
|
||||
# Update NPM
|
||||
RUN npm install -g npm
|
||||
|
||||
# Install mob
|
||||
RUN curl -sL install.mob.sh | sh
|
||||
|
||||
|
||||
@ -27,7 +27,6 @@ module.exports = {
|
||||
rules: {
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/require-default-props": "off",
|
||||
"react/function-component-definition": [
|
||||
"error",
|
||||
{
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
||||
module.exports = {
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
};
|
||||
6034
dictation_client/package-lock.json
generated
6034
dictation_client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,8 +15,7 @@
|
||||
"typecheck": "tsc --noEmit",
|
||||
"codegen": "sh codegen.sh",
|
||||
"lint": "eslint --cache . --ext .js,.ts,.tsx",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"test": "jest"
|
||||
"lint:fix": "npm run lint -- --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/msal-browser": "^2.33.0",
|
||||
@ -26,6 +25,7 @@
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^14.2.1",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^17.0.45",
|
||||
"@types/react": "^18.0.14",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
@ -38,7 +38,6 @@
|
||||
"jwt-decode": "^3.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
"luxon": "^3.3.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-google-recaptcha-v3": "^1.10.0",
|
||||
@ -57,10 +56,8 @@
|
||||
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
||||
"@mdx-js/react": "^2.1.2",
|
||||
"@openapitools/openapi-generator-cli": "^2.5.2",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/lodash": "^4.14.191",
|
||||
"@types/luxon": "^3.2.0",
|
||||
"@types/papaparse": "^5.3.14",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/redux-mock-store": "^1.0.3",
|
||||
@ -70,18 +67,16 @@
|
||||
"babel-loader": "^8.2.5",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"jest": "^29.7.0",
|
||||
"license-checker": "^25.0.1",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier": "^2.7.1",
|
||||
"redux-mock-store": "^1.5.4",
|
||||
"sass": "^1.58.3",
|
||||
"ts-jest": "^29.1.2",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^4.1.4",
|
||||
"vite-plugin-env-compatible": "^1.1.1",
|
||||
@ -104,4 +99,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,13 +11,6 @@ import { selectSnackber } from "features/ui/selectors";
|
||||
import { closeSnackbar } from "features/ui/uiSlice";
|
||||
import { UNAUTHORIZED_TO_CONTINUE_ERROR_CODES } from "components/auth/constants";
|
||||
import { clearUserInfo } from "features/login";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
|
||||
/*
|
||||
UpdateTokenTimerをApp.tsxに移動する(2024年6月27日)
|
||||
各画面ごとにトークンの期限チェック~自動更新を行う処理を配置していたが、
|
||||
全画面で共通の処理であることと、画面遷移時にチェックのインターバルがリセットされることを考慮し、App.tsxに移動する。
|
||||
*/
|
||||
|
||||
const App = (): JSX.Element => {
|
||||
const dispatch = useDispatch();
|
||||
@ -89,7 +82,6 @@ const App = (): JSX.Element => {
|
||||
/>
|
||||
<BrowserRouter>
|
||||
<AppRouter />
|
||||
<UpdateTokenTimer />
|
||||
</BrowserRouter>
|
||||
</>
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -10,8 +10,6 @@ import licenseCardIssue from "features/license/licenseCardIssue/licenseCardIssue
|
||||
import licenseCardActivate from "features/license/licenseCardActivate/licenseCardActivateSlice";
|
||||
import licenseSummary from "features/license/licenseSummary/licenseSummarySlice";
|
||||
import partnerLicense from "features/license/partnerLicense/partnerLicenseSlice";
|
||||
import licenseTrialIssue from "features/license/licenseTrialIssue/licenseTrialIssueSlice";
|
||||
import searchPartners from "features/license/searchPartner/searchPartnerSlice";
|
||||
import dictation from "features/dictation/dictationSlice";
|
||||
import partner from "features/partner/partnerSlice";
|
||||
import licenseOrderHistory from "features/license/licenseOrderHistory/licenseOrderHistorySlice";
|
||||
@ -37,8 +35,6 @@ export const store = configureStore({
|
||||
licenseSummary,
|
||||
licenseOrderHistory,
|
||||
partnerLicense,
|
||||
licenseTrialIssue,
|
||||
searchPartners,
|
||||
dictation,
|
||||
partner,
|
||||
typistGroup,
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 28.3.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" viewBox="0 0 48 48" style="enable-background:new 0 0 48 48;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#282828;}
|
||||
</style>
|
||||
<path class="st0" d="M24.1,38l5.7-5.7l-5.7-5.6L22,28.8l2.1,2.1c-0.9,0-1.8-0.1-2.7-0.4c-0.9-0.3-1.7-0.9-2.4-1.6
|
||||
c-0.7-0.7-1.2-1.4-1.5-2.3C17.2,25.8,17,24.9,17,24c0-0.6,0.1-1.1,0.2-1.7s0.4-1.1,0.6-1.7l-2.2-2.2c-0.6,0.8-1,1.7-1.2,2.6
|
||||
C14.1,22.1,14,23,14,24c0,1.3,0.2,2.5,0.8,3.8C15.2,29,16,30.1,17,31s2,1.7,3.2,2.2c1.2,0.5,2.4,0.7,3.7,0.8L22,35.9L24.1,38z
|
||||
M32.4,29.5c0.6-0.8,1-1.7,1.2-2.6C33.9,25.9,34,25,34,24c0-1.3-0.2-2.5-0.7-3.8s-1.2-2.4-2.2-3.3s-2.1-1.7-3.3-2.2
|
||||
c-1.2-0.5-2.5-0.7-3.7-0.7l1.9-1.9L23.9,10l-5.7,5.7l5.7,5.6l2.1-2.1L23.8,17c0.9,0,1.8,0.2,2.8,0.5s1.7,0.9,2.4,1.5
|
||||
s1.2,1.4,1.5,2.3c0.4,0.9,0.5,1.7,0.5,2.6c0,0.6-0.1,1.1-0.2,1.7c-0.1,0.6-0.4,1.1-0.6,1.6L32.4,29.5z M24,44
|
||||
c-2.7,0-5.3-0.5-7.8-1.6s-4.6-2.5-6.4-4.3s-3.2-3.9-4.3-6.4S4,26.7,4,24c0-2.8,0.5-5.4,1.6-7.8s2.5-4.5,4.3-6.3s3.9-3.2,6.4-4.3
|
||||
S21.3,4,24,4c2.8,0,5.4,0.5,7.8,1.6s4.6,2.5,6.4,4.3s3.2,3.9,4.3,6.3c1.1,2.4,1.6,5,1.6,7.8c0,2.7-0.5,5.3-1.6,7.8
|
||||
c-1,2.4-2.5,4.6-4.3,6.4s-3.9,3.2-6.4,4.3S26.8,44,24,44z M24,41c4.7,0,8.8-1.7,12-5c3.3-3.3,5-7.3,5-12c0-4.7-1.6-8.8-5-12.1
|
||||
c-3.3-3.3-7.3-5-12-5c-4.7,0-8.7,1.7-12,5S7,19.3,7,24c0,4.7,1.7,8.7,5,12C15.3,39.3,19.3,41,24,41z"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="48px" height="48px" viewBox="0 0 48 48" version="1.1">
|
||||
<g id="surface1">
|
||||
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(15.686275%,15.686275%,15.686275%);fill-opacity:1;" d="M 42.949219 37.109375 L 33.898438 28.0625 L 33.007812 28.949219 L 31.476562 27.414062 C 33.183594 24.882812 34.046875 21.945312 34.042969 19.011719 C 34.046875 15.171875 32.578125 11.320312 29.644531 8.390625 C 26.722656 5.464844 22.867188 4 19.019531 4.003906 C 15.179688 4 11.324219 5.46875 8.398438 8.390625 C 5.46875 11.320312 4 15.167969 4.003906 19.011719 C 4 22.851562 5.46875 26.703125 8.394531 29.628906 C 11.328125 32.554688 15.179688 34.019531 19.023438 34.019531 C 21.957031 34.019531 24.902344 33.160156 27.433594 31.453125 L 28.96875 32.988281 L 28.082031 33.871094 L 37.136719 42.917969 C 37.847656 43.636719 38.796875 43.996094 39.738281 43.996094 C 40.671875 43.996094 41.621094 43.636719 42.335938 42.917969 L 42.949219 42.308594 C 43.664062 41.59375 44.027344 40.644531 44.027344 39.707031 C 44.027344 38.769531 43.664062 37.824219 42.949219 37.109375 Z M 19.023438 32.003906 C 15.6875 32.003906 12.359375 30.738281 9.824219 28.199219 C 7.285156 25.667969 6.019531 22.34375 6.019531 19.011719 C 6.019531 15.675781 7.289062 12.351562 9.824219 9.820312 C 12.359375 7.285156 15.6875 6.019531 19.019531 6.019531 C 22.355469 6.019531 25.683594 7.285156 28.21875 9.820312 C 30.757812 12.351562 32.023438 15.675781 32.027344 19.011719 C 32.023438 22.34375 30.757812 25.667969 28.222656 28.199219 C 25.683594 30.738281 22.355469 32.003906 19.023438 32.003906 Z M 28.78125 30.421875 C 29.074219 30.171875 29.367188 29.910156 29.648438 29.628906 C 29.929688 29.351562 30.191406 29.058594 30.445312 28.761719 L 31.820312 30.136719 L 30.15625 31.800781 Z M 41.523438 40.882812 L 40.910156 41.492188 C 40.582031 41.820312 40.164062 41.976562 39.734375 41.980469 C 39.308594 41.980469 38.890625 41.820312 38.5625 41.496094 L 30.9375 33.875 L 33.898438 30.917969 L 41.523438 38.535156 C 41.847656 38.863281 42.007812 39.28125 42.007812 39.707031 C 42.007812 40.136719 41.847656 40.554688 41.523438 40.882812 Z M 41.523438 40.882812 "/>
|
||||
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(15.686275%,15.686275%,15.686275%);fill-opacity:1;" d="M 25.695312 12.34375 C 23.855469 10.507812 21.433594 9.585938 19.023438 9.585938 C 16.609375 9.585938 14.191406 10.507812 12.351562 12.34375 C 10.511719 14.179688 9.589844 16.601562 9.59375 19.011719 C 9.589844 21.421875 10.511719 23.84375 12.351562 25.675781 C 14.191406 27.511719 16.609375 28.433594 19.019531 28.433594 C 21.433594 28.433594 23.855469 27.511719 25.695312 25.675781 C 27.535156 23.839844 28.453125 21.421875 28.453125 19.011719 C 28.457031 16.601562 27.53125 14.183594 25.695312 12.34375 Z M 24.503906 24.488281 C 22.992188 25.996094 21.011719 26.753906 19.019531 26.75 C 17.03125 26.75 15.050781 25.996094 13.539062 24.488281 C 12.027344 22.976562 11.277344 21 11.277344 19.011719 C 11.277344 17.023438 12.027344 15.042969 13.539062 13.53125 C 15.054688 12.023438 17.03125 11.269531 19.023438 11.265625 C 21.011719 11.269531 22.992188 12.023438 24.503906 13.53125 C 26.015625 15.042969 26.769531 17.023438 26.769531 19.011719 C 26.769531 21 26.015625 22.976562 24.503906 24.488281 Z M 24.503906 24.488281 "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="_レイヤー_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 37.17"><defs><style>.cls-1{fill:#282828;}.cls-1,.cls-2{stroke-width:0px;}.cls-2{fill:#e6e6e6;}</style></defs><path class="cls-2" d="M42.13,35.07l-2.15,2.1L3,5.1v6.1H0V0h11.15v3h-6l36.98,32.07Z"/><path class="cls-1" d="M39.98,37.17l-2.1-2.15L74.9,3h-6.1V0h11.2v11.15h-3v-6l-37.03,32.02Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 409 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M450-313v-371L330-564l-43-43 193-193 193 193-43 43-120-120v371h-60ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 251 B |
@ -63,26 +63,4 @@ export const errorCodes = [
|
||||
"E011004", // ワークタイプ使用中エラー
|
||||
"E013001", // ワークフローのAuthorIDとWorktypeIDのペア重複エラー
|
||||
"E013002", // ワークフロー不在エラー
|
||||
"E014001", // ユーザー削除エラー(削除しようとしたユーザーがすでに削除済みだった)
|
||||
"E014002", // ユーザー削除エラー(削除しようとしたユーザーが管理者だった)
|
||||
"E014003", // ユーザー削除エラー(削除しようとしたAuthorのAuthorIDがWorkflowに指定されていた)
|
||||
"E014004", // ユーザー削除エラー(削除しようとしたTypistがWorkflowのTypist候補として指定されていた)
|
||||
"E014005", // ユーザー削除エラー(削除しようとしたTypistがUserGroupに所属していた)
|
||||
"E014006", // ユーザー削除エラー(削除しようとしたユーザが所有者の未完了のタスクが残っている)
|
||||
"E014007", // ユーザー削除エラー(削除しようとしたユーザーが有効なライセンスを持っていた)
|
||||
"E014009", // ユーザー削除エラー(削除しようとしたTypistが未完了のタスクのルーティングに設定されている)
|
||||
"E015001", // タイピストグループ削除済みエラー
|
||||
"E015002", // タイピストグループがワークフローに紐づいているエラー
|
||||
"E015003", // タイピストグループがルーティングされているエラー
|
||||
"E016001", // テンプレートファイル削除エラー(削除しようとしたテンプレートファイルがすでに削除済みだった)
|
||||
"E016002", // テンプレートファイル削除エラー(削除しようとしたテンプレートファイルがWorkflowに指定されていた)
|
||||
"E016003", // テンプレートファイル削除エラー(削除しようとしたテンプレートファイルが未完了のタスクに紐づいていた)
|
||||
"E017001", // 親アカウント変更不可エラー(指定したアカウントが存在しない)
|
||||
"E017002", // 親アカウント変更不可エラー(階層関係が不正)
|
||||
"E017003", // 親アカウント変更不可エラー(リージョンが同一でない)
|
||||
"E018001", // パートナーアカウント削除エラー(削除条件を満たしていない)
|
||||
"E019001", // パートナーアカウント取得不可エラー(階層構造が不正)
|
||||
"E020001", // パートナーアカウント変更エラー(変更条件を満たしていない)
|
||||
"E021001", // 音声ファイル名変更不可エラー(権限不足)
|
||||
"E021002", // 音声ファイル名変更不可エラー(同名ファイルが存在)
|
||||
] as const;
|
||||
|
||||
@ -6,4 +6,4 @@ export type ErrorObject = {
|
||||
statusCode?: number;
|
||||
};
|
||||
|
||||
export type ErrorCodeType = (typeof errorCodes)[number];
|
||||
export type ErrorCodeType = typeof errorCodes[number];
|
||||
|
||||
@ -1,153 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
// Jestによるparser.tsのテスト
|
||||
import fs from "fs";
|
||||
import { CSVType, parseCSV } from "./parser";
|
||||
|
||||
describe("parse", () => {
|
||||
it("指定形式のCSV文字列をパースできる", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_001.csv", "utf-8");
|
||||
const actualData = await parseCSV(text);
|
||||
const expectData: CSVType[] = [
|
||||
{
|
||||
name: "hoge",
|
||||
email: "sample@example.com",
|
||||
role: 1,
|
||||
author_id: "HOGE",
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "abcd",
|
||||
prompt: 0,
|
||||
},
|
||||
];
|
||||
expect(actualData).toEqual(expectData);
|
||||
});
|
||||
it("指定形式のヘッダでない場合、例外が送出される | author_id(値がoptionial)がない", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_002.csv", "utf-8");
|
||||
try {
|
||||
await parseCSV(text);
|
||||
fail("例外が発生しませんでした");
|
||||
} catch (e) {
|
||||
expect(e).toEqual(new Error("Invalid CSV format"));
|
||||
}
|
||||
});
|
||||
it("指定形式のヘッダでない場合、例外が送出される | email(値が必須)がない", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_003.csv", "utf-8");
|
||||
try {
|
||||
await parseCSV(text);
|
||||
fail("例外が発生しませんでした");
|
||||
} catch (e) {
|
||||
expect(e).toEqual(new Error("Invalid CSV format"));
|
||||
}
|
||||
});
|
||||
it("指定形式のヘッダでない場合、例外が送出される | emailがスペルミス", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_004.csv", "utf-8");
|
||||
try {
|
||||
await parseCSV(text);
|
||||
fail("例外が発生しませんでした");
|
||||
} catch (e) {
|
||||
expect(e).toEqual(new Error("Invalid CSV format"));
|
||||
}
|
||||
});
|
||||
it("指定形式のCSV文字列をパースできる | 抜けているパラメータ(文字列)はnullとなる", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_005.csv", "utf-8");
|
||||
const actualData = await parseCSV(text);
|
||||
const expectData: CSVType[] = [
|
||||
{
|
||||
name: "hoge",
|
||||
email: "sample@example.com",
|
||||
role: 1,
|
||||
author_id: null,
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "abcd",
|
||||
prompt: 0,
|
||||
},
|
||||
];
|
||||
expect(actualData).toEqual(expectData);
|
||||
});
|
||||
it("指定形式のCSV文字列をパースできる | 抜けているパラメータ(数値)はnullとなる", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_006.csv", "utf-8");
|
||||
const actualData = await parseCSV(text);
|
||||
const expectData: CSVType[] = [
|
||||
{
|
||||
name: "hoge",
|
||||
email: "sample@example.com",
|
||||
role: null,
|
||||
author_id: "HOGE",
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "abcd",
|
||||
prompt: 0,
|
||||
},
|
||||
];
|
||||
expect(actualData).toEqual(expectData);
|
||||
});
|
||||
it("指定形式のCSV文字列をパースできる | 余計なパラメータがあっても問題はない", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_007.csv", "utf-8");
|
||||
const actualData = await parseCSV(text);
|
||||
const expectData: CSVType[] = [
|
||||
{
|
||||
name: "hoge",
|
||||
email: "sample@example.com",
|
||||
role: 1,
|
||||
author_id: "HOGE",
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "abcd",
|
||||
prompt: 0,
|
||||
},
|
||||
{
|
||||
name: "hoge2",
|
||||
email: "sample2@example.com",
|
||||
role: 1,
|
||||
author_id: "HOGE2",
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "abcd2",
|
||||
prompt: 0,
|
||||
},
|
||||
];
|
||||
expect(actualData.length).toBe(expectData.length);
|
||||
|
||||
// 余計なパラメータ格納用に __parsed_extra: string[] というプロパティが作られてしまうので、既知のプロパティ毎に比較
|
||||
for (let i = 0; i < actualData.length; i += 1) {
|
||||
const actualValue = actualData[i];
|
||||
const expectValue = expectData[i];
|
||||
expect(actualValue.author_id).toEqual(expectValue.author_id);
|
||||
expect(actualValue.auto_assign).toEqual(expectValue.auto_assign);
|
||||
expect(actualValue.email).toEqual(expectValue.email);
|
||||
expect(actualValue.encryption).toEqual(expectValue.encryption);
|
||||
expect(actualValue.encryption_password).toEqual(
|
||||
expectValue.encryption_password
|
||||
);
|
||||
expect(actualValue.name).toEqual(expectValue.name);
|
||||
expect(actualValue.notification).toEqual(expectValue.notification);
|
||||
expect(actualValue.prompt).toEqual(expectValue.prompt);
|
||||
expect(actualValue.role).toEqual(expectValue.role);
|
||||
}
|
||||
});
|
||||
|
||||
it("author_id,encryption_passwordが数値のみの場合でも、文字列として変換できる", async () => {
|
||||
const text = fs.readFileSync("src/common/test/test_008.csv", "utf-8");
|
||||
const actualData = await parseCSV(text);
|
||||
const expectData: CSVType[] = [
|
||||
{
|
||||
name: "hoge",
|
||||
email: "sample@example.com",
|
||||
role: 1,
|
||||
author_id: "1111",
|
||||
auto_assign: 1,
|
||||
notification: 1,
|
||||
encryption: 1,
|
||||
encryption_password: "222222",
|
||||
prompt: 0,
|
||||
},
|
||||
];
|
||||
expect(actualData).toEqual(expectData);
|
||||
});
|
||||
});
|
||||
@ -1,74 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import Papa, { ParseResult } from "papaparse";
|
||||
|
||||
export type CSVType = {
|
||||
name: string | null;
|
||||
email: string | null;
|
||||
role: number | null;
|
||||
author_id: string | null;
|
||||
auto_assign: number | null;
|
||||
notification: number;
|
||||
encryption: number | null;
|
||||
encryption_password: string | null;
|
||||
prompt: number | null;
|
||||
};
|
||||
|
||||
// CSVTypeのプロパティ名を文字列の配列で定義する
|
||||
const CSVTypeFields: (keyof CSVType)[] = [
|
||||
"name",
|
||||
"email",
|
||||
"role",
|
||||
"author_id",
|
||||
"auto_assign",
|
||||
"notification",
|
||||
"encryption",
|
||||
"encryption_password",
|
||||
"prompt",
|
||||
];
|
||||
|
||||
// 2つの配列が等しいかどうかを判定する
|
||||
const equals = (lhs: string[], rhs: string[]) => {
|
||||
if (lhs.length !== rhs.length) return false;
|
||||
for (let i = 0; i < lhs.length; i += 1) {
|
||||
if (lhs[i] !== rhs[i]) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
/** CSVファイルをCSVType型に変換するパーサー */
|
||||
export const parseCSV = async (csvString: string): Promise<CSVType[]> =>
|
||||
new Promise((resolve, reject) => {
|
||||
Papa.parse<CSVType>(csvString, {
|
||||
download: false,
|
||||
worker: false, // XXX: workerを使うとエラーが発生するためfalseに設定
|
||||
header: true,
|
||||
dynamicTyping: {
|
||||
// author_id, encryption_passwordは数値のみの場合、numberに変換されたくないためdynamicTypingをtrueにしない
|
||||
role: true,
|
||||
auto_assign: true,
|
||||
notification: true,
|
||||
encryption: true,
|
||||
prompt: true,
|
||||
},
|
||||
// dynamicTypingがfalseの場合、空文字をnullに変換できないためtransformを使用する
|
||||
transform: (value, field) => {
|
||||
if (field === "author_id" || field === "encryption_password") {
|
||||
// 空文字の場合はnullに変換する
|
||||
if (value === "") {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},
|
||||
complete: (results: ParseResult<CSVType>) => {
|
||||
// ヘッダーがCSVTypeFieldsと一致しない場合はエラーを返す
|
||||
if (!equals(results.meta.fields ?? [], CSVTypeFields)) {
|
||||
reject(new Error("Invalid CSV format"));
|
||||
}
|
||||
resolve(results.data);
|
||||
},
|
||||
error: (error: Error) => {
|
||||
reject(error);
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -1,2 +0,0 @@
|
||||
name,email,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,"HOGE",1,1,1,abcd,0
|
||||
|
@ -1,2 +0,0 @@
|
||||
name,email,role,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,"HOGE",1,1,1,abcd,0
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -1,2 +0,0 @@
|
||||
name,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,"HOGE",1,1,1,abcd,0
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -1,2 +0,0 @@
|
||||
name,emeil,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,"HOGE",1,1,1,abcd,0
|
||||
|
@ -1,2 +0,0 @@
|
||||
name,email,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,,1,1,1,abcd,0
|
||||
|
@ -1,2 +0,0 @@
|
||||
name,email,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,,"HOGE",1,1,1,abcd,0
|
||||
|
@ -1,3 +0,0 @@
|
||||
name,email,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,"HOGE",1,1,1,abcd,0,x
|
||||
hoge2,sample2@example.com,1,"HOGE2",1,1,1,abcd2,0,1,32,4,aa
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -1,2 +0,0 @@
|
||||
name,email,role,author_id,auto_assign,notification,encryption,encryption_password,prompt
|
||||
hoge,sample@example.com,1,1111,1,1,1,222222,0
|
||||
|
@ -47,7 +47,6 @@ export const KEYS_TO_PRESERVE = [
|
||||
"accessToken",
|
||||
"refreshToken",
|
||||
"displayInfo",
|
||||
"filterCriteria",
|
||||
"sortCriteria",
|
||||
];
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useLayoutEffect, useState } from "react";
|
||||
import React, { useCallback } from "react";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { decodeToken } from "common/decodeToken";
|
||||
import { useInterval } from "common/useInterval";
|
||||
@ -17,58 +17,41 @@ import { TOKEN_UPDATE_INTERVAL_MS, TOKEN_UPDATE_TIME } from "./constants";
|
||||
export const UpdateTokenTimer = () => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
// トークンの更新中かどうか
|
||||
const [isUpdating, setIsUpdating] = useState(false);
|
||||
|
||||
const delegattionToken = useSelector(selectDelegationAccessToken);
|
||||
|
||||
// 期限が5分以内であれば更新APIを呼ぶ
|
||||
const updateToken = useCallback(async () => {
|
||||
if (isUpdating) {
|
||||
return;
|
||||
}
|
||||
setIsUpdating(true);
|
||||
try {
|
||||
// localStorageからトークンを取得
|
||||
const jwt = loadAccessToken();
|
||||
// 現在時刻を取得
|
||||
const now = DateTime.local().toSeconds();
|
||||
// selectorに以下の判定処理を移したかったが、初期表示時の値でしか判定できないのでComponent内に置く
|
||||
if (jwt) {
|
||||
const token = decodeToken(jwt);
|
||||
if (token) {
|
||||
const { exp } = token;
|
||||
if (exp - now <= TOKEN_UPDATE_TIME) {
|
||||
await dispatch(updateTokenAsync());
|
||||
}
|
||||
// localStorageからトークンを取得
|
||||
const jwt = loadAccessToken();
|
||||
// 現在時刻を取得
|
||||
const now = DateTime.local().toSeconds();
|
||||
// selectorに以下の判定処理を移したかったが、初期表示時の値でしか判定できないのでComponent内に置く
|
||||
if (jwt) {
|
||||
const token = decodeToken(jwt);
|
||||
if (token) {
|
||||
const { exp } = token;
|
||||
if (exp - now <= TOKEN_UPDATE_TIME) {
|
||||
await dispatch(updateTokenAsync());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 代行操作トークン更新処理
|
||||
if (delegattionToken) {
|
||||
const token = decodeToken(delegattionToken);
|
||||
if (token) {
|
||||
const { exp } = token;
|
||||
if (exp - now <= TOKEN_UPDATE_TIME) {
|
||||
const { meta } = await dispatch(updateDelegationTokenAsync());
|
||||
if (meta.requestStatus === "rejected") {
|
||||
dispatch(cleanupDelegateAccount());
|
||||
navigate("/partners");
|
||||
}
|
||||
// 代行操作トークン更新処理
|
||||
if (delegattionToken) {
|
||||
const token = decodeToken(delegattionToken);
|
||||
if (token) {
|
||||
const { exp } = token;
|
||||
if (exp - now <= TOKEN_UPDATE_TIME) {
|
||||
const { meta } = await dispatch(updateDelegationTokenAsync());
|
||||
if (meta.requestStatus === "rejected") {
|
||||
dispatch(cleanupDelegateAccount());
|
||||
navigate("/partners");
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Token update error:", e);
|
||||
} finally {
|
||||
setIsUpdating(false);
|
||||
}
|
||||
}, [isUpdating, delegattionToken, dispatch, navigate]);
|
||||
useLayoutEffect(() => {
|
||||
updateToken();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
}, [dispatch, delegattionToken, navigate]);
|
||||
|
||||
useInterval(updateToken, TOKEN_UPDATE_INTERVAL_MS);
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ import {
|
||||
updateAccountInfoAsync,
|
||||
getAccountRelationsAsync,
|
||||
deleteAccountAsync,
|
||||
updateFileDeleteSettingAsync,
|
||||
} from "./operations";
|
||||
|
||||
const initialState: AccountState = {
|
||||
@ -16,8 +15,6 @@ const initialState: AccountState = {
|
||||
tier: 0,
|
||||
country: "",
|
||||
delegationPermission: false,
|
||||
autoFileDelete: false,
|
||||
fileRetentionDays: 0,
|
||||
},
|
||||
},
|
||||
dealers: [],
|
||||
@ -32,8 +29,6 @@ const initialState: AccountState = {
|
||||
secondryAdminUserId: undefined,
|
||||
},
|
||||
isLoading: false,
|
||||
autoFileDelete: false,
|
||||
fileRetentionDays: 0,
|
||||
},
|
||||
};
|
||||
|
||||
@ -69,20 +64,6 @@ export const accountSlice = createSlice({
|
||||
const { secondryAdminUserId } = action.payload;
|
||||
state.apps.updateAccountInfo.secondryAdminUserId = secondryAdminUserId;
|
||||
},
|
||||
changeAutoFileDelete: (
|
||||
state,
|
||||
action: PayloadAction<{ autoFileDelete: boolean }>
|
||||
) => {
|
||||
const { autoFileDelete } = action.payload;
|
||||
state.apps.autoFileDelete = autoFileDelete;
|
||||
},
|
||||
changeFileRetentionDays: (
|
||||
state,
|
||||
action: PayloadAction<{ fileRetentionDays: number }>
|
||||
) => {
|
||||
const { fileRetentionDays } = action.payload;
|
||||
state.apps.fileRetentionDays = fileRetentionDays;
|
||||
},
|
||||
cleanupApps: (state) => {
|
||||
state.domain = initialState.domain;
|
||||
},
|
||||
@ -104,10 +85,6 @@ export const accountSlice = createSlice({
|
||||
action.payload.accountInfo.account.primaryAdminUserId;
|
||||
state.apps.updateAccountInfo.secondryAdminUserId =
|
||||
action.payload.accountInfo.account.secondryAdminUserId;
|
||||
state.apps.autoFileDelete =
|
||||
action.payload.accountInfo.account.autoFileDelete;
|
||||
state.apps.fileRetentionDays =
|
||||
action.payload.accountInfo.account.fileRetentionDays;
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getAccountRelationsAsync.rejected, (state) => {
|
||||
@ -122,15 +99,6 @@ export const accountSlice = createSlice({
|
||||
builder.addCase(updateAccountInfoAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(updateFileDeleteSettingAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(updateFileDeleteSettingAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(updateFileDeleteSettingAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteAccountAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
@ -147,8 +115,6 @@ export const {
|
||||
changeDealerPermission,
|
||||
changePrimaryAdministrator,
|
||||
changeSecondryAdministrator,
|
||||
changeAutoFileDelete,
|
||||
changeFileRetentionDays,
|
||||
cleanupApps,
|
||||
} = accountSlice.actions;
|
||||
export default accountSlice.reducer;
|
||||
|
||||
@ -9,7 +9,6 @@ import {
|
||||
UpdateAccountInfoRequest,
|
||||
UsersApi,
|
||||
DeleteAccountRequest,
|
||||
UpdateFileDeleteSettingRequest,
|
||||
} from "../../api/api";
|
||||
import { Configuration } from "../../api/configuration";
|
||||
import { ViewAccountRelationsInfo } from "./types";
|
||||
@ -39,7 +38,7 @@ export const getAccountRelationsAsync = createAsyncThunk<
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
const dealers = await accountsApi.getDealers();
|
||||
const users = await usersApi.getUsers(undefined, undefined, {
|
||||
const users = await usersApi.getUsers({
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
return {
|
||||
@ -113,58 +112,6 @@ export const updateAccountInfoAsync = createAsyncThunk<
|
||||
}
|
||||
});
|
||||
|
||||
export const updateFileDeleteSettingAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{ autoFileDelete: boolean; fileRetentionDays: number },
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("accounts/updateFileDeleteSettingAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountApi = new AccountsApi(config);
|
||||
|
||||
const requestParam: UpdateFileDeleteSettingRequest = {
|
||||
autoFileDelete: args.autoFileDelete,
|
||||
retentionDays: args.fileRetentionDays,
|
||||
};
|
||||
|
||||
try {
|
||||
await accountApi.updateFileDeleteSetting(requestParam, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
const error = createErrorObject(e);
|
||||
|
||||
const errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteAccountAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
|
||||
@ -16,18 +16,3 @@ export const selectIsLoading = (state: RootState) =>
|
||||
state.account.apps.isLoading;
|
||||
export const selectUpdateAccountInfo = (state: RootState) =>
|
||||
state.account.apps.updateAccountInfo;
|
||||
export const selectFileDeleteSetting = (state: RootState) => {
|
||||
const { autoFileDelete, fileRetentionDays } = state.account.apps;
|
||||
return {
|
||||
autoFileDelete,
|
||||
fileRetentionDays,
|
||||
};
|
||||
};
|
||||
export const selectInputValidationErrors = (state: RootState) => {
|
||||
const { fileRetentionDays } = state.account.apps;
|
||||
const hasFileRetentionDaysError =
|
||||
fileRetentionDays <= 0 || fileRetentionDays >= 1000;
|
||||
return {
|
||||
hasFileRetentionDaysError,
|
||||
};
|
||||
};
|
||||
|
||||
@ -19,6 +19,4 @@ export interface Domain {
|
||||
export interface Apps {
|
||||
updateAccountInfo: UpdateAccountInfoRequest;
|
||||
isLoading: boolean;
|
||||
autoFileDelete: boolean;
|
||||
fileRetentionDays: number;
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ export const STATUS = {
|
||||
BACKUP: "Backup",
|
||||
} as const;
|
||||
|
||||
export type StatusType = (typeof STATUS)[keyof typeof STATUS];
|
||||
export type StatusType = typeof STATUS[keyof typeof STATUS];
|
||||
|
||||
export const LIMIT_TASK_NUM = 100;
|
||||
|
||||
@ -26,7 +26,7 @@ export const SORTABLE_COLUMN = {
|
||||
TranscriptionFinishedDate: "TRANSCRIPTION_FINISHED_DATE",
|
||||
} as const;
|
||||
export type SortableColumnType =
|
||||
(typeof SORTABLE_COLUMN)[keyof typeof SORTABLE_COLUMN];
|
||||
typeof SORTABLE_COLUMN[keyof typeof SORTABLE_COLUMN];
|
||||
|
||||
export const isSortableColumnType = (
|
||||
value: string
|
||||
@ -36,14 +36,14 @@ export const isSortableColumnType = (
|
||||
};
|
||||
|
||||
export type SortableColumnList =
|
||||
(typeof SORTABLE_COLUMN)[keyof typeof SORTABLE_COLUMN];
|
||||
typeof SORTABLE_COLUMN[keyof typeof SORTABLE_COLUMN];
|
||||
|
||||
export const DIRECTION = {
|
||||
ASC: "ASC",
|
||||
DESC: "DESC",
|
||||
} as const;
|
||||
|
||||
export type DirectionType = (typeof DIRECTION)[keyof typeof DIRECTION];
|
||||
export type DirectionType = typeof DIRECTION[keyof typeof DIRECTION];
|
||||
|
||||
// DirectionTypeの型チェック関数
|
||||
export const isDirectionType = (arg: string): arg is DirectionType =>
|
||||
|
||||
@ -11,8 +11,6 @@ import {
|
||||
playbackAsync,
|
||||
updateAssigneeAsync,
|
||||
cancelAsync,
|
||||
deleteTaskAsync,
|
||||
renameFileAsync,
|
||||
} from "./operations";
|
||||
import {
|
||||
SORTABLE_COLUMN,
|
||||
@ -43,8 +41,6 @@ const initialState: DictationState = {
|
||||
direction: DIRECTION.ASC,
|
||||
paramName: SORTABLE_COLUMN.JobNumber,
|
||||
selectedTask: undefined,
|
||||
authorId: "",
|
||||
fileName: "",
|
||||
assignee: {
|
||||
selected: [],
|
||||
pool: [],
|
||||
@ -80,14 +76,6 @@ export const dictationSlice = createSlice({
|
||||
const { paramName } = action.payload;
|
||||
state.apps.paramName = paramName;
|
||||
},
|
||||
changeAuthorId: (state, action: PayloadAction<{ authorId: string }>) => {
|
||||
const { authorId } = action.payload;
|
||||
state.apps.authorId = authorId;
|
||||
},
|
||||
changeFileName: (state, action: PayloadAction<{ fileName: string }>) => {
|
||||
const { fileName } = action.payload;
|
||||
state.apps.fileName = fileName;
|
||||
},
|
||||
changeSelectedTask: (state, action: PayloadAction<{ task: Task }>) => {
|
||||
const { task } = action.payload;
|
||||
state.apps.selectedTask = task;
|
||||
@ -230,25 +218,6 @@ export const dictationSlice = createSlice({
|
||||
builder.addCase(backupTasksAsync.rejected, (state) => {
|
||||
state.apps.isDownloading = false;
|
||||
});
|
||||
builder.addCase(deleteTaskAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(deleteTaskAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteTaskAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
|
||||
builder.addCase(renameFileAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(renameFileAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(renameFileAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@ -256,8 +225,6 @@ export const {
|
||||
changeDisplayInfo,
|
||||
changeDirection,
|
||||
changeParamName,
|
||||
changeAuthorId,
|
||||
changeFileName,
|
||||
changeSelectedTask,
|
||||
changeAssignee,
|
||||
changeBackupTaskChecked,
|
||||
|
||||
@ -35,8 +35,6 @@ export const listTasksAsync = createAsyncThunk<
|
||||
filter?: string;
|
||||
direction: DirectionType;
|
||||
paramName: SortableColumnType;
|
||||
authorId?: string;
|
||||
fileName?: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
@ -45,8 +43,7 @@ export const listTasksAsync = createAsyncThunk<
|
||||
};
|
||||
}
|
||||
>("dictations/listTasksAsync", async (args, thunkApi) => {
|
||||
const { limit, offset, filter, direction, paramName, authorId, fileName } =
|
||||
args;
|
||||
const { limit, offset, filter, direction, paramName } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
@ -63,8 +60,6 @@ export const listTasksAsync = createAsyncThunk<
|
||||
filter,
|
||||
direction,
|
||||
paramName,
|
||||
authorId,
|
||||
fileName,
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
@ -85,136 +80,6 @@ export const listTasksAsync = createAsyncThunk<
|
||||
}
|
||||
});
|
||||
|
||||
export const getTaskFiltersAsync = createAsyncThunk<
|
||||
{
|
||||
authorId?: string;
|
||||
fileName?: string;
|
||||
},
|
||||
void,
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/getTaskFiltersAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
|
||||
try {
|
||||
const usertaskfilter = await usersApi.getTaskFilter({
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
const { authorId, fileName } = usertaskfilter.data;
|
||||
return { authorId, fileName };
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const updateTaskFiltersAsync = createAsyncThunk<
|
||||
{
|
||||
/** empty */
|
||||
},
|
||||
{
|
||||
filterConditionAuthorId: string;
|
||||
filterConditionFileName: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/updateTaskFiltersAsync", async (args, thunkApi) => {
|
||||
const { filterConditionAuthorId, filterConditionFileName } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
try {
|
||||
return await usersApi.updateTaskFilter(
|
||||
{ filterConditionAuthorId, filterConditionFileName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const updateSortColumnAsync = createAsyncThunk<
|
||||
{
|
||||
/** empty */
|
||||
},
|
||||
{
|
||||
direction: DirectionType;
|
||||
paramName: SortableColumnType;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/updateSortColumnAsync", async (args, thunkApi) => {
|
||||
const { direction, paramName } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
|
||||
const usersApi = new UsersApi(config);
|
||||
|
||||
try {
|
||||
return await usersApi.updateSortCriteria(
|
||||
{ direction, paramName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const getSortColumnAsync = createAsyncThunk<
|
||||
{
|
||||
direction: DirectionType;
|
||||
@ -415,8 +280,6 @@ export const playbackAsync = createAsyncThunk<
|
||||
direction: DirectionType;
|
||||
paramName: SortableColumnType;
|
||||
audioFileId: number;
|
||||
filterConditionAuthorId: string;
|
||||
filterConditionFileName: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
@ -425,13 +288,7 @@ export const playbackAsync = createAsyncThunk<
|
||||
};
|
||||
}
|
||||
>("dictations/playbackAsync", async (args, thunkApi) => {
|
||||
const {
|
||||
audioFileId,
|
||||
direction,
|
||||
paramName,
|
||||
filterConditionAuthorId,
|
||||
filterConditionFileName,
|
||||
} = args;
|
||||
const { audioFileId, direction, paramName } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
@ -448,12 +305,6 @@ export const playbackAsync = createAsyncThunk<
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
await usersApi.updateTaskFilter(
|
||||
{ filterConditionAuthorId, filterConditionFileName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
await tasksApi.checkout(audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
@ -536,8 +387,6 @@ export const cancelAsync = createAsyncThunk<
|
||||
paramName: SortableColumnType;
|
||||
audioFileId: number;
|
||||
isTypist: boolean;
|
||||
filterConditionAuthorId: string;
|
||||
filterConditionFileName: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
@ -546,14 +395,7 @@ export const cancelAsync = createAsyncThunk<
|
||||
};
|
||||
}
|
||||
>("dictations/cancelAsync", async (args, thunkApi) => {
|
||||
const {
|
||||
audioFileId,
|
||||
direction,
|
||||
paramName,
|
||||
isTypist,
|
||||
filterConditionAuthorId,
|
||||
filterConditionFileName,
|
||||
} = args;
|
||||
const { audioFileId, direction, paramName, isTypist } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
@ -564,25 +406,15 @@ export const cancelAsync = createAsyncThunk<
|
||||
const tasksApi = new TasksApi(config);
|
||||
const usersApi = new UsersApi(config);
|
||||
try {
|
||||
// ユーザーがタイピストである場合に、ソート条件と検索条件を保存する
|
||||
// ユーザーがタイピストである場合に、ソート条件を保存する
|
||||
if (isTypist) {
|
||||
await usersApi.updateSortCriteria(
|
||||
{
|
||||
direction,
|
||||
paramName,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
await usersApi.updateTaskFilter(
|
||||
{ filterConditionAuthorId, filterConditionFileName },
|
||||
{ direction, paramName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
await tasksApi.cancel(audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
@ -618,93 +450,6 @@ export const cancelAsync = createAsyncThunk<
|
||||
}
|
||||
});
|
||||
|
||||
export const reopenAsync = createAsyncThunk<
|
||||
{
|
||||
/** empty */
|
||||
},
|
||||
{
|
||||
direction: DirectionType;
|
||||
paramName: SortableColumnType;
|
||||
audioFileId: number;
|
||||
isTypist: boolean;
|
||||
filterConditionAuthorId: string;
|
||||
filterConditionFileName: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/reopenAsync", async (args, thunkApi) => {
|
||||
const {
|
||||
audioFileId,
|
||||
direction,
|
||||
paramName,
|
||||
isTypist,
|
||||
filterConditionAuthorId,
|
||||
filterConditionFileName,
|
||||
} = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const tasksApi = new TasksApi(config);
|
||||
const usersApi = new UsersApi(config);
|
||||
try {
|
||||
// ユーザーがタイピストである場合に、ソート条件と検索条件を保存する
|
||||
if (isTypist) {
|
||||
await usersApi.updateSortCriteria(
|
||||
{ direction, paramName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
await usersApi.updateTaskFilter(
|
||||
{ filterConditionAuthorId, filterConditionFileName },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
}
|
||||
await tasksApi.reopen(audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
// ステータスが[Finished]以外、またはタスクが存在しない場合、またはtypistで自分のタスクでない場合
|
||||
if (error.code === "E010601" || error.code === "E010603") {
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("dictationPage.message.reopenFailedError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const listBackupPopupTasksAsync = createAsyncThunk<
|
||||
TasksResponse,
|
||||
{
|
||||
@ -735,8 +480,6 @@ export const listBackupPopupTasksAsync = createAsyncThunk<
|
||||
BACKUP_POPUP_LIST_STATUS.join(","), // ステータスはFinished,Backupのみ
|
||||
DIRECTION.DESC,
|
||||
SORTABLE_COLUMN.Status,
|
||||
undefined, // backupポップアップ表示時には検索条件は未指定
|
||||
undefined, // backupポップアップ表示時には検索条件は未指定
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
@ -822,21 +565,10 @@ export const backupTasksAsync = createAsyncThunk<
|
||||
a.click();
|
||||
a.parentNode?.removeChild(a);
|
||||
|
||||
// バックアップ済みに更新
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await tasksApi.backup(task.audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換
|
||||
const error = createErrorObject(e);
|
||||
if (error.code === "E010603") {
|
||||
// タスクが削除済みの場合は成功扱いとする
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await tasksApi.backup(task.audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -848,22 +580,8 @@ export const backupTasksAsync = createAsyncThunk<
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
if (error.code === "E010603") {
|
||||
// 存在しない音声ファイルをダウンロードしようとした場合
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID(
|
||||
"dictationPage.message.fileAlreadyDeletedError"
|
||||
),
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
@ -874,143 +592,3 @@ export const backupTasksAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteTaskAsync = createAsyncThunk<
|
||||
{
|
||||
// empty
|
||||
},
|
||||
{
|
||||
// パラメータ
|
||||
audioFileId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/deleteTaskAsync", async (args, thunkApi) => {
|
||||
const { audioFileId } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const tasksApi = new TasksApi(config);
|
||||
|
||||
try {
|
||||
await tasksApi.deleteTask(audioFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let message = getTranslationID("common.message.internalServerError");
|
||||
|
||||
if (error.statusCode === 400) {
|
||||
if (error.code === "E010603") {
|
||||
// タスクが削除済みの場合は成功扱いとする
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
}
|
||||
|
||||
if (error.code === "E010601") {
|
||||
// タスクがInprogressの場合はエラー
|
||||
message = getTranslationID("dictationPage.message.deleteFailedError");
|
||||
}
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const renameFileAsync = createAsyncThunk<
|
||||
{
|
||||
// empty
|
||||
},
|
||||
{
|
||||
// パラメータ
|
||||
audioFileId: number;
|
||||
fileName: string;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("dictations/renameFileAsync", async (args, thunkApi) => {
|
||||
const { audioFileId, fileName } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const filesApi = new FilesApi(config);
|
||||
|
||||
try {
|
||||
await filesApi.fileRename(
|
||||
{ fileName, audioFileId },
|
||||
{ headers: { authorization: `Bearer ${accessToken}` } }
|
||||
);
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let message = getTranslationID("common.message.internalServerError");
|
||||
|
||||
// 変更権限がない場合はエラー
|
||||
if (error.code === "E021001") {
|
||||
message = getTranslationID("dictationPage.message.fileRenameFailedError");
|
||||
}
|
||||
|
||||
// ファイル名が既に存在する場合はエラー
|
||||
if (error.code === "E021002") {
|
||||
message = getTranslationID(
|
||||
"dictationPage.message.fileNameAleadyExistsError"
|
||||
);
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -72,12 +72,6 @@ export const selectDirection = (state: RootState) =>
|
||||
export const selectParamName = (state: RootState) =>
|
||||
state.dictation.apps.paramName;
|
||||
|
||||
export const selectAuthorId = (state: RootState) =>
|
||||
state.dictation.apps.authorId;
|
||||
|
||||
export const selectFilename = (state: RootState) =>
|
||||
state.dictation.apps.fileName;
|
||||
|
||||
export const selectSelectedTask = (state: RootState) =>
|
||||
state.dictation.apps.selectedTask;
|
||||
|
||||
|
||||
@ -25,8 +25,6 @@ export interface Apps {
|
||||
displayInfo: DisplayInfoType;
|
||||
direction: DirectionType;
|
||||
paramName: SortableColumnType;
|
||||
authorId: string;
|
||||
fileName: string;
|
||||
selectedTask?: Task;
|
||||
selectedFileTask?: Task;
|
||||
assignee: {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
import { LicenseCardActivateState } from "./state";
|
||||
import { activateCardLicenseAsync } from "./operations";
|
||||
|
||||
const initialState: LicenseCardActivateState = {
|
||||
apps: {
|
||||
@ -15,17 +14,6 @@ export const licenseCardActivateSlice = createSlice({
|
||||
state.apps = initialState.apps;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(activateCardLicenseAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(activateCardLicenseAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(activateCardLicenseAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const { cleanupApps } = licenseCardActivateSlice.actions;
|
||||
|
||||
@ -7,8 +7,3 @@ export const STATUS = {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
ORDER_CANCELED: "Order Canceled",
|
||||
} as const;
|
||||
|
||||
export const LICENSE_TYPE = {
|
||||
NORMAL: "NORMAL",
|
||||
TRIAL: "TRIAL",
|
||||
} as const;
|
||||
|
||||
@ -3,12 +3,7 @@ import type { RootState } from "app/store";
|
||||
import { getTranslationID } from "translation";
|
||||
import { openSnackbar } from "features/ui/uiSlice";
|
||||
import { getAccessToken } from "features/auth";
|
||||
import {
|
||||
AccountsApi,
|
||||
LicensesApi,
|
||||
SearchPartner,
|
||||
PartnerLicenseInfo,
|
||||
} from "../../../api/api";
|
||||
import { AccountsApi, LicensesApi } from "../../../api/api";
|
||||
import { Configuration } from "../../../api/configuration";
|
||||
import { ErrorObject, createErrorObject } from "../../../common/errors";
|
||||
import { OrderHistoryView } from "./types";
|
||||
@ -20,7 +15,6 @@ export const getLicenseOrderHistoriesAsync = createAsyncThunk<
|
||||
// パラメータ
|
||||
limit: number;
|
||||
offset: number;
|
||||
selectedRow?: PartnerLicenseInfo | SearchPartner;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
@ -29,7 +23,7 @@ export const getLicenseOrderHistoriesAsync = createAsyncThunk<
|
||||
};
|
||||
}
|
||||
>("licenses/licenseOrderHisotyAsync", async (args, thunkApi) => {
|
||||
const { limit, offset, selectedRow } = args;
|
||||
const { limit, offset } = args;
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
@ -39,6 +33,7 @@ export const getLicenseOrderHistoriesAsync = createAsyncThunk<
|
||||
const accountsApi = new AccountsApi(config);
|
||||
|
||||
try {
|
||||
const { selectedRow } = state.partnerLicense.apps;
|
||||
let accountId = 0;
|
||||
let companyName = "";
|
||||
// 他の画面から指定されていない場合はログインアカウントのidを取得する
|
||||
@ -51,9 +46,7 @@ export const getLicenseOrderHistoriesAsync = createAsyncThunk<
|
||||
companyName = getMyAccountResponse.data.account.companyName;
|
||||
} else {
|
||||
accountId = selectedRow.accountId;
|
||||
// パートナーライセンスとパートナー検索で型が異なるため、型ガードで推論させる
|
||||
if ("companyName" in selectedRow) companyName = selectedRow.companyName;
|
||||
if ("name" in selectedRow) companyName = selectedRow.name;
|
||||
companyName = selectedRow.companyName;
|
||||
}
|
||||
|
||||
const res = await accountsApi.getOrderHistories(
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
import { LicenseSummaryState } from "./state";
|
||||
import {
|
||||
getCompanyNameAsync,
|
||||
getLicenseSummaryAsync,
|
||||
updateRestrictionStatusAsync,
|
||||
} from "./operations";
|
||||
import { getCompanyNameAsync, getLicenseSummaryAsync } from "./operations";
|
||||
|
||||
const initialState: LicenseSummaryState = {
|
||||
domain: {
|
||||
@ -39,30 +35,12 @@ export const licenseSummarySlice = createSlice({
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(getLicenseSummaryAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(getLicenseSummaryAsync.fulfilled, (state, action) => {
|
||||
state.domain.licenseSummaryInfo = action.payload;
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getLicenseSummaryAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
// 画面側ではgetLicenseSummaryAsyncと並行して呼び出されているため、レーシングを考慮してこちらではisLoadingを更新しない
|
||||
// 本来は両方の完了を待ってからisLoadingを更新するべきだが、現時点ではスピード重視のためケアしない。
|
||||
builder.addCase(getCompanyNameAsync.fulfilled, (state, action) => {
|
||||
state.domain.accountInfo.companyName = action.payload.companyName;
|
||||
});
|
||||
builder.addCase(updateRestrictionStatusAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(updateRestrictionStatusAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(updateRestrictionStatusAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -7,9 +7,7 @@ import {
|
||||
AccountsApi,
|
||||
GetCompanyNameResponse,
|
||||
GetLicenseSummaryResponse,
|
||||
SearchPartner,
|
||||
PartnerLicenseInfo,
|
||||
UpdateRestrictionStatusRequest,
|
||||
} from "../../../api/api";
|
||||
import { Configuration } from "../../../api/configuration";
|
||||
import { ErrorObject, createErrorObject } from "../../../common/errors";
|
||||
@ -18,7 +16,7 @@ export const getLicenseSummaryAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
GetLicenseSummaryResponse,
|
||||
// 引数
|
||||
{ selectedRow?: PartnerLicenseInfo | SearchPartner },
|
||||
{ selectedRow?: PartnerLicenseInfo },
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
@ -74,7 +72,7 @@ export const getCompanyNameAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
GetCompanyNameResponse,
|
||||
// 引数
|
||||
{ selectedRow?: PartnerLicenseInfo | SearchPartner },
|
||||
{ selectedRow?: PartnerLicenseInfo },
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
@ -125,58 +123,3 @@ export const getCompanyNameAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const updateRestrictionStatusAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{
|
||||
accountId: number;
|
||||
restricted: boolean;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("accounts/updateRestrictionStatusAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountApi = new AccountsApi(config);
|
||||
|
||||
const requestParam: UpdateRestrictionStatusRequest = {
|
||||
accountId: args.accountId,
|
||||
restricted: args.restricted,
|
||||
};
|
||||
|
||||
try {
|
||||
await accountApi.updateRestrictionStatus(requestParam, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
const error = createErrorObject(e);
|
||||
|
||||
// このAPIでは個別のエラーメッセージは不要
|
||||
const errorMessage = getTranslationID("common.message.internalServerError");
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
import { RootState } from "app/store";
|
||||
|
||||
// 各値はそのまま画面に表示するので、licenseSummaryInfoとして値を取得する
|
||||
export const selectLicenseSummaryInfo = (state: RootState) =>
|
||||
export const selecLicenseSummaryInfo = (state: RootState) =>
|
||||
state.licenseSummary.domain.licenseSummaryInfo;
|
||||
|
||||
export const selectCompanyName = (state: RootState) =>
|
||||
state.licenseSummary.domain.accountInfo.companyName;
|
||||
|
||||
export const selectIsLoading = (state: RootState) =>
|
||||
state.licenseSummary.apps.isLoading;
|
||||
export const selectIsLoading = (state: RootState) => state.license;
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
export const ISSUED_TRIAL_LICENSE_QUANTITY = 10;
|
||||
export const TRIAL_LICENSE_EXPIRATION_DAY = 30;
|
||||
@ -1,5 +0,0 @@
|
||||
export * from "./state";
|
||||
export * from "./operations";
|
||||
export * from "./selectors";
|
||||
export * from "./licenseTrialIssueSlice";
|
||||
export * from "./constants";
|
||||
@ -1,60 +0,0 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
import { convertLocalToUTCDate } from "common/convertLocalToUTCDate";
|
||||
import { LicenseTrialIssueState } from "./state";
|
||||
import { issueTrialLicenseAsync } from "./operations";
|
||||
import {
|
||||
TRIAL_LICENSE_EXPIRATION_DAY,
|
||||
ISSUED_TRIAL_LICENSE_QUANTITY,
|
||||
} from "./constants";
|
||||
|
||||
const initialState: LicenseTrialIssueState = {
|
||||
apps: {
|
||||
isLoading: false,
|
||||
expirationDate: "",
|
||||
quantity: ISSUED_TRIAL_LICENSE_QUANTITY,
|
||||
},
|
||||
};
|
||||
export const licenseTrialIssueSlice = createSlice({
|
||||
name: "licenseTrialIssue",
|
||||
initialState,
|
||||
reducers: {
|
||||
cleanupApps: (state) => {
|
||||
state.apps = initialState.apps;
|
||||
},
|
||||
setExpirationDate: (state) => {
|
||||
// 有効期限を設定
|
||||
const currentDate = new Date();
|
||||
const expiryDate = new Date();
|
||||
expiryDate.setDate(currentDate.getDate() + TRIAL_LICENSE_EXPIRATION_DAY);
|
||||
// タイムゾーンオフセットを考慮して、ローカルタイムでの日付を取得
|
||||
const expirationDateLocal = convertLocalToUTCDate(expiryDate);
|
||||
const expirationDateWithoutTime = new Date(
|
||||
expirationDateLocal.getFullYear(),
|
||||
expirationDateLocal.getMonth(),
|
||||
expirationDateLocal.getDate()
|
||||
);
|
||||
const expirationYear = expirationDateWithoutTime.getFullYear();
|
||||
const expirationMonth = expirationDateWithoutTime.getMonth() + 1; // getMonth() の結果は0から始まるため、1を足して実際の月に合わせる
|
||||
const expirationDay = expirationDateWithoutTime.getDate();
|
||||
const formattedExpirationDate = `${expirationYear}/${expirationMonth}/${expirationDay} (${TRIAL_LICENSE_EXPIRATION_DAY})`;
|
||||
|
||||
state.apps.expirationDate = formattedExpirationDate;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(issueTrialLicenseAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(issueTrialLicenseAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(issueTrialLicenseAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export const { cleanupApps, setExpirationDate } =
|
||||
licenseTrialIssueSlice.actions;
|
||||
|
||||
export default licenseTrialIssueSlice.reducer;
|
||||
@ -1,84 +0,0 @@
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import type { RootState } from "app/store";
|
||||
import { getTranslationID } from "translation";
|
||||
import { openSnackbar } from "features/ui/uiSlice";
|
||||
import { getAccessToken } from "features/auth";
|
||||
import {
|
||||
LicensesApi,
|
||||
SearchPartner,
|
||||
PartnerLicenseInfo,
|
||||
} from "../../../api/api";
|
||||
import { Configuration } from "../../../api/configuration";
|
||||
import { ErrorObject, createErrorObject } from "../../../common/errors";
|
||||
|
||||
export const issueTrialLicenseAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{
|
||||
selectedRow?: PartnerLicenseInfo | SearchPartner;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("licenses/issueTrialLicenseAsync", async (args, thunkApi) => {
|
||||
const { selectedRow } = args;
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const licensesApi = new LicensesApi(config);
|
||||
|
||||
try {
|
||||
if (!selectedRow) {
|
||||
// アカウントが選択されていない場合はエラーとする。
|
||||
const errorMessage = getTranslationID(
|
||||
"trialLicenseIssuePopupPage.message.accountNotSelected"
|
||||
);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// トライアルライセンス発行処理を実行
|
||||
await licensesApi.issueTrialLicenses(
|
||||
{
|
||||
issuedAccount: selectedRow.accountId,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
const errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
@ -1,10 +0,0 @@
|
||||
import { RootState } from "app/store";
|
||||
|
||||
export const selectIsLoading = (state: RootState) =>
|
||||
state.licenseTrialIssue.apps.isLoading;
|
||||
|
||||
export const selectExpirationDate = (state: RootState) =>
|
||||
state.licenseTrialIssue.apps.expirationDate;
|
||||
|
||||
export const selectNumberOfLicenses = (state: RootState) =>
|
||||
state.licenseTrialIssue.apps.quantity;
|
||||
@ -1,9 +0,0 @@
|
||||
export interface LicenseTrialIssueState {
|
||||
apps: Apps;
|
||||
}
|
||||
|
||||
export interface Apps {
|
||||
isLoading: boolean;
|
||||
expirationDate: string;
|
||||
quantity: number;
|
||||
}
|
||||
@ -105,82 +105,3 @@ export const getPartnerLicenseAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const switchParentAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{
|
||||
// パラメータ
|
||||
to: number;
|
||||
children: number[];
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("accounts/switchParentAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountsApi = new AccountsApi(config);
|
||||
|
||||
const { to, children } = args;
|
||||
|
||||
try {
|
||||
await accountsApi.switchParent(
|
||||
{
|
||||
to,
|
||||
children,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
// TODO:エラー処理
|
||||
if (error.code === "E017001") {
|
||||
errorMessage = getTranslationID(
|
||||
"changeOwnerPopup.message.accountNotFoundError"
|
||||
);
|
||||
}
|
||||
|
||||
if (error.code === "E017002") {
|
||||
errorMessage = getTranslationID(
|
||||
"changeOwnerPopup.message.hierarchyMismatchError"
|
||||
);
|
||||
}
|
||||
|
||||
if (error.code === "E017003") {
|
||||
errorMessage = getTranslationID(
|
||||
"changeOwnerPopup.message.regionMismatchError"
|
||||
);
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
import { PartnerLicenseInfo } from "api";
|
||||
import { PartnerLicensesState, HierarchicalElement } from "./state";
|
||||
import {
|
||||
getMyAccountAsync,
|
||||
getPartnerLicenseAsync,
|
||||
switchParentAsync,
|
||||
} from "./operations";
|
||||
import { getMyAccountAsync, getPartnerLicenseAsync } from "./operations";
|
||||
import { ACCOUNTS_VIEW_LIMIT } from "./constants";
|
||||
|
||||
const initialState: PartnerLicensesState = {
|
||||
@ -16,8 +12,6 @@ const initialState: PartnerLicensesState = {
|
||||
tier: 0,
|
||||
country: "",
|
||||
delegationPermission: false,
|
||||
autoFileDelete: false,
|
||||
fileRetentionDays: 0,
|
||||
},
|
||||
total: 0,
|
||||
ownPartnerLicense: {
|
||||
@ -25,7 +19,6 @@ const initialState: PartnerLicensesState = {
|
||||
tier: 0,
|
||||
companyName: "",
|
||||
stockLicense: 0,
|
||||
allocatedLicense: 0,
|
||||
issuedRequested: 0,
|
||||
shortage: 0,
|
||||
issueRequesting: 0,
|
||||
@ -40,9 +33,6 @@ const initialState: PartnerLicensesState = {
|
||||
hierarchicalElements: [],
|
||||
isLoading: true,
|
||||
selectedRow: undefined,
|
||||
isLicenseOrderHistoryOpen: false,
|
||||
isViewDetailsOpen: false,
|
||||
isSearchPopupOpen: false,
|
||||
},
|
||||
};
|
||||
|
||||
@ -92,24 +82,6 @@ export const partnerLicenseSlice = createSlice({
|
||||
state.apps.limit = limit;
|
||||
state.apps.offset = offset;
|
||||
},
|
||||
setIsLicenseOrderHistoryOpen: (
|
||||
state,
|
||||
action: PayloadAction<{ value: boolean }>
|
||||
) => {
|
||||
state.apps.isLicenseOrderHistoryOpen = action.payload.value;
|
||||
},
|
||||
setIsViewDetailsOpen: (
|
||||
state,
|
||||
action: PayloadAction<{ value: boolean }>
|
||||
) => {
|
||||
state.apps.isViewDetailsOpen = action.payload.value;
|
||||
},
|
||||
setIsSearchPopupOpen: (
|
||||
state,
|
||||
action: PayloadAction<{ value: boolean }>
|
||||
) => {
|
||||
state.apps.isSearchPopupOpen = action.payload.value;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(getMyAccountAsync.pending, (state) => {
|
||||
@ -135,15 +107,6 @@ export const partnerLicenseSlice = createSlice({
|
||||
builder.addCase(getPartnerLicenseAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(switchParentAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(switchParentAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(switchParentAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
export const {
|
||||
@ -153,9 +116,6 @@ export const {
|
||||
clearHierarchicalElement,
|
||||
changeSelectedRow,
|
||||
savePageInfo,
|
||||
setIsLicenseOrderHistoryOpen,
|
||||
setIsViewDetailsOpen,
|
||||
setIsSearchPopupOpen,
|
||||
} = partnerLicenseSlice.actions;
|
||||
|
||||
export default partnerLicenseSlice.reducer;
|
||||
|
||||
@ -30,10 +30,3 @@ export const selectCurrentPage = (state: RootState) => {
|
||||
};
|
||||
export const selectSelectedRow = (state: RootState) =>
|
||||
state.partnerLicense.apps.selectedRow;
|
||||
|
||||
export const selectIsLicenseOrderHistoryOpen = (state: RootState) =>
|
||||
state.partnerLicense.apps.isLicenseOrderHistoryOpen;
|
||||
export const selectIsViewDetailsOpen = (state: RootState) =>
|
||||
state.partnerLicense.apps.isViewDetailsOpen;
|
||||
export const selectIsSearchPopupOpen = (state: RootState) =>
|
||||
state.partnerLicense.apps.isSearchPopupOpen;
|
||||
|
||||
@ -20,9 +20,6 @@ export interface Apps {
|
||||
hierarchicalElements: HierarchicalElement[];
|
||||
isLoading: boolean;
|
||||
selectedRow?: PartnerLicenseInfo;
|
||||
isLicenseOrderHistoryOpen: boolean;
|
||||
isViewDetailsOpen: boolean;
|
||||
isSearchPopupOpen: boolean;
|
||||
}
|
||||
|
||||
export interface HierarchicalElement {
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
export * from "./state";
|
||||
export * from "./operations";
|
||||
export * from "./selectors";
|
||||
export * from "./searchPartnerSlice";
|
||||
@ -1,96 +0,0 @@
|
||||
import { createAsyncThunk } from "@reduxjs/toolkit";
|
||||
import { getAccessToken } from "features/auth";
|
||||
import type { RootState } from "../../../app/store";
|
||||
import { getTranslationID } from "../../../translation";
|
||||
import { openSnackbar } from "../../ui/uiSlice";
|
||||
import { AccountsApi, SearchPartner, PartnerHierarchy } from "../../../api/api";
|
||||
import { Configuration } from "../../../api/configuration";
|
||||
import { ErrorObject, createErrorObject } from "../../../common/errors";
|
||||
|
||||
export const searchPartnersAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
SearchPartner[],
|
||||
// 引数
|
||||
{
|
||||
companyName?: string;
|
||||
accountId?: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("licenses/searchPartners", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { companyName, accountId } = args;
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountsApi = new AccountsApi(config);
|
||||
try {
|
||||
const searchPartnerResponse = await accountsApi.searchPartners(
|
||||
companyName,
|
||||
accountId,
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
return searchPartnerResponse.data.searchResult;
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const getPartnerHierarchy = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
PartnerHierarchy[],
|
||||
// 引数
|
||||
{
|
||||
accountId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("licenses/getPartnerHierarchy", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { accountId } = args;
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountsApi = new AccountsApi(config);
|
||||
try {
|
||||
const partnerHierarchyResponse = await accountsApi.getPartnerHierarchy(
|
||||
accountId,
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
return partnerHierarchyResponse.data.accountHierarchy;
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
@ -1,80 +0,0 @@
|
||||
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
import { SearchPartner } from "../../../api";
|
||||
import { SearchPartnerState } from "./state";
|
||||
import { searchPartnersAsync, getPartnerHierarchy } from "./operations";
|
||||
|
||||
const initialState: SearchPartnerState = {
|
||||
domain: {
|
||||
searchResult: [],
|
||||
partnerHierarchy: [],
|
||||
},
|
||||
apps: {
|
||||
isLoading: false,
|
||||
selectedRow: undefined,
|
||||
isLicenseOrderHistoryOpen: false,
|
||||
isViewDetailsOpen: false,
|
||||
},
|
||||
};
|
||||
|
||||
export const searchPartnersSlice = createSlice({
|
||||
name: "searchPartners",
|
||||
initialState,
|
||||
reducers: {
|
||||
changeSelectedRow: (
|
||||
state,
|
||||
action: PayloadAction<{ value?: SearchPartner }>
|
||||
) => {
|
||||
const { value } = action.payload;
|
||||
state.apps.selectedRow = value;
|
||||
},
|
||||
setIsLicenseOrderHistoryOpen: (
|
||||
state,
|
||||
action: PayloadAction<{ value: boolean }>
|
||||
) => {
|
||||
state.apps.isLicenseOrderHistoryOpen = action.payload.value;
|
||||
},
|
||||
setIsViewDetailsOpen: (
|
||||
state,
|
||||
action: PayloadAction<{ value: boolean }>
|
||||
) => {
|
||||
state.apps.isViewDetailsOpen = action.payload.value;
|
||||
},
|
||||
cleanupSearchResult: (state) => {
|
||||
state.domain.searchResult = initialState.domain.searchResult;
|
||||
},
|
||||
cleanupPartnerHierarchy: (state) => {
|
||||
state.domain.partnerHierarchy = initialState.domain.partnerHierarchy;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(searchPartnersAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(searchPartnersAsync.fulfilled, (state, action) => {
|
||||
state.domain.searchResult = action.payload;
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(searchPartnersAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getPartnerHierarchy.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(getPartnerHierarchy.fulfilled, (state, action) => {
|
||||
state.domain.partnerHierarchy = action.payload;
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getPartnerHierarchy.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
export const {
|
||||
changeSelectedRow,
|
||||
setIsLicenseOrderHistoryOpen,
|
||||
setIsViewDetailsOpen,
|
||||
cleanupSearchResult,
|
||||
cleanupPartnerHierarchy,
|
||||
} = searchPartnersSlice.actions;
|
||||
|
||||
export default searchPartnersSlice.reducer;
|
||||
@ -1,14 +0,0 @@
|
||||
import { RootState } from "../../../app/store";
|
||||
|
||||
export const selectSearchResult = (state: RootState) =>
|
||||
state.searchPartners.domain.searchResult;
|
||||
export const selectPartnerHierarchy = (state: RootState) =>
|
||||
state.searchPartners.domain.partnerHierarchy;
|
||||
export const selectIsLoading = (state: RootState) =>
|
||||
state.searchPartners.apps.isLoading;
|
||||
export const selectSelectedRow = (state: RootState) =>
|
||||
state.searchPartners.apps.selectedRow;
|
||||
export const selectIsLicenseOrderHistoryOpen = (state: RootState) =>
|
||||
state.searchPartners.apps.isLicenseOrderHistoryOpen;
|
||||
export const selectIsViewDetailsOpen = (state: RootState) =>
|
||||
state.searchPartners.apps.isViewDetailsOpen;
|
||||
@ -1,18 +0,0 @@
|
||||
import { SearchPartner, PartnerHierarchy } from "../../../api/api";
|
||||
|
||||
export interface SearchPartnerState {
|
||||
domain: Domain;
|
||||
apps: Apps;
|
||||
}
|
||||
|
||||
export interface Domain {
|
||||
searchResult: SearchPartner[];
|
||||
partnerHierarchy: PartnerHierarchy[];
|
||||
}
|
||||
|
||||
export interface Apps {
|
||||
isLoading: boolean;
|
||||
selectedRow?: SearchPartner;
|
||||
isLicenseOrderHistoryOpen: boolean;
|
||||
isViewDetailsOpen: boolean;
|
||||
}
|
||||
@ -8,8 +8,6 @@ import {
|
||||
AccountsApi,
|
||||
CreatePartnerAccountRequest,
|
||||
GetPartnersResponse,
|
||||
DeletePartnerAccountRequest,
|
||||
GetPartnerUsersResponse,
|
||||
} from "../../api/api";
|
||||
import { Configuration } from "../../api/configuration";
|
||||
|
||||
@ -118,170 +116,3 @@ export const getPartnerInfoAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
// パートナーアカウント削除
|
||||
export const deletePartnerAccountAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{
|
||||
// パラメータ
|
||||
accountId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("partner/deletePartnerAccountAsync", async (args, thunkApi) => {
|
||||
const { accountId } = args;
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountApi = new AccountsApi(config);
|
||||
|
||||
try {
|
||||
const deletePartnerAccountRequest: DeletePartnerAccountRequest = {
|
||||
targetAccountId: accountId,
|
||||
};
|
||||
await accountApi.deletePartnerAccount(deletePartnerAccountRequest, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let errorMessage = getTranslationID("common.message.internalServerError");
|
||||
if (error.code === "E018001") {
|
||||
errorMessage = getTranslationID(
|
||||
"partnerPage.message.partnerDeleteFailedError"
|
||||
);
|
||||
}
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
// パートナーアカウントユーザー取得
|
||||
export const getPartnerUsersAsync = createAsyncThunk<
|
||||
GetPartnerUsersResponse,
|
||||
{
|
||||
// パラメータ
|
||||
accountId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("partner/getPartnerUsersAsync", async (args, thunkApi) => {
|
||||
const { accountId } = args;
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountApi = new AccountsApi(config);
|
||||
|
||||
try {
|
||||
const res = await accountApi.getPartnerUsers(
|
||||
{ targetAccountId: accountId },
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
|
||||
return res.data;
|
||||
} catch (e) {
|
||||
const error = createErrorObject(e);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
// パートナーアカウントユーザー編集
|
||||
export const editPartnerInfoAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
void,
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("partner/editPartnerInfoAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountApi = new AccountsApi(config);
|
||||
|
||||
const { id, companyName, selectedAdminId } = state.partner.apps.editPartner;
|
||||
|
||||
try {
|
||||
await accountApi.updatePartnerInfo(
|
||||
{
|
||||
targetAccountId: id,
|
||||
primaryAdminUserId: selectedAdminId,
|
||||
companyName,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
|
||||
return {};
|
||||
} catch (e) {
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
if (error.code === "E010502" || error.code === "E020001") {
|
||||
errorMessage = getTranslationID("partnerPage.message.editFailedError");
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
import { PartnerState } from "./state";
|
||||
import {
|
||||
createPartnerAccountAsync,
|
||||
getPartnerInfoAsync,
|
||||
deletePartnerAccountAsync,
|
||||
getPartnerUsersAsync,
|
||||
editPartnerInfoAsync,
|
||||
} from "./operations";
|
||||
import { createPartnerAccountAsync, getPartnerInfoAsync } from "./operations";
|
||||
import { LIMIT_PARTNER_VIEW_NUM } from "./constants";
|
||||
|
||||
const initialState: PartnerState = {
|
||||
@ -23,13 +17,6 @@ const initialState: PartnerState = {
|
||||
adminName: "",
|
||||
email: "",
|
||||
},
|
||||
editPartner: {
|
||||
users: [],
|
||||
id: 0,
|
||||
companyName: "",
|
||||
country: "",
|
||||
selectedAdminId: 0,
|
||||
},
|
||||
limit: LIMIT_PARTNER_VIEW_NUM,
|
||||
offset: 0,
|
||||
isLoading: false,
|
||||
@ -88,37 +75,6 @@ export const partnerSlice = createSlice({
|
||||
state.apps.delegatedAccountId = undefined;
|
||||
state.apps.delegatedCompanyName = undefined;
|
||||
},
|
||||
changeEditPartner: (
|
||||
state,
|
||||
action: PayloadAction<{
|
||||
id: number;
|
||||
companyName: string;
|
||||
country: string;
|
||||
}>
|
||||
) => {
|
||||
const { id, companyName, country } = action.payload;
|
||||
|
||||
state.apps.editPartner.id = id;
|
||||
state.apps.editPartner.companyName = companyName;
|
||||
state.apps.editPartner.country = country;
|
||||
},
|
||||
changeEditCompanyName: (
|
||||
state,
|
||||
action: PayloadAction<{ companyName: string }>
|
||||
) => {
|
||||
const { companyName } = action.payload;
|
||||
state.apps.editPartner.companyName = companyName;
|
||||
},
|
||||
changeSelectedAdminId: (
|
||||
state,
|
||||
action: PayloadAction<{ adminId: number }>
|
||||
) => {
|
||||
const { adminId } = action.payload;
|
||||
state.apps.editPartner.selectedAdminId = adminId;
|
||||
},
|
||||
cleanupPartnerAccount: (state) => {
|
||||
state.apps.editPartner = initialState.apps.editPartner;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(createPartnerAccountAsync.pending, (state) => {
|
||||
@ -141,37 +97,6 @@ export const partnerSlice = createSlice({
|
||||
builder.addCase(getPartnerInfoAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deletePartnerAccountAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(deletePartnerAccountAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deletePartnerAccountAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getPartnerUsersAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(getPartnerUsersAsync.fulfilled, (state, action) => {
|
||||
const { users } = action.payload;
|
||||
state.apps.editPartner.users = users;
|
||||
state.apps.editPartner.selectedAdminId =
|
||||
users.find((user) => user.isPrimaryAdmin)?.id ?? 0;
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(getPartnerUsersAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(editPartnerInfoAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(editPartnerInfoAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(editPartnerInfoAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
export const {
|
||||
@ -183,9 +108,5 @@ export const {
|
||||
savePageInfo,
|
||||
changeDelegateAccount,
|
||||
cleanupDelegateAccount,
|
||||
changeEditPartner,
|
||||
changeEditCompanyName,
|
||||
changeSelectedAdminId,
|
||||
cleanupPartnerAccount,
|
||||
} = partnerSlice.actions;
|
||||
export default partnerSlice.reducer;
|
||||
|
||||
@ -62,17 +62,3 @@ export const selectDelegatedAccountId = (state: RootState) =>
|
||||
state.partner.apps.delegatedAccountId;
|
||||
export const selectDelegatedCompanyName = (state: RootState) =>
|
||||
state.partner.apps.delegatedCompanyName;
|
||||
|
||||
// edit
|
||||
export const selectEditPartnerId = (state: RootState) =>
|
||||
state.partner.apps.editPartner.id;
|
||||
export const selectEditPartnerCompanyName = (state: RootState) =>
|
||||
state.partner.apps.editPartner.companyName;
|
||||
export const selectEditPartnerCountry = (state: RootState) =>
|
||||
state.partner.apps.editPartner.country;
|
||||
|
||||
export const selectEditPartnerUsers = (state: RootState) =>
|
||||
state.partner.apps.editPartner.users;
|
||||
|
||||
export const selectSelectedAdminId = (state: RootState) =>
|
||||
state.partner.apps.editPartner.selectedAdminId;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import {
|
||||
CreatePartnerAccountRequest,
|
||||
GetPartnersResponse,
|
||||
PartnerUser,
|
||||
} from "../../api/api";
|
||||
|
||||
export interface PartnerState {
|
||||
@ -20,11 +19,4 @@ export interface Apps {
|
||||
isLoading: boolean;
|
||||
delegatedAccountId?: number;
|
||||
delegatedCompanyName?: string;
|
||||
editPartner: {
|
||||
users: PartnerUser[];
|
||||
id: number;
|
||||
companyName: string;
|
||||
country: string;
|
||||
selectedAdminId: number;
|
||||
};
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import {
|
||||
UsersApi,
|
||||
LicensesApi,
|
||||
GetAllocatableLicensesResponse,
|
||||
MultipleImportUser,
|
||||
} from "../../api/api";
|
||||
import { Configuration } from "../../api/configuration";
|
||||
import { ErrorObject, createErrorObject } from "../../common/errors";
|
||||
@ -18,7 +17,7 @@ export const listUsersAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
GetUsersResponse,
|
||||
// 引数
|
||||
undefined | { userInputUserName?: string; userInputEmail?: string },
|
||||
void,
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
@ -33,11 +32,9 @@ export const listUsersAsync = createAsyncThunk<
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
const userInputUserName = args?.userInputUserName;
|
||||
const userInputEmail = args?.userInputEmail;
|
||||
|
||||
try {
|
||||
const res = await usersApi.getUsers(userInputUserName, userInputEmail, {
|
||||
const res = await usersApi.getUsers({
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
@ -386,255 +383,3 @@ export const deallocateLicenseAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteUserAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
// 引数
|
||||
{
|
||||
userId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("users/deleteUserAsync", async (args, thunkApi) => {
|
||||
const { userId } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
|
||||
try {
|
||||
await usersApi.deleteUser(
|
||||
{
|
||||
userId,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
if (error.statusCode === 400) {
|
||||
if (error.code === "E014001") {
|
||||
// ユーザーが削除済みのため成功
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// ユーザーに有効なライセンスが割り当たっているため削除不可
|
||||
if (error.code === "E014007") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.userDeletionLicenseActiveError"
|
||||
);
|
||||
}
|
||||
// 管理者ユーザーため削除不可
|
||||
if (error.code === "E014002") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.adminUserDeletionError"
|
||||
);
|
||||
}
|
||||
// タイピストユーザーで担当タスクがあるため削除不可
|
||||
if (error.code === "E014009") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.typistUserDeletionTranscriptionTaskError"
|
||||
);
|
||||
}
|
||||
// タイピストユーザーでルーティングルールに設定されているため削除不可
|
||||
if (error.code === "E014004") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.typistDeletionRoutingRuleError"
|
||||
);
|
||||
}
|
||||
// タイピストユーザーでTranscriptionistGroupに所属しているため削除不可
|
||||
if (error.code === "E014005") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.typistUserDeletionTranscriptionistGroupError"
|
||||
);
|
||||
}
|
||||
// Authorユーザーで同一AuthorIDのタスクがあるため削除不可
|
||||
if (error.code === "E014006") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.authorUserDeletionTranscriptionTaskError"
|
||||
);
|
||||
}
|
||||
// Authorユーザーで同一AuthorIDがルーティングルールに設定されているため削除不可
|
||||
if (error.code === "E014003") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.authorDeletionRoutingRuleError"
|
||||
);
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const confirmUserForceAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
// 引数
|
||||
{
|
||||
userId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("users/confirmUserForceAsync", async (args, thunkApi) => {
|
||||
const { userId } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
|
||||
try {
|
||||
await usersApi.confirmUserForce(
|
||||
{
|
||||
userId,
|
||||
},
|
||||
{
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
}
|
||||
);
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換
|
||||
const error = createErrorObject(e);
|
||||
|
||||
let errorMessage = getTranslationID("common.message.internalServerError");
|
||||
|
||||
// ユーザーが既に認証済みのため、強制認証不可
|
||||
if (error.code === "E010202") {
|
||||
errorMessage = getTranslationID(
|
||||
"userListPage.message.alreadyEmailVerifiedError"
|
||||
);
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: errorMessage,
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const importUsersAsync = createAsyncThunk<
|
||||
// 正常時の戻り値の型
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
// 引数
|
||||
void,
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("users/importUsersAsync", async (args, thunkApi) => {
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const { importFileName, importUsers } = state.user.apps;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const usersApi = new UsersApi(config);
|
||||
|
||||
try {
|
||||
if (importFileName === undefined) {
|
||||
throw new Error("importFileName is undefined");
|
||||
}
|
||||
|
||||
// CSVデータをAPIに送信するためのデータに変換
|
||||
const users: MultipleImportUser[] = importUsers.map((user) => ({
|
||||
name: user.name ?? "",
|
||||
email: user.email ?? "",
|
||||
role: user.role ?? 0,
|
||||
authorId: user.author_id ?? undefined,
|
||||
autoRenew: user.auto_assign ?? 0,
|
||||
notification: user.notification ?? 0,
|
||||
encryption: user.encryption ?? undefined,
|
||||
encryptionPassword: user.encryption_password ?? undefined,
|
||||
prompt: user.prompt ?? undefined,
|
||||
}));
|
||||
|
||||
await usersApi.multipleImports(
|
||||
{
|
||||
filename: importFileName,
|
||||
users,
|
||||
},
|
||||
{ headers: { authorization: `Bearer ${accessToken}` } }
|
||||
);
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("userListPage.message.importSuccess"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換
|
||||
const error = createErrorObject(e);
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message: getTranslationID("common.message.internalServerError"),
|
||||
})
|
||||
);
|
||||
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -382,142 +382,3 @@ const convertValueBasedOnLicenseStatus = (
|
||||
remaining: undefined,
|
||||
};
|
||||
};
|
||||
|
||||
export const selectImportFileName = (state: RootState) =>
|
||||
state.user.apps.importFileName;
|
||||
|
||||
export const selectImportValidationErrors = (state: RootState) => {
|
||||
const csvUsers = state.user.apps.importUsers;
|
||||
|
||||
let rowNumber = 1;
|
||||
const invalidInput: number[] = [];
|
||||
|
||||
const duplicatedEmailsMap = new Map<string, number>();
|
||||
const duplicatedAuthorIdsMap = new Map<string, number>();
|
||||
const overMaxRow = csvUsers.length > 100;
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const csvUser of csvUsers) {
|
||||
rowNumber += 1;
|
||||
|
||||
// メールアドレスの重複がある場合、エラーとしてその行番号を追加する
|
||||
const duplicatedEmailUser = csvUsers.filter(
|
||||
(x) => x.email === csvUser.email
|
||||
);
|
||||
if (duplicatedEmailUser.length > 1) {
|
||||
if (csvUser.email !== null && !duplicatedEmailsMap.has(csvUser.email)) {
|
||||
duplicatedEmailsMap.set(csvUser.email, rowNumber);
|
||||
}
|
||||
}
|
||||
|
||||
// AuthorIDの重複がある場合、エラーとしてその行番号を追加する
|
||||
const duplicatedAuthorIdUser = csvUsers.filter(
|
||||
(x) => x.author_id === csvUser.author_id
|
||||
);
|
||||
if (duplicatedAuthorIdUser.length > 1) {
|
||||
if (
|
||||
csvUser.author_id !== null &&
|
||||
!duplicatedAuthorIdsMap.has(csvUser.author_id)
|
||||
) {
|
||||
duplicatedAuthorIdsMap.set(csvUser.author_id, rowNumber);
|
||||
}
|
||||
}
|
||||
|
||||
// name
|
||||
if (csvUser.name === null || csvUser.name.length > 225) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// email
|
||||
const emailPattern =
|
||||
/^[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]+@[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*\.[a-zA-Z0-9!#$%&'_`/=~+\-?^{|}.]*[a-zA-Z]$/;
|
||||
if (
|
||||
csvUser.name === null ||
|
||||
csvUser.name.length > 225 ||
|
||||
!emailPattern.test(csvUser.email ?? "")
|
||||
) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// role
|
||||
if (csvUser.role === null || ![0, 1, 2].includes(csvUser.role)) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// role=1(Author)
|
||||
if (csvUser.role === 1) {
|
||||
// author_id
|
||||
if (csvUser.author_id === null || csvUser.author_id.length > 16) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
// 半角英数字と_の組み合わせで16文字まで
|
||||
const charaTypePattern = /^[A-Z0-9_]{1,16}$/;
|
||||
const charaType = new RegExp(charaTypePattern).test(csvUser.author_id);
|
||||
if (!charaType) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// encryption
|
||||
if (csvUser.encryption === null || ![0, 1].includes(csvUser.encryption)) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
if (csvUser.encryption === 1) {
|
||||
// encryption_password
|
||||
if (csvUser.encryption === 1) {
|
||||
const regex = /^[!-~]{4,16}$/;
|
||||
if (!regex.test(csvUser.encryption_password ?? "")) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// prompt
|
||||
if (csvUser.prompt === null || ![0, 1].includes(csvUser.prompt)) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// auto_assign
|
||||
if (csvUser.auto_assign === null || ![0, 1].includes(csvUser.auto_assign)) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// notification
|
||||
if (
|
||||
csvUser.notification === null ||
|
||||
![0, 1].includes(csvUser.notification)
|
||||
) {
|
||||
invalidInput.push(rowNumber);
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const duplicatedEmails = Array.from(duplicatedEmailsMap.values());
|
||||
const duplicatedAuthorIds = Array.from(duplicatedAuthorIdsMap.values());
|
||||
|
||||
return {
|
||||
invalidInput,
|
||||
duplicatedEmails,
|
||||
duplicatedAuthorIds,
|
||||
overMaxRow,
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import { CSVType } from "common/parser";
|
||||
import { User, AllocatableLicenseInfo } from "../../api/api";
|
||||
import { AddUser, UpdateUser, LicenseAllocateUser } from "./types";
|
||||
|
||||
@ -20,6 +19,4 @@ export interface Apps {
|
||||
selectedlicenseId: number;
|
||||
hasPasswordMask: boolean;
|
||||
isLoading: boolean;
|
||||
importFileName: string | undefined;
|
||||
importUsers: CSVType[];
|
||||
}
|
||||
|
||||
@ -54,14 +54,14 @@ export interface LicenseAllocateUser {
|
||||
remaining?: number;
|
||||
}
|
||||
|
||||
export type RoleType = (typeof USER_ROLES)[keyof typeof USER_ROLES];
|
||||
export type RoleType = typeof USER_ROLES[keyof typeof USER_ROLES];
|
||||
|
||||
// 受け取った値がUSER_ROLESの型であるかどうかを判定する
|
||||
export const isRoleType = (role: string): role is RoleType =>
|
||||
Object.values(USER_ROLES).includes(role as RoleType);
|
||||
|
||||
export type LicenseStatusType =
|
||||
(typeof LICENSE_STATUS)[keyof typeof LICENSE_STATUS];
|
||||
typeof LICENSE_STATUS[keyof typeof LICENSE_STATUS];
|
||||
|
||||
// 受け取った値がLicenseStatusTypeの型であるかどうかを判定する
|
||||
export const isLicenseStatusType = (
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
import { USER_ROLES } from "components/auth/constants";
|
||||
import { CSVType } from "common/parser";
|
||||
import { UsersState } from "./state";
|
||||
import {
|
||||
addUserAsync,
|
||||
@ -8,8 +7,6 @@ import {
|
||||
updateUserAsync,
|
||||
getAllocatableLicensesAsync,
|
||||
deallocateLicenseAsync,
|
||||
deleteUserAsync,
|
||||
importUsersAsync,
|
||||
} from "./operations";
|
||||
import { RoleType, UserView } from "./types";
|
||||
|
||||
@ -63,8 +60,6 @@ const initialState: UsersState = {
|
||||
selectedlicenseId: 0,
|
||||
hasPasswordMask: false,
|
||||
isLoading: false,
|
||||
importFileName: undefined,
|
||||
importUsers: [],
|
||||
},
|
||||
};
|
||||
|
||||
@ -246,21 +241,6 @@ export const userSlice = createSlice({
|
||||
state.apps.licenseAllocateUser = initialState.apps.licenseAllocateUser;
|
||||
state.apps.selectedlicenseId = initialState.apps.selectedlicenseId;
|
||||
},
|
||||
changeImportFileName: (
|
||||
state,
|
||||
action: PayloadAction<{ fileName: string }>
|
||||
) => {
|
||||
const { fileName } = action.payload;
|
||||
state.apps.importFileName = fileName;
|
||||
},
|
||||
changeImportCsv: (state, action: PayloadAction<{ users: CSVType[] }>) => {
|
||||
const { users } = action.payload;
|
||||
state.apps.importUsers = users;
|
||||
},
|
||||
cleanupImportUsers: (state) => {
|
||||
state.apps.importFileName = initialState.apps.importFileName;
|
||||
state.apps.importUsers = initialState.apps.importUsers;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
builder.addCase(listUsersAsync.pending, (state) => {
|
||||
@ -310,24 +290,6 @@ export const userSlice = createSlice({
|
||||
builder.addCase(deallocateLicenseAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteUserAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(deleteUserAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteUserAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(importUsersAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(importUsersAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(importUsersAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@ -355,9 +317,6 @@ export const {
|
||||
changeLicenseAllocateUser,
|
||||
changeSelectedlicenseId,
|
||||
cleanupLicenseAllocateInfo,
|
||||
changeImportFileName,
|
||||
changeImportCsv,
|
||||
cleanupImportUsers,
|
||||
} = userSlice.actions;
|
||||
|
||||
export default userSlice.reducer;
|
||||
|
||||
@ -115,78 +115,3 @@ export const uploadTemplateAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteTemplateAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{ templateFileId: number },
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("workflow/deleteTemplateAsync", async (args, thunkApi) => {
|
||||
const { templateFileId } = args;
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const templateApi = new TemplatesApi(config);
|
||||
|
||||
try {
|
||||
// ファイルを削除する
|
||||
await templateApi.deleteTemplateFile(templateFileId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
if (error.code === "E016001") {
|
||||
// テンプレートファイルが削除済みの場合は成功扱いとする
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
}
|
||||
|
||||
let message = getTranslationID("common.message.internalServerError");
|
||||
|
||||
// テンプレートファイルがルーティングルールに紐づく場合はエラー
|
||||
if (error.code === "E016002") {
|
||||
message = getTranslationID(
|
||||
"templateFilePage.message.deleteFailedWorkflowAssigned"
|
||||
);
|
||||
}
|
||||
// テンプレートファイルが未完了のタスクに紐づく場合はエラー
|
||||
if (error.code === "E016003") {
|
||||
message = getTranslationID(
|
||||
"templateFilePage.message.deleteFailedTaskAssigned"
|
||||
);
|
||||
}
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "error",
|
||||
message,
|
||||
})
|
||||
);
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
|
||||
import { TemplateState } from "./state";
|
||||
import {
|
||||
deleteTemplateAsync,
|
||||
listTemplateAsync,
|
||||
uploadTemplateAsync,
|
||||
} from "./operations";
|
||||
import { listTemplateAsync, uploadTemplateAsync } from "./operations";
|
||||
|
||||
const initialState: TemplateState = {
|
||||
apps: {
|
||||
@ -49,15 +45,6 @@ export const templateSlice = createSlice({
|
||||
builder.addCase(uploadTemplateAsync.rejected, (state) => {
|
||||
state.apps.isUploading = false;
|
||||
});
|
||||
builder.addCase(deleteTemplateAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(deleteTemplateAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteTemplateAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -269,70 +269,3 @@ export const updateTypistGroupAsync = createAsyncThunk<
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
export const deleteTypistGroupAsync = createAsyncThunk<
|
||||
{
|
||||
/* Empty Object */
|
||||
},
|
||||
{
|
||||
typistGroupId: number;
|
||||
},
|
||||
{
|
||||
// rejectした時の返却値の型
|
||||
rejectValue: {
|
||||
error: ErrorObject;
|
||||
};
|
||||
}
|
||||
>("workflow/deleteTypistGroupAsync", async (args, thunkApi) => {
|
||||
const { typistGroupId } = args;
|
||||
|
||||
// apiのConfigurationを取得する
|
||||
const { getState } = thunkApi;
|
||||
const state = getState() as RootState;
|
||||
const { configuration } = state.auth;
|
||||
const accessToken = getAccessToken(state.auth);
|
||||
const config = new Configuration(configuration);
|
||||
const accountsApi = new AccountsApi(config);
|
||||
|
||||
try {
|
||||
await accountsApi.deleteTypistGroup(typistGroupId, {
|
||||
headers: { authorization: `Bearer ${accessToken}` },
|
||||
});
|
||||
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
} catch (e) {
|
||||
// e ⇒ errorObjectに変換"
|
||||
const error = createErrorObject(e);
|
||||
|
||||
// すでに削除されていた場合は成功扱いする
|
||||
if (error.code === "E015001") {
|
||||
thunkApi.dispatch(
|
||||
openSnackbar({
|
||||
level: "info",
|
||||
message: getTranslationID("common.message.success"),
|
||||
})
|
||||
);
|
||||
return {};
|
||||
}
|
||||
|
||||
// 以下は実際の削除失敗
|
||||
let message = getTranslationID("common.message.internalServerError");
|
||||
if (error.code === "E015002")
|
||||
message = getTranslationID(
|
||||
"typistGroupSetting.message.deleteFailedWorkflowAssigned"
|
||||
);
|
||||
if (error.code === "E015003")
|
||||
message = getTranslationID(
|
||||
"typistGroupSetting.message.deleteFailedCheckoutPermissionExisted"
|
||||
);
|
||||
|
||||
thunkApi.dispatch(openSnackbar({ level: "error", message }));
|
||||
return thunkApi.rejectWithValue({ error });
|
||||
}
|
||||
});
|
||||
|
||||
@ -6,7 +6,6 @@ import {
|
||||
listTypistGroupsAsync,
|
||||
listTypistsAsync,
|
||||
updateTypistGroupAsync,
|
||||
deleteTypistGroupAsync,
|
||||
} from "./operations";
|
||||
|
||||
const initialState: TypistGroupState = {
|
||||
@ -107,15 +106,6 @@ export const typistGroupSlice = createSlice({
|
||||
builder.addCase(updateTypistGroupAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteTypistGroupAsync.pending, (state) => {
|
||||
state.apps.isLoading = true;
|
||||
});
|
||||
builder.addCase(deleteTypistGroupAsync.fulfilled, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
builder.addCase(deleteTypistGroupAsync.rejected, (state) => {
|
||||
state.apps.isLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { OPTION_ITEMS_DEFAULT_VALUE_TYPE } from "./constants";
|
||||
|
||||
// OPTION_ITEMS_DEFAULT_VALUE_TYPEからOptionItemDefaultValueTypeを作成する
|
||||
export type OptionItemsDefaultValueType =
|
||||
(typeof OPTION_ITEMS_DEFAULT_VALUE_TYPE)[keyof typeof OPTION_ITEMS_DEFAULT_VALUE_TYPE];
|
||||
typeof OPTION_ITEMS_DEFAULT_VALUE_TYPE[keyof typeof OPTION_ITEMS_DEFAULT_VALUE_TYPE];
|
||||
|
||||
// 受け取った値がOptionItemDefaultValueType型かどうかを判定する
|
||||
export const isOptionItemDefaultValueType = (
|
||||
|
||||
@ -1,169 +0,0 @@
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
selectInputValidationErrors,
|
||||
selectFileDeleteSetting,
|
||||
updateFileDeleteSettingAsync,
|
||||
selectIsLoading,
|
||||
getAccountRelationsAsync,
|
||||
} from "features/account";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import styles from "../../styles/app.module.scss";
|
||||
import { getTranslationID } from "../../translation";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import {
|
||||
changeAutoFileDelete,
|
||||
changeFileRetentionDays,
|
||||
} from "../../features/account/accountSlice";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
interface FileDeleteSettingPopupProps {
|
||||
// eslint-disable-next-line react/no-unused-prop-types
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const FileDeleteSettingPopup: React.FC<FileDeleteSettingPopupProps> = (
|
||||
props
|
||||
) => {
|
||||
const { onClose } = props;
|
||||
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const [t] = useTranslation();
|
||||
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
const fileDeleteSetting = useSelector(selectFileDeleteSetting);
|
||||
const { hasFileRetentionDaysError } = useSelector(
|
||||
selectInputValidationErrors
|
||||
);
|
||||
|
||||
const closePopup = useCallback(() => {
|
||||
if (isLoading) return;
|
||||
onClose();
|
||||
}, [isLoading, onClose]);
|
||||
|
||||
const [isPushSubmitButton, setIsPushSubmitButton] = useState<boolean>(false);
|
||||
|
||||
const onUpdateFileDeleteSetting = useCallback(async () => {
|
||||
if (isLoading) return;
|
||||
setIsPushSubmitButton(true);
|
||||
if (hasFileRetentionDaysError) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(
|
||||
updateFileDeleteSettingAsync({
|
||||
autoFileDelete: fileDeleteSetting.autoFileDelete,
|
||||
fileRetentionDays: fileDeleteSetting.fileRetentionDays,
|
||||
})
|
||||
);
|
||||
setIsPushSubmitButton(false);
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
closePopup();
|
||||
dispatch(getAccountRelationsAsync());
|
||||
}
|
||||
}, [
|
||||
closePopup,
|
||||
dispatch,
|
||||
fileDeleteSetting.autoFileDelete,
|
||||
fileDeleteSetting.fileRetentionDays,
|
||||
hasFileRetentionDaysError,
|
||||
isLoading,
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className={`${styles.modal} ${styles.isShow}`}>
|
||||
<div className={styles.modalBox}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("fileDeleteSettingPopup.label.title"))}
|
||||
<button type="button" onClick={closePopup}>
|
||||
<img src={close} className={styles.modalTitleIcon} alt="close" />
|
||||
</button>
|
||||
</p>
|
||||
<form className={styles.form}>
|
||||
<dl className={`${styles.formList} ${styles.hasbg}`}>
|
||||
<dt className={styles.formTitle} />
|
||||
<dt>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"fileDeleteSettingPopup.label.autoFileDeleteCheck"
|
||||
)
|
||||
)}
|
||||
</dt>
|
||||
<dd className={styles.last}>
|
||||
<p>
|
||||
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
className={styles.formCheck}
|
||||
checked={fileDeleteSetting.autoFileDelete}
|
||||
onChange={(e) => {
|
||||
dispatch(
|
||||
changeAutoFileDelete({
|
||||
autoFileDelete: e.target.checked,
|
||||
})
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
</p>
|
||||
<p className={styles.txWsline}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"fileDeleteSettingPopup.label.daysAnnotation"
|
||||
)
|
||||
)}
|
||||
</p>
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
max={999}
|
||||
value={fileDeleteSetting.fileRetentionDays}
|
||||
className={`${styles.formInput} ${styles.short}`}
|
||||
disabled={!fileDeleteSetting.autoFileDelete}
|
||||
onChange={(e) => {
|
||||
dispatch(
|
||||
changeFileRetentionDays({
|
||||
fileRetentionDays: Number(e.target.value),
|
||||
})
|
||||
);
|
||||
}}
|
||||
/>{" "}
|
||||
{t(getTranslationID("fileDeleteSettingPopup.label.days"))}
|
||||
{isPushSubmitButton && hasFileRetentionDaysError && (
|
||||
<span className={styles.formError}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"fileDeleteSettingPopup.label.daysValidationError"
|
||||
)
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
</dd>
|
||||
<dd className={`${styles.full} ${styles.alignCenter}`}>
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(
|
||||
getTranslationID("fileDeleteSettingPopup.label.saveButton")
|
||||
)}
|
||||
className={`${styles.formSubmit} ${styles.marginBtm1} ${
|
||||
!isLoading ? styles.isActive : ""
|
||||
}`}
|
||||
onClick={onUpdateFileDeleteSetting}
|
||||
disabled={isLoading}
|
||||
/>
|
||||
</dd>
|
||||
<img
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
src={progress_activit}
|
||||
className={styles.icLoading}
|
||||
alt="Loading"
|
||||
/>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@ -1,4 +1,5 @@
|
||||
import { AppDispatch } from "app/store";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import Footer from "components/footer";
|
||||
import Header from "components/header";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
@ -22,7 +23,6 @@ import { getTranslationID } from "translation";
|
||||
import { TIERS } from "components/auth/constants";
|
||||
import { isApproveTier } from "features/auth";
|
||||
import { DeleteAccountPopup } from "./deleteAccountPopup";
|
||||
import { FileDeleteSettingPopup } from "./fileDeleteSettingPopup";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
const AccountPage: React.FC = (): JSX.Element => {
|
||||
@ -40,17 +40,10 @@ const AccountPage: React.FC = (): JSX.Element => {
|
||||
const [isDeleteAccountPopupOpen, setIsDeleteAccountPopupOpen] =
|
||||
useState(false);
|
||||
|
||||
const [isFileDeleteSettingPopupOpen, setIsFileDeleteSettingPopupOpen] =
|
||||
useState(false);
|
||||
|
||||
const onDeleteAccountOpen = useCallback(() => {
|
||||
setIsDeleteAccountPopupOpen(true);
|
||||
}, [setIsDeleteAccountPopupOpen]);
|
||||
|
||||
const onDeleteFileDeleteSettingOpen = useCallback(() => {
|
||||
setIsFileDeleteSettingPopupOpen(true);
|
||||
}, [setIsFileDeleteSettingPopupOpen]);
|
||||
|
||||
// 階層表示用
|
||||
const tierNames: { [key: number]: string } = {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
@ -96,15 +89,9 @@ const AccountPage: React.FC = (): JSX.Element => {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isFileDeleteSettingPopupOpen && (
|
||||
<FileDeleteSettingPopup
|
||||
onClose={() => {
|
||||
setIsFileDeleteSettingPopupOpen(false);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div className={styles.wrap}>
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
@ -115,13 +102,12 @@ const AccountPage: React.FC = (): JSX.Element => {
|
||||
|
||||
<section className={styles.account}>
|
||||
<div className={styles.boxFlex}>
|
||||
{/* File Delete Setting は現状不要のため非表示
|
||||
<ul className={`${styles.menuAction} ${styles.box100}`}>
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
href="account_setting.html"
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={onDeleteFileDeleteSettingOpen}
|
||||
data-tag="open-file-delete-setting-popup"
|
||||
>
|
||||
<img
|
||||
src="images/file_delete.svg"
|
||||
@ -134,6 +120,7 @@ const AccountPage: React.FC = (): JSX.Element => {
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
*/}
|
||||
|
||||
<div className={styles.marginRgt3}>
|
||||
<dl className={styles.listVertical}>
|
||||
@ -229,23 +216,9 @@ const AccountPage: React.FC = (): JSX.Element => {
|
||||
)
|
||||
)}
|
||||
</dd>
|
||||
<dd
|
||||
style={{ paddingBottom: 0 }}
|
||||
className={`${styles.full}`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{!isTier5 && <dd>-</dd>}
|
||||
<dt>
|
||||
{t(
|
||||
getTranslationID("accountPage.label.fileRetentionDays")
|
||||
)}
|
||||
</dt>
|
||||
<dd>
|
||||
{viewInfo.account.autoFileDelete
|
||||
? viewInfo.account.fileRetentionDays
|
||||
: "-"}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,15 +1,13 @@
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import React, { useCallback } from "react";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useSelector } from "react-redux";
|
||||
import {
|
||||
selectSelectedFileTask,
|
||||
selectIsLoading,
|
||||
PRIORITY,
|
||||
renameFileAsync,
|
||||
} from "features/dictation";
|
||||
import { getTranslationID } from "translation";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { AppDispatch } from "app/store";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import lock from "../../assets/images/lock.svg";
|
||||
|
||||
@ -21,55 +19,14 @@ interface FilePropertyPopupProps {
|
||||
export const FilePropertyPopup: React.FC<FilePropertyPopupProps> = (props) => {
|
||||
const { onClose, isOpen } = props;
|
||||
const [t] = useTranslation();
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
const [isPushSaveButton, setIsPushSaveButton] = useState<boolean>(false);
|
||||
|
||||
// ポップアップを閉じる処理
|
||||
const closePopup = useCallback(() => {
|
||||
setIsPushSaveButton(false);
|
||||
onClose(false);
|
||||
}, [onClose]);
|
||||
const selectedFileTask = useSelector(selectSelectedFileTask);
|
||||
|
||||
const [fileName, setFileName] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
setFileName(selectedFileTask?.fileName ?? "");
|
||||
}
|
||||
}, [selectedFileTask, isOpen]);
|
||||
|
||||
// ファイル名の保存処理
|
||||
const saveFileName = useCallback(async () => {
|
||||
setIsPushSaveButton(true);
|
||||
if (fileName.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ダイアログ確認
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(t(getTranslationID("common.message.dialogConfirm")))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(
|
||||
renameFileAsync({
|
||||
audioFileId: selectedFileTask?.audioFileId ?? 0,
|
||||
fileName,
|
||||
})
|
||||
);
|
||||
|
||||
setIsPushSaveButton(false);
|
||||
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
onClose(true);
|
||||
}
|
||||
}, [t, dispatch, onClose, fileName, selectedFileTask]);
|
||||
|
||||
return (
|
||||
<div className={`${styles.modal} ${isOpen ? styles.isShow : ""}`}>
|
||||
<div className={styles.modalBox}>
|
||||
@ -88,41 +45,7 @@ export const FilePropertyPopup: React.FC<FilePropertyPopupProps> = (props) => {
|
||||
{t(getTranslationID("filePropertyPopup.label.general"))}
|
||||
</dt>
|
||||
<dt>{t(getTranslationID("dictationPage.label.fileName"))}</dt>
|
||||
<dd className={styles.hasInput}>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
maxLength={64}
|
||||
value={fileName}
|
||||
className={`${styles.formInput} ${styles.short} ${
|
||||
isPushSaveButton && fileName.length === 0 && styles.isError
|
||||
}`}
|
||||
onChange={(e) => setFileName(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(getTranslationID("dictationPage.label.fileNameSave"))}
|
||||
className={`${styles.formSubmit} ${styles.isActive}`}
|
||||
style={{
|
||||
position: "relative",
|
||||
marginTop: "0.2rem",
|
||||
right: "auto",
|
||||
maxWidth: "18rem",
|
||||
whiteSpace: "normal",
|
||||
overflowWrap: "break-word",
|
||||
fontSize: "small",
|
||||
}}
|
||||
onClick={saveFileName}
|
||||
/>
|
||||
{isPushSaveButton && fileName.length === 0 && (
|
||||
<span className={styles.formError}>
|
||||
{t(getTranslationID("common.message.inputEmptyError"))}
|
||||
</span>
|
||||
)}
|
||||
</dd>
|
||||
<dt>{t(getTranslationID("dictationPage.label.rawFileName"))}</dt>
|
||||
<dd>{selectedFileTask?.rawFileName ?? ""}</dd>
|
||||
<dd>{selectedFileTask?.fileName.replace(".zip", "") ?? ""}</dd>
|
||||
<dt>{t(getTranslationID("dictationPage.label.fileSize"))}</dt>
|
||||
<dd>{selectedFileTask?.fileSize ?? ""}</dd>
|
||||
<dt>{t(getTranslationID("dictationPage.label.fileLength"))}</dt>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,203 +0,0 @@
|
||||
import React, { useState, useCallback } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
selectChildrenPartnerLicenses,
|
||||
selectIsLoading,
|
||||
selectOwnPartnerLicense,
|
||||
} from "features/license/partnerLicense/selectors";
|
||||
import {
|
||||
getMyAccountAsync,
|
||||
switchParentAsync,
|
||||
} from "features/license/partnerLicense/operations";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getTranslationID } from "translation";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { clearHierarchicalElement } from "features/license/partnerLicense";
|
||||
import styles from "../../styles/app.module.scss";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import shuffle from "../../assets/images/shuffle.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
interface ChangeOwnerPopupProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const ChangeOwnerPopup: React.FC<ChangeOwnerPopupProps> = (props) => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [selectedChildId, setSelectedChildId] = useState<number | null>(null);
|
||||
const [selectedChildName, setSelectedChildName] = useState<string>("");
|
||||
const [destinationParentId, setDestinationParentId] = useState<string>("");
|
||||
const [error, setError] = useState<string>("");
|
||||
|
||||
const originParentLicenseInfo = useSelector(selectOwnPartnerLicense);
|
||||
const childrenLicenseInfos = useSelector(selectChildrenPartnerLicenses);
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
const { onClose } = props;
|
||||
const closePopup = useCallback(() => {
|
||||
if (isLoading) return;
|
||||
onClose();
|
||||
}, [isLoading, onClose]);
|
||||
|
||||
const bulkDisplayName = "-- Bulk --";
|
||||
const bulkValue = "bulk";
|
||||
|
||||
const onBulkChange = useCallback(
|
||||
(e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const { value } = e.target;
|
||||
const childId = value === bulkValue ? null : Number(value);
|
||||
setSelectedChildId(childId);
|
||||
|
||||
// 一括追加のときは子アカウント名を表示しない
|
||||
let childName = "";
|
||||
if (childId) {
|
||||
const child = childrenLicenseInfos.find((c) => c.accountId === childId);
|
||||
// childがundefinedになることはないが、コード解析対応のためのチェック
|
||||
if (child) {
|
||||
childName = child.companyName;
|
||||
}
|
||||
}
|
||||
setSelectedChildName(childName);
|
||||
},
|
||||
[childrenLicenseInfos]
|
||||
);
|
||||
|
||||
const onSaveClick = useCallback(async () => {
|
||||
const destinationParentIdNum = Number(destinationParentId);
|
||||
if (
|
||||
Number.isNaN(destinationParentIdNum) || // 数値でない場合
|
||||
destinationParentIdNum <= 0 || // IDにならない数値の場合
|
||||
destinationParentId.length > 7 // 8桁以上の場合(本システムの特徴として8桁以上になることはあり得ない)
|
||||
) {
|
||||
setError(t(getTranslationID("changeOwnerPopup.label.invalidInputError")));
|
||||
return;
|
||||
}
|
||||
setError("");
|
||||
if (
|
||||
// eslint-disable-next-line no-alert
|
||||
!window.confirm(t(getTranslationID("common.message.dialogConfirm")))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const children = selectedChildId
|
||||
? [selectedChildId]
|
||||
: childrenLicenseInfos.map((child) => child.accountId);
|
||||
const { meta } = await dispatch(
|
||||
switchParentAsync({ to: Number(destinationParentId), children })
|
||||
);
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(getMyAccountAsync());
|
||||
dispatch(clearHierarchicalElement());
|
||||
closePopup();
|
||||
}
|
||||
}, [
|
||||
childrenLicenseInfos,
|
||||
closePopup,
|
||||
destinationParentId,
|
||||
dispatch,
|
||||
selectedChildId,
|
||||
t,
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className={`${styles.modal} ${styles.isShow}`}>
|
||||
<div className={styles.modalBox}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("changeOwnerPopup.label.title"))}
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */}
|
||||
<img
|
||||
src={close}
|
||||
className={styles.modalTitleIcon}
|
||||
alt="close"
|
||||
onClick={closePopup}
|
||||
/>
|
||||
</p>
|
||||
<form action="" name="" method="" className={styles.form}>
|
||||
<dl className={`${styles.formList} ${styles.hasbg}`}>
|
||||
<dt className={styles.formTitle} />
|
||||
<dt>
|
||||
{t(getTranslationID("changeOwnerPopup.label.upperLayerId"))}
|
||||
</dt>
|
||||
<dd className={styles.ownerChange}>
|
||||
<p className={styles.Owner}>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
name=""
|
||||
value={originParentLicenseInfo.accountId}
|
||||
readOnly
|
||||
className={`${styles.formInput} ${styles.short}`}
|
||||
/>
|
||||
<span className={styles.txName}>
|
||||
{originParentLicenseInfo.companyName}
|
||||
</span>
|
||||
</p>
|
||||
<p className={styles.arrowR} />
|
||||
<p className={styles.newOwner}>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
name=""
|
||||
value={destinationParentId}
|
||||
placeholder=" "
|
||||
className={`${styles.formInput} ${styles.short}`}
|
||||
onChange={(e) => setDestinationParentId(e.target.value)}
|
||||
/>
|
||||
<span className={styles.formError}>{error}</span>
|
||||
</p>
|
||||
</dd>
|
||||
<dd className={styles.full}>
|
||||
<img src={shuffle} className={styles.transOwner} alt="" />
|
||||
</dd>
|
||||
<dt>
|
||||
{t(getTranslationID("changeOwnerPopup.label.lowerLayerId"))}
|
||||
</dt>
|
||||
<dd className={styles.lowerTrans}>
|
||||
<select
|
||||
name=""
|
||||
className={`${styles.formInput} ${styles.short}`}
|
||||
value={selectedChildId ?? bulkDisplayName}
|
||||
onChange={onBulkChange}
|
||||
>
|
||||
<option value={bulkValue}>{bulkDisplayName}</option>
|
||||
{childrenLicenseInfos.map((child) => (
|
||||
<option key={child.accountId} value={child.accountId}>
|
||||
{child.accountId}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<span className={styles.txName}>{selectedChildName}</span>
|
||||
</dd>
|
||||
<dd className={`${styles.full} ${styles.alignCenter}`}>
|
||||
{/* 処理中や子アカウントが1件も存在しない場合、Saveボタンを押せないようにする */}
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(getTranslationID("common.label.save"))}
|
||||
className={`${styles.formSubmit} ${styles.marginBtm1} ${
|
||||
!isLoading && childrenLicenseInfos.length > 0
|
||||
? styles.isActive
|
||||
: ""
|
||||
}`}
|
||||
onClick={onSaveClick}
|
||||
disabled={isLoading || childrenLicenseInfos.length <= 0}
|
||||
/>
|
||||
</dd>
|
||||
|
||||
<img
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
src={progress_activit}
|
||||
className={styles.icLoading}
|
||||
alt="Loading"
|
||||
/>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChangeOwnerPopup;
|
||||
@ -1,5 +1,6 @@
|
||||
/* eslint-disable jsx-a11y/control-has-associated-label */
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import { isApproveTier } from "features/auth";
|
||||
import { TIERS } from "components/auth/constants";
|
||||
import Footer from "components/footer";
|
||||
@ -12,7 +13,6 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
LIMIT_ORDER_HISORY_NUM,
|
||||
STATUS,
|
||||
LICENSE_TYPE,
|
||||
getLicenseOrderHistoriesAsync,
|
||||
selectCurrentPage,
|
||||
selectIsLoading,
|
||||
@ -26,21 +26,20 @@ import {
|
||||
selectCompanyName,
|
||||
cancelIssueAsync,
|
||||
} from "features/license/licenseOrderHistory";
|
||||
import { selectSelectedRow } from "features/license/partnerLicense";
|
||||
import { selectDelegationAccessToken } from "features/auth/selectors";
|
||||
import { DelegationBar } from "components/delegate";
|
||||
import { LicenseOrder, SearchPartner, PartnerLicenseInfo } from "api/api";
|
||||
import undo from "../../assets/images/undo.svg";
|
||||
import history from "../../assets/images/history.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
interface LicenseOrderHistoryProps {
|
||||
onReturn: () => void;
|
||||
selectedRow?: PartnerLicenseInfo | SearchPartner;
|
||||
}
|
||||
export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
props
|
||||
): JSX.Element => {
|
||||
const { onReturn, selectedRow } = props;
|
||||
const { onReturn } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const [t] = useTranslation();
|
||||
const total = useSelector(selectTotal);
|
||||
@ -48,6 +47,7 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
const offset = useSelector(selectOffset);
|
||||
const currentPage = useSelector(selectCurrentPage);
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
const selectedRow = useSelector(selectSelectedRow);
|
||||
// 代行操作用のトークンを取得する
|
||||
const delegationAccessToken = useSelector(selectDelegationAccessToken);
|
||||
|
||||
@ -65,7 +65,6 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
getLicenseOrderHistoriesAsync({
|
||||
limit: LIMIT_ORDER_HISORY_NUM,
|
||||
offset,
|
||||
selectedRow,
|
||||
})
|
||||
);
|
||||
};
|
||||
@ -153,15 +152,11 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
getLicenseOrderHistoriesAsync({
|
||||
limit: LIMIT_ORDER_HISORY_NUM,
|
||||
offset,
|
||||
selectedRow,
|
||||
})
|
||||
);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [dispatch, currentPage]);
|
||||
|
||||
const isNotTrialLicense = (license: LicenseOrder) =>
|
||||
license.type !== LICENSE_TYPE.TRIAL;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`${styles.wrap} ${delegationAccessToken ? styles.manage : ""}`}
|
||||
@ -171,6 +166,7 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
delegationAccessToken && <DelegationBar />
|
||||
}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
@ -214,11 +210,6 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
getTranslationID("orderHistoriesPage.label.issueDate")
|
||||
)}
|
||||
</th>
|
||||
<th>
|
||||
{t(
|
||||
getTranslationID("orderHistoriesPage.label.licenseType")
|
||||
)}
|
||||
</th>
|
||||
<th>
|
||||
{t(
|
||||
getTranslationID(
|
||||
@ -240,10 +231,9 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
// eslint-disable-next-line react/jsx-key
|
||||
<tr>
|
||||
<td>{x.orderDate}</td>
|
||||
<td>{x.issueDate ?? "-"}</td>
|
||||
<td>{x.type}</td>
|
||||
<td>{x.issueDate ? x.issueDate : "-"}</td>
|
||||
<td>{x.numberOfOrder}</td>
|
||||
<td>{x.poNumber ?? "-"}</td>
|
||||
<td>{x.poNumber}</td>
|
||||
<td>
|
||||
{(() => {
|
||||
switch (x.status) {
|
||||
@ -271,7 +261,7 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
})()}
|
||||
</td>
|
||||
<td>
|
||||
{!selectedRow && isNotTrialLicense(x) && (
|
||||
{!selectedRow && (
|
||||
<ul
|
||||
className={`${styles.menuAction} ${styles.inTable}`}
|
||||
>
|
||||
@ -296,7 +286,7 @@ export const LicenseOrderHistory: React.FC<LicenseOrderHistoryProps> = (
|
||||
</li>
|
||||
</ul>
|
||||
)}
|
||||
{selectedRow && isNotTrialLicense(x) && (
|
||||
{selectedRow && (
|
||||
<ul
|
||||
className={`${styles.menuAction} ${styles.inTable}`}
|
||||
>
|
||||
|
||||
@ -45,10 +45,9 @@ export const LicenseOrderPopup: React.FC<LicenseOrderPopupProps> = (props) => {
|
||||
|
||||
// ポップアップを閉じる処理
|
||||
const closePopup = useCallback(() => {
|
||||
if (isLoading) return;
|
||||
setIsPushOrderButton(false);
|
||||
onClose();
|
||||
}, [isLoading, onClose]);
|
||||
}, [onClose]);
|
||||
|
||||
// 画面からのパラメータ
|
||||
const poNumber = useSelector(selectPoNumber);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import Footer from "components/footer";
|
||||
import Header from "components/header";
|
||||
import styles from "styles/app.module.scss";
|
||||
@ -9,16 +10,12 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
getCompanyNameAsync,
|
||||
getLicenseSummaryAsync,
|
||||
selectLicenseSummaryInfo,
|
||||
selecLicenseSummaryInfo,
|
||||
selectCompanyName,
|
||||
selectIsLoading,
|
||||
updateRestrictionStatusAsync,
|
||||
} from "features/license/licenseSummary";
|
||||
import { selectSelectedRow } from "features/license/partnerLicense";
|
||||
import { selectDelegationAccessToken } from "features/auth/selectors";
|
||||
import { DelegationBar } from "components/delegate";
|
||||
import { TIERS } from "components/auth/constants";
|
||||
import { isAdminUser, isApproveTier } from "features/auth/utils";
|
||||
import { PartnerLicenseInfo, SearchPartner } from "../../api";
|
||||
import postAdd from "../../assets/images/post_add.svg";
|
||||
import history from "../../assets/images/history.svg";
|
||||
import key from "../../assets/images/key.svg";
|
||||
@ -27,31 +24,26 @@ import circle from "../../assets/images/circle.svg";
|
||||
import returnLabel from "../../assets/images/undo.svg";
|
||||
import { LicenseOrderPopup } from "./licenseOrderPopup";
|
||||
import { CardLicenseActivatePopup } from "./cardLicenseActivatePopup";
|
||||
import { TrialLicenseIssuePopup } from "./trialLicenseIssuePopup";
|
||||
// eslint-disable-next-line import/no-named-as-default
|
||||
import LicenseOrderHistory from "./licenseOrderHistory";
|
||||
|
||||
interface LicenseSummaryProps {
|
||||
onReturn?: () => void;
|
||||
selectedRow?: PartnerLicenseInfo | SearchPartner;
|
||||
}
|
||||
export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
props
|
||||
): JSX.Element => {
|
||||
const { onReturn, selectedRow } = props;
|
||||
const { onReturn } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const [t] = useTranslation();
|
||||
const selectedRow = useSelector(selectSelectedRow);
|
||||
// 代行操作用のトークンを取得する
|
||||
const delegationAccessToken = useSelector(selectDelegationAccessToken);
|
||||
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
// popup制御関係
|
||||
const [islicenseOrderPopupOpen, setIslicenseOrderPopupOpen] = useState(false);
|
||||
const [isCardLicenseActivatePopupOpen, setIsCardLicenseActivatePopupOpen] =
|
||||
useState(false);
|
||||
const [isTrialLicenseIssuePopupOpen, setIsTrialLicenseIssuePopupOpen] =
|
||||
useState(false);
|
||||
|
||||
const onlicenseOrderOpen = useCallback(() => {
|
||||
setIslicenseOrderPopupOpen(true);
|
||||
@ -61,10 +53,6 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
setIsCardLicenseActivatePopupOpen(true);
|
||||
}, [setIsCardLicenseActivatePopupOpen]);
|
||||
|
||||
const onTrialLicenseIssueOpen = useCallback(() => {
|
||||
setIsTrialLicenseIssuePopupOpen(true);
|
||||
}, [setIsTrialLicenseIssuePopupOpen]);
|
||||
|
||||
// 呼び出し画面制御関係
|
||||
const [islicenseOrderHistoryOpen, setIsLicenseOrderHistoryOpen] =
|
||||
useState(false);
|
||||
@ -74,13 +62,9 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
}, [setIsLicenseOrderHistoryOpen]);
|
||||
|
||||
// apiからの値取得関係
|
||||
const licenseSummaryInfo = useSelector(selectLicenseSummaryInfo);
|
||||
const licenseSummaryInfo = useSelector(selecLicenseSummaryInfo);
|
||||
const companyName = useSelector(selectCompanyName);
|
||||
|
||||
const isTier1 = isApproveTier([TIERS.TIER1]);
|
||||
const isTier2 = isApproveTier([TIERS.TIER2]);
|
||||
const isAdmin = isAdminUser();
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(getLicenseSummaryAsync({ selectedRow }));
|
||||
dispatch(getCompanyNameAsync({ selectedRow }));
|
||||
@ -94,35 +78,6 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
}
|
||||
}, [onReturn]);
|
||||
|
||||
const onStorageAvailableChange = useCallback(
|
||||
async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(
|
||||
t(
|
||||
getTranslationID(
|
||||
"LicenseSummaryPage.message.storageUnavalableSwitchingConfirm"
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const restricted = e.target.checked;
|
||||
const accountId = selectedRow?.accountId;
|
||||
// 本関数が実行されるときはselectedRowが存在する前提のため、accountIdが存在しない場合の処理は不要
|
||||
if (!accountId) return;
|
||||
const { meta } = await dispatch(
|
||||
updateRestrictionStatusAsync({ accountId, restricted })
|
||||
);
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(getLicenseSummaryAsync({ selectedRow }));
|
||||
}
|
||||
},
|
||||
[dispatch, selectedRow, t]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* isPopupOpenがfalseの場合はポップアップのhtmlを生成しないように対応。これによりポップアップは都度生成されて初期化の考慮が減る */}
|
||||
@ -141,21 +96,11 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isTrialLicenseIssuePopupOpen && (
|
||||
<TrialLicenseIssuePopup
|
||||
onClose={() => {
|
||||
setIsTrialLicenseIssuePopupOpen(false);
|
||||
dispatch(getLicenseSummaryAsync({ selectedRow }));
|
||||
}}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
)}
|
||||
{islicenseOrderHistoryOpen && (
|
||||
<LicenseOrderHistory
|
||||
onReturn={() => {
|
||||
setIsLicenseOrderHistoryOpen(false);
|
||||
}}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
)}
|
||||
{!islicenseOrderHistoryOpen && (
|
||||
@ -166,6 +111,8 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div className="">
|
||||
<div className={styles.pageHeader}>
|
||||
@ -246,30 +193,6 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{/* 第一階層、第二階層の管理者が第五階層アカウントのライセンス情報を見ている場合は、トライアルライセンス注文ボタンを表示 */}
|
||||
{selectedRow &&
|
||||
isAdmin &&
|
||||
selectedRow.tier.toString() === TIERS.TIER5 &&
|
||||
(isTier1 || isTier2) && (
|
||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={onTrialLicenseIssueOpen}
|
||||
>
|
||||
<img
|
||||
src={postAdd}
|
||||
alt=""
|
||||
className={styles.menuIcon}
|
||||
/>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"LicenseSummaryPage.label.issueTrialLicense"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
</ul>
|
||||
<div className={styles.marginRgt3}>
|
||||
<dl
|
||||
@ -349,27 +272,6 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
{isTier1 && isAdmin && (
|
||||
<p
|
||||
className={`${styles.checkAvail} ${styles.alignRight}`}
|
||||
>
|
||||
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
className={styles.formCheck}
|
||||
checked={licenseSummaryInfo.isStorageAvailable}
|
||||
disabled={isLoading}
|
||||
onChange={onStorageAvailableChange}
|
||||
/>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"LicenseSummaryPage.label.storageUnavailableCheckbox"
|
||||
)
|
||||
)}
|
||||
</label>
|
||||
</p>
|
||||
)}
|
||||
<dl
|
||||
className={`${styles.listVertical} ${styles.marginBtm3}`}
|
||||
>
|
||||
@ -387,31 +289,17 @@ export const LicenseSummary: React.FC<LicenseSummaryProps> = (
|
||||
)
|
||||
)}
|
||||
</dt>
|
||||
<dd>
|
||||
{/** Byte単位で受け取った値をGB単位で表示するため1000^3で割っている(小数点以下第三位まで表示で第四位で四捨五入) */}
|
||||
{(
|
||||
licenseSummaryInfo.storageSize /
|
||||
1000 /
|
||||
1000 /
|
||||
1000
|
||||
).toFixed(3)}
|
||||
GB
|
||||
</dd>
|
||||
{/* Storage Usedの値表示をハイフンに置き換え */}
|
||||
{/* <dd>{licenseSummaryInfo.storageSize}GB</dd> */}
|
||||
<dd>-</dd>
|
||||
<dt>
|
||||
{t(
|
||||
getTranslationID("LicenseSummaryPage.label.usedSize")
|
||||
)}
|
||||
</dt>
|
||||
<dd>
|
||||
{/** Byte単位で受け取った値をGB単位で表示するため1000^3で割っている(小数点以下第三位まで表示で第四位で四捨五入) */}
|
||||
{(
|
||||
licenseSummaryInfo.usedSize /
|
||||
1000 /
|
||||
1000 /
|
||||
1000
|
||||
).toFixed(3)}
|
||||
GB
|
||||
</dd>
|
||||
{/* Storage Usedの値表示をハイフンに置き換え */}
|
||||
{/* <dd>{licenseSummaryInfo.usedSize}GB</dd> */}
|
||||
<dd>-</dd>
|
||||
<dt className={styles.overLine}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
|
||||
@ -1,57 +1,42 @@
|
||||
import { PartnerLicenseInfo } from "api";
|
||||
import { AppDispatch } from "app/store";
|
||||
import React, { useCallback, useState, useEffect } from "react";
|
||||
import Footer from "components/footer";
|
||||
import Header from "components/header";
|
||||
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { getTranslationID } from "translation";
|
||||
import changeOwnerIcon from "../../assets/images/change_circle.svg";
|
||||
import history from "../../assets/images/history.svg";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { PartnerLicenseInfo } from "api";
|
||||
import { CardLicenseIssuePopup } from "./cardLicenseIssuePopup";
|
||||
import postAdd from "../../assets/images/post_add.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
import history from "../../assets/images/history.svg";
|
||||
import returnLabel from "../../assets/images/undo.svg";
|
||||
import searchIcon from "../../assets/images/search.svg";
|
||||
import { TIERS } from "../../components/auth/constants";
|
||||
import { isApproveTier } from "../../features/auth/utils";
|
||||
import { TIERS } from "../../components/auth/constants";
|
||||
import {
|
||||
ACCOUNTS_VIEW_LIMIT,
|
||||
changeSelectedRow,
|
||||
getMyAccountAsync,
|
||||
getPartnerLicenseAsync,
|
||||
popHierarchicalElement,
|
||||
ACCOUNTS_VIEW_LIMIT,
|
||||
selectMyAccountInfo,
|
||||
selectTotal,
|
||||
selectOwnPartnerLicense,
|
||||
selectChildrenPartnerLicenses,
|
||||
selectHierarchicalElements,
|
||||
selectTotalPage,
|
||||
selectIsLoading,
|
||||
selectOffset,
|
||||
selectCurrentPage,
|
||||
pushHierarchicalElement,
|
||||
popHierarchicalElement,
|
||||
spliceHierarchicalElement,
|
||||
savePageInfo,
|
||||
setIsLicenseOrderHistoryOpen,
|
||||
setIsViewDetailsOpen,
|
||||
selectChildrenPartnerLicenses,
|
||||
selectCurrentPage,
|
||||
selectHierarchicalElements,
|
||||
selectIsLoading,
|
||||
selectMyAccountInfo,
|
||||
selectOffset,
|
||||
selectOwnPartnerLicense,
|
||||
selectTotal,
|
||||
selectTotalPage,
|
||||
selectSelectedRow,
|
||||
selectIsLicenseOrderHistoryOpen,
|
||||
selectIsViewDetailsOpen,
|
||||
setIsSearchPopupOpen,
|
||||
selectIsSearchPopupOpen,
|
||||
getMyAccountAsync,
|
||||
changeSelectedRow,
|
||||
} from "../../features/license/partnerLicense";
|
||||
|
||||
import {
|
||||
selectIsViewDetailsOpen as selectIsViewDetailsInSearchOpen,
|
||||
selectIsLicenseOrderHistoryOpen as selectIsLicenseOrderHistoryInSearchOpen,
|
||||
} from "../../features/license/searchPartner";
|
||||
import { CardLicenseIssuePopup } from "./cardLicenseIssuePopup";
|
||||
import ChangeOwnerPopup from "./changeOwnerPopup";
|
||||
import { LicenseOrderHistory } from "./licenseOrderHistory";
|
||||
import { LicenseOrderPopup } from "./licenseOrderPopup";
|
||||
import { LicenseOrderHistory } from "./licenseOrderHistory";
|
||||
import { LicenseSummary } from "./licenseSummary";
|
||||
import { SearchPartnerPopup } from "./searchPartnerAccountPopup";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
@ -61,22 +46,9 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
const [isCardLicenseIssuePopupOpen, setIsCardLicenseIssuePopupOpen] =
|
||||
useState(false);
|
||||
const [islicenseOrderPopupOpen, setIslicenseOrderPopupOpen] = useState(false);
|
||||
|
||||
// パートナーライセンス画面のOrderHistory, ViewDetailsの表示制御
|
||||
const isLicenseOrderHistoryOpen = useSelector(
|
||||
selectIsLicenseOrderHistoryOpen
|
||||
);
|
||||
const isViewDetailsOpen = useSelector(selectIsViewDetailsOpen);
|
||||
|
||||
// パートナー検索ポップアップのOrderHistory, ViewDetailsの表示制御
|
||||
const isLicenseOrderHistoryInSearchOpen = useSelector(
|
||||
selectIsLicenseOrderHistoryInSearchOpen
|
||||
);
|
||||
const isViewDetailsInSearchOpen = useSelector(
|
||||
selectIsViewDetailsInSearchOpen
|
||||
);
|
||||
const isSearchPopupOpen = useSelector(selectIsSearchPopupOpen);
|
||||
const [isChangeOwnerPopupOpen, setIsChangeOwnerPopupOpen] = useState(false);
|
||||
const [islicenseOrderHistoryOpen, setIslicenseOrderHistoryOpen] =
|
||||
useState(false);
|
||||
const [isViewDetailsOpen, setIsViewDetailsOpen] = useState(false);
|
||||
|
||||
// 階層表示用
|
||||
const tierNames: { [key: number]: string } = {
|
||||
@ -110,7 +82,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
);
|
||||
const hierarchicalElements = useSelector(selectHierarchicalElements);
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
const selectedRow = useSelector(selectSelectedRow) as PartnerLicenseInfo;
|
||||
|
||||
// ページネーション制御用
|
||||
const currentPage = useSelector(selectCurrentPage);
|
||||
@ -163,29 +134,20 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
const onClickViewDetails = useCallback(
|
||||
(value?: PartnerLicenseInfo) => {
|
||||
dispatch(changeSelectedRow({ value }));
|
||||
dispatch(setIsViewDetailsOpen({ value: true }));
|
||||
setIsViewDetailsOpen(true);
|
||||
},
|
||||
[dispatch]
|
||||
[dispatch, setIsViewDetailsOpen]
|
||||
);
|
||||
|
||||
// orderHistoryボタン押下時
|
||||
const onClickOrderHistory = useCallback(
|
||||
(value?: PartnerLicenseInfo) => {
|
||||
dispatch(changeSelectedRow({ value }));
|
||||
dispatch(setIsLicenseOrderHistoryOpen({ value: true }));
|
||||
setIslicenseOrderHistoryOpen(true);
|
||||
},
|
||||
[dispatch]
|
||||
[dispatch, setIslicenseOrderHistoryOpen]
|
||||
);
|
||||
|
||||
// changeOwnerボタン押下時
|
||||
const onClickChangeOwner = useCallback(() => {
|
||||
setIsChangeOwnerPopupOpen(true);
|
||||
}, [setIsChangeOwnerPopupOpen]);
|
||||
|
||||
const onOpenSearchPopup = useCallback(() => {
|
||||
dispatch(setIsSearchPopupOpen({ value: true }));
|
||||
}, [dispatch]);
|
||||
|
||||
// マウント時のみ実行
|
||||
useEffect(() => {
|
||||
dispatch(getMyAccountAsync());
|
||||
@ -207,8 +169,7 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
}, [myAccountInfo]);
|
||||
|
||||
// 現在の表示階層に合わせたボタン制御用
|
||||
const [showOrderHistoryButton, setShowOrderHistoryButton] = useState(false);
|
||||
const [showViewDetailsButton, setShowViewDetailsButton] = useState(false);
|
||||
const [buttonLabel, setButtonLabel] = useState("");
|
||||
|
||||
// パンくずリスト用stateに自アカウントを追加
|
||||
useEffect(() => {
|
||||
@ -226,17 +187,15 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
);
|
||||
}
|
||||
// 表内のボタン表示判定
|
||||
if (ownPartnerLicenseInfo.tier !== 4) {
|
||||
setShowOrderHistoryButton(true);
|
||||
setShowViewDetailsButton(false);
|
||||
if (hierarchicalElements.length === 1 && ownPartnerLicenseInfo.tier !== 4) {
|
||||
setButtonLabel(
|
||||
t(getTranslationID("partnerLicense.label.orderHistoryButton"))
|
||||
);
|
||||
} else if (ownPartnerLicenseInfo.tier === 4) {
|
||||
setShowOrderHistoryButton(true);
|
||||
setShowViewDetailsButton(true);
|
||||
setButtonLabel(t(getTranslationID("partnerLicense.label.viewDetails")));
|
||||
} else {
|
||||
setShowOrderHistoryButton(false);
|
||||
setShowViewDetailsButton(false);
|
||||
setButtonLabel("");
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [ownPartnerLicenseInfo]);
|
||||
|
||||
@ -255,21 +214,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [hierarchicalElements, currentPage]);
|
||||
|
||||
// パートナーライセンス画面からも検索ポップアップからもOrder History/View Detailsが表示されていない時に表示
|
||||
const isVisiblePartnerLicensePage = useMemo(
|
||||
() =>
|
||||
!isLicenseOrderHistoryInSearchOpen &&
|
||||
!isViewDetailsInSearchOpen &&
|
||||
!isLicenseOrderHistoryOpen &&
|
||||
!isViewDetailsOpen,
|
||||
[
|
||||
isLicenseOrderHistoryInSearchOpen,
|
||||
isViewDetailsInSearchOpen,
|
||||
isLicenseOrderHistoryOpen,
|
||||
isViewDetailsOpen,
|
||||
]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* isPopupOpenがfalseの場合はポップアップのhtmlを生成しないように対応。これによりポップアップは都度生成されて初期化の考慮が減る */}
|
||||
@ -287,37 +231,24 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isLicenseOrderHistoryOpen && (
|
||||
{islicenseOrderHistoryOpen && (
|
||||
<LicenseOrderHistory
|
||||
onReturn={() => {
|
||||
dispatch(setIsLicenseOrderHistoryOpen({ value: false }));
|
||||
setIslicenseOrderHistoryOpen(false);
|
||||
}}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
)}
|
||||
{isViewDetailsOpen && (
|
||||
<LicenseSummary
|
||||
onReturn={() => {
|
||||
dispatch(setIsViewDetailsOpen({ value: false }));
|
||||
}}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
)}
|
||||
{isChangeOwnerPopupOpen && (
|
||||
<ChangeOwnerPopup
|
||||
onClose={() => {
|
||||
setIsChangeOwnerPopupOpen(false);
|
||||
setIsViewDetailsOpen(false);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{isVisiblePartnerSearch() && isSearchPopupOpen && (
|
||||
<SearchPartnerPopup
|
||||
onClose={() => dispatch(setIsSearchPopupOpen({ value: true }))}
|
||||
/>
|
||||
)}
|
||||
{isVisiblePartnerLicensePage && (
|
||||
{!islicenseOrderHistoryOpen && !isViewDetailsOpen && (
|
||||
<div className={styles.wrap}>
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div className="">
|
||||
<div className={styles.pageHeader}>
|
||||
@ -398,42 +329,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{isVisibleChangeOwner(ownPartnerLicenseInfo.tier) && (
|
||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={onClickChangeOwner}
|
||||
>
|
||||
<img
|
||||
src={changeOwnerIcon}
|
||||
alt=""
|
||||
className={styles.menuIcon}
|
||||
/>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerLicense.label.changeOwnerButton"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
<li className={styles.floatRight}>
|
||||
{isVisiblePartnerSearch() && (
|
||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive} ${styles.alignRight}`}
|
||||
onClick={onOpenSearchPopup}
|
||||
>
|
||||
<img
|
||||
src={searchIcon}
|
||||
alt="search"
|
||||
className={styles.menuIcon}
|
||||
/>
|
||||
{t(getTranslationID("partnerLicense.label.search"))}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
</ul>
|
||||
<ul className={styles.brCrumbLicense}>
|
||||
{hierarchicalElements.map((value) => (
|
||||
@ -460,13 +355,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
<th>
|
||||
{t(getTranslationID("partnerLicense.label.stockLicense"))}
|
||||
</th>
|
||||
<th>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerLicense.label.allocatedLicense"
|
||||
)
|
||||
)}
|
||||
</th>
|
||||
<th>
|
||||
{t(
|
||||
getTranslationID("partnerLicense.label.issueRequested")
|
||||
@ -492,13 +380,12 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
? ownPartnerLicenseInfo.stockLicense
|
||||
: "-"}
|
||||
</td>
|
||||
<td>-</td>
|
||||
<td>{ownPartnerLicenseInfo.issuedRequested}</td>
|
||||
<td>
|
||||
<span
|
||||
className={
|
||||
ownPartnerLicenseInfo.shortage > 0 &&
|
||||
ownPartnerLicenseInfo.tier !== 1
|
||||
ownPartnerLicenseInfo.tier !== 1
|
||||
? styles.isAlert
|
||||
: ""
|
||||
}
|
||||
@ -536,7 +423,6 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
<td>{tierNames[value.tier]}</td>
|
||||
<td>{value.accountId}</td>
|
||||
<td>{value.stockLicense}</td>
|
||||
<td>{value.tier === 5 ? value.allocatedLicense : "-"}</td>
|
||||
<td>{value.issuedRequested}</td>
|
||||
<td>
|
||||
<span
|
||||
@ -553,38 +439,20 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
className={`${styles.menuLink} ${showOrderHistoryButton ? styles.isActive : ""
|
||||
}`}
|
||||
className={`${styles.menuLink} ${
|
||||
buttonLabel ? styles.isActive : ""
|
||||
}`}
|
||||
onClick={() => {
|
||||
onClickOrderHistory(value);
|
||||
if (ownPartnerLicenseInfo.tier === 4) {
|
||||
onClickViewDetails(value);
|
||||
} else {
|
||||
onClickOrderHistory(value);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerLicense.label.orderHistoryButton"
|
||||
)
|
||||
)}
|
||||
{buttonLabel}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{/* Second button (only if tier is 4) */}
|
||||
{showViewDetailsButton && (
|
||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
||||
<a
|
||||
className={`${styles.menuLink} ${showViewDetailsButton ? styles.isActive : ""
|
||||
}`}
|
||||
onClick={() => {
|
||||
onClickViewDetails(value);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerLicense.label.viewDetails"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
)}
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -612,8 +480,9 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
onClick={() => {
|
||||
movePage(0);
|
||||
}}
|
||||
className={` ${!isLoading && currentPage !== 1 ? styles.isActive : ""
|
||||
}`}
|
||||
className={` ${
|
||||
!isLoading && currentPage !== 1 ? styles.isActive : ""
|
||||
}`}
|
||||
>
|
||||
«
|
||||
</a>
|
||||
@ -622,22 +491,25 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
onClick={() => {
|
||||
movePage((currentPage - 2) * ACCOUNTS_VIEW_LIMIT);
|
||||
}}
|
||||
className={`${!isLoading && currentPage !== 1 ? styles.isActive : ""
|
||||
}`}
|
||||
className={`${
|
||||
!isLoading && currentPage !== 1 ? styles.isActive : ""
|
||||
}`}
|
||||
>
|
||||
‹
|
||||
</a>
|
||||
{` ${total !== 0 ? currentPage : 0} of ${total !== 0 ? totalPage : 0
|
||||
} `}
|
||||
{` ${total !== 0 ? currentPage : 0} of ${
|
||||
total !== 0 ? totalPage : 0
|
||||
} `}
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
onClick={() => {
|
||||
movePage(currentPage * ACCOUNTS_VIEW_LIMIT);
|
||||
}}
|
||||
className={`${!isLoading && currentPage < totalPage
|
||||
className={`${
|
||||
!isLoading && currentPage < totalPage
|
||||
? styles.isActive
|
||||
: ""
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
›
|
||||
</a>
|
||||
@ -646,10 +518,11 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
onClick={() => {
|
||||
movePage((totalPage - 1) * ACCOUNTS_VIEW_LIMIT);
|
||||
}}
|
||||
className={` ${!isLoading && currentPage < totalPage
|
||||
className={` ${
|
||||
!isLoading && currentPage < totalPage
|
||||
? styles.isActive
|
||||
: ""
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
»
|
||||
</a>
|
||||
@ -672,14 +545,4 @@ const PartnerLicense: React.FC = (): JSX.Element => {
|
||||
);
|
||||
};
|
||||
|
||||
const isVisibleChangeOwner = (partnerTier: number) =>
|
||||
// 自身が第一階層または第二階層で、表示しているパートナーが第三階層または第四階層の場合のみ表示
|
||||
isApproveTier([TIERS.TIER1, TIERS.TIER2]) &&
|
||||
(partnerTier.toString() === TIERS.TIER3 ||
|
||||
partnerTier.toString() === TIERS.TIER4);
|
||||
|
||||
const isVisiblePartnerSearch = () =>
|
||||
// 自身が第一階層〜第四階層の場合のみ表示
|
||||
isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]);
|
||||
|
||||
export default PartnerLicense;
|
||||
|
||||
@ -1,354 +0,0 @@
|
||||
import { SearchPartner } from "api";
|
||||
import React, {
|
||||
useState,
|
||||
useEffect,
|
||||
useRef,
|
||||
useCallback,
|
||||
useMemo,
|
||||
} from "react";
|
||||
import { AppDispatch } from "app/store";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getTranslationID } from "translation";
|
||||
import { useSelector, useDispatch } from "react-redux";
|
||||
import {
|
||||
changeSelectedRow,
|
||||
cleanupSearchResult,
|
||||
cleanupPartnerHierarchy,
|
||||
setIsLicenseOrderHistoryOpen,
|
||||
setIsViewDetailsOpen,
|
||||
searchPartnersAsync,
|
||||
selectIsLoading,
|
||||
selectSelectedRow,
|
||||
selectSearchResult,
|
||||
selectPartnerHierarchy,
|
||||
selectIsLicenseOrderHistoryOpen,
|
||||
selectIsViewDetailsOpen,
|
||||
getPartnerHierarchy,
|
||||
} from "features/license/searchPartner";
|
||||
import { setIsSearchPopupOpen } from "features/license/partnerLicense";
|
||||
import { LicenseSummary } from "./licenseSummary";
|
||||
import { LicenseOrderHistory } from "./licenseOrderHistory";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import searchIcon from "../../assets/images/search.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
interface SearchPopupProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const SearchPartnerPopup: React.FC<SearchPopupProps> = (props) => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { onClose } = props;
|
||||
const [t] = useTranslation();
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
const selectedRow = useSelector(selectSelectedRow) as SearchPartner;
|
||||
const searchResult = useSelector(selectSearchResult);
|
||||
const partnerHierarchy = useSelector(selectPartnerHierarchy);
|
||||
const [accountId, setAccountId] = useState("");
|
||||
const [companyName, setCompanyName] = useState("");
|
||||
const [isBreadcrumbOpen, setIsBreadcrumbOpen] = useState(false);
|
||||
const isViewDetailsOpen = useSelector(selectIsViewDetailsOpen);
|
||||
const isLicenseOrderHistoryOpen = useSelector(
|
||||
selectIsLicenseOrderHistoryOpen
|
||||
);
|
||||
const [popupPosition, setPopupPosition] = useState<{ x: number; y: number }>({
|
||||
x: 0,
|
||||
y: 0,
|
||||
});
|
||||
const breadcrumbRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// フォームの入力チェック
|
||||
const searchButtonEnabled = useMemo(() => {
|
||||
// 両方入力がない場合はボタンを活性化しない。
|
||||
if (!companyName && !accountId) {
|
||||
return false;
|
||||
}
|
||||
// Company Nameは3文字以上入力がない場合はボタンを活性化しない。
|
||||
// サロゲートペアを考慮して、スプレッド構文でリスト化してから文字数をカウントする
|
||||
// 絵文字が入力された場合は救えないが、そもそも入力されても検索できないので考慮しない。
|
||||
if (companyName && [...companyName].length <= 2) {
|
||||
return false;
|
||||
}
|
||||
// Account IDは数字ではないまたは0以下の場合はボタンを活性化しない。
|
||||
if (
|
||||
accountId &&
|
||||
(Number.isNaN(Number(accountId)) || Number(accountId) <= 0)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, [companyName, accountId]);
|
||||
|
||||
const requestSearch = useCallback(
|
||||
async (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
if (!searchButtonEnabled) return;
|
||||
dispatch(
|
||||
searchPartnersAsync({
|
||||
companyName,
|
||||
accountId: Number(accountId),
|
||||
})
|
||||
);
|
||||
},
|
||||
[dispatch, companyName, accountId, searchButtonEnabled]
|
||||
);
|
||||
|
||||
const handleAccountNameClick = useCallback(
|
||||
async (clickAccountId: number, event: React.MouseEvent) => {
|
||||
// ロード中はなにもしない。
|
||||
if (isLoading) return;
|
||||
event.stopPropagation();
|
||||
// アカウントの階層を取得
|
||||
await dispatch(getPartnerHierarchy({ accountId: clickAccountId }));
|
||||
setPopupPosition({ x: event.clientX, y: event.clientY });
|
||||
setIsBreadcrumbOpen(true);
|
||||
},
|
||||
[dispatch, setPopupPosition, setIsBreadcrumbOpen, isLoading]
|
||||
);
|
||||
|
||||
const closeBreadcrumbPopup = () => {
|
||||
setIsBreadcrumbOpen(false);
|
||||
};
|
||||
|
||||
// ポップアップ外のクリックポップアップ非表示するイベント
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (event: MouseEvent) => {
|
||||
if (
|
||||
breadcrumbRef.current &&
|
||||
!breadcrumbRef.current.contains(event.target as Node)
|
||||
) {
|
||||
closeBreadcrumbPopup();
|
||||
}
|
||||
};
|
||||
if (isBreadcrumbOpen) {
|
||||
document.addEventListener("mousedown", handleClickOutside);
|
||||
} else {
|
||||
document.removeEventListener("mousedown", handleClickOutside);
|
||||
}
|
||||
return () => {
|
||||
document.removeEventListener("mousedown", handleClickOutside);
|
||||
};
|
||||
}, [isBreadcrumbOpen]);
|
||||
|
||||
const tierNames: { [key: number]: string } = {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
1: t(getTranslationID("common.label.tier1")),
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
2: t(getTranslationID("common.label.tier2")),
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
3: t(getTranslationID("common.label.tier3")),
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
4: t(getTranslationID("common.label.tier4")),
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
5: t(getTranslationID("common.label.tier5")),
|
||||
};
|
||||
|
||||
const openViewDetails = useCallback(
|
||||
(value: SearchPartner) => {
|
||||
dispatch(changeSelectedRow({ value }));
|
||||
dispatch(setIsViewDetailsOpen({ value: true }));
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
const openOrderHistory = useCallback(
|
||||
(value?: SearchPartner) => {
|
||||
dispatch(changeSelectedRow({ value }));
|
||||
dispatch(setIsLicenseOrderHistoryOpen({ value: true }));
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
const handleModalClose = useCallback(() => {
|
||||
// ポップアップ閉じたら、検索結果をクリアする
|
||||
dispatch(cleanupSearchResult());
|
||||
dispatch(cleanupPartnerHierarchy());
|
||||
onClose();
|
||||
dispatch(setIsSearchPopupOpen({ value: false }));
|
||||
}, [dispatch, onClose]);
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
||||
<div>
|
||||
{isViewDetailsOpen && (
|
||||
<div>
|
||||
<LicenseSummary
|
||||
onReturn={() => dispatch(setIsViewDetailsOpen({ value: false }))}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{isLicenseOrderHistoryOpen && (
|
||||
<div>
|
||||
<LicenseOrderHistory
|
||||
onReturn={() =>
|
||||
dispatch(setIsLicenseOrderHistoryOpen({ value: false }))
|
||||
}
|
||||
selectedRow={selectedRow}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className={`${styles.modal} ${styles.isShow}`}>
|
||||
<div className={styles.searchModalBox}>
|
||||
<div className={styles.headerContainer}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("searchPartnerAccountPopupPage.label.title"))}
|
||||
</p>
|
||||
<form
|
||||
className={styles.searchBar}
|
||||
onSubmit={(e) => requestSearch(e)}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={t(getTranslationID("partnerLicense.label.name"))}
|
||||
value={companyName}
|
||||
onChange={(e) => setCompanyName(e.target.value.trimStart())}
|
||||
className={styles.searchInput}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={t(
|
||||
getTranslationID("partnerLicense.label.accountId")
|
||||
)}
|
||||
value={accountId}
|
||||
onChange={(e) => setAccountId(e.target.value.trimStart())}
|
||||
className={styles.searchInput}
|
||||
/>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<button
|
||||
className={`${styles.menuLink} ${!isLoading && searchButtonEnabled ? styles.isActive : ""
|
||||
}`}
|
||||
type="submit"
|
||||
disabled={!searchButtonEnabled || isLoading}
|
||||
>
|
||||
<img
|
||||
src={searchIcon}
|
||||
alt="search"
|
||||
className={styles.menuIcon}
|
||||
/>
|
||||
{t(getTranslationID("partnerLicense.label.search"))}
|
||||
</button>
|
||||
<button type="button" onClick={handleModalClose}>
|
||||
<img
|
||||
src={close}
|
||||
className={styles.modalTitleIcon}
|
||||
alt="close"
|
||||
/>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<table
|
||||
className={`${styles.table} ${styles.partner} ${styles.marginBtm3}`}
|
||||
>
|
||||
<tr className={styles.tableHeader}>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.name"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.category"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.accountId"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.country"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.primaryAdmin"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{t(getTranslationID("partnerPage.label.email"))}</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>{"" /** Order History、View Details用の空カラム */}</a>
|
||||
</th>
|
||||
</tr>
|
||||
{searchResult.map((result) => (
|
||||
<tr key={result.accountId}>
|
||||
<td
|
||||
onClick={(event) =>
|
||||
handleAccountNameClick(result.accountId, event)
|
||||
}
|
||||
className={styles.hoverBlue}
|
||||
>
|
||||
{result.name}
|
||||
</td>
|
||||
<td>{tierNames[result.tier]}</td>
|
||||
<td>{result.accountId}</td>
|
||||
<td>{result.country}</td>
|
||||
<td>{result.primaryAdmin}</td>
|
||||
<td>{result.email ?? "-"}</td>
|
||||
<td>
|
||||
<ul className={`${styles.menuAction} ${styles.inTable}`}>
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={() => {
|
||||
openOrderHistory(result);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerLicense.label.orderHistoryButton"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
{result.tier === 5 && (
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={() => {
|
||||
openViewDetails(result);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID("partnerLicense.label.viewDetails")
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
{searchResult.length === 0 && (
|
||||
<p style={{ margin: "10px", textAlign: "center" }}>
|
||||
{t(getTranslationID("common.message.listEmpty"))}
|
||||
</p>
|
||||
)}
|
||||
{/* ローディングオーバーレイ */}
|
||||
<div
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
className={styles.overlay}
|
||||
>
|
||||
<img
|
||||
src={progress_activit}
|
||||
className={`${styles.icLoading} ${styles.alignCenter}`}
|
||||
alt="Loading"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{isBreadcrumbOpen && (
|
||||
<div
|
||||
ref={breadcrumbRef}
|
||||
className={styles.breadcrumbPopup}
|
||||
style={{ top: popupPosition.y, left: popupPosition.x }}
|
||||
>
|
||||
<ul className={styles.brCrumbPartner}>
|
||||
{partnerHierarchy.map((parent) => (
|
||||
<li key={parent.tier}>
|
||||
<span>{parent.name}</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@ -1,123 +0,0 @@
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
issueTrialLicenseAsync,
|
||||
cleanupApps,
|
||||
selectIsLoading,
|
||||
selectNumberOfLicenses,
|
||||
selectExpirationDate,
|
||||
setExpirationDate,
|
||||
} from "features/license/licenseTrialIssue";
|
||||
import styles from "../../styles/app.module.scss";
|
||||
import { getTranslationID } from "../../translation";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
import { SearchPartner, PartnerLicenseInfo } from "../../api";
|
||||
|
||||
interface TrialLicenseIssuePopupProps {
|
||||
onClose: () => void;
|
||||
selectedRow?: PartnerLicenseInfo | SearchPartner;
|
||||
}
|
||||
|
||||
export const TrialLicenseIssuePopup: React.FC<TrialLicenseIssuePopupProps> = (
|
||||
props
|
||||
) => {
|
||||
const { onClose, selectedRow } = props;
|
||||
const { t } = useTranslation();
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
const numberOfLicenses = useSelector(selectNumberOfLicenses);
|
||||
const expirationDate = useSelector(selectExpirationDate);
|
||||
|
||||
useEffect(
|
||||
() => () => {
|
||||
// useEffectのreturnとしてcleanupAppsを実行することで、ポップアップのアンマウント時に初期化を行う
|
||||
dispatch(cleanupApps());
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
// ポップアップ表示時
|
||||
useEffect(() => {
|
||||
// トライアルライセンスの有効期限を設定。
|
||||
dispatch(setExpirationDate());
|
||||
}, [dispatch]);
|
||||
|
||||
// ポップアップを閉じる処理
|
||||
const closePopup = useCallback(() => {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
onClose();
|
||||
}, [isLoading, onClose]);
|
||||
|
||||
// 発行ボタン押下時
|
||||
const onIssueTrialLicense = useCallback(async () => {
|
||||
// トライアルライセンス発行APIの呼び出し
|
||||
const { meta } = await dispatch(issueTrialLicenseAsync({ selectedRow }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
closePopup();
|
||||
}
|
||||
}, [dispatch, closePopup, selectedRow]);
|
||||
|
||||
// HTML
|
||||
return (
|
||||
<div className={`${styles.modal} ${styles.isShow}`}>
|
||||
<div className={styles.modalBox}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("trialLicenseIssuePopupPage.label.title"))}
|
||||
<button type="button" onClick={closePopup}>
|
||||
<img src={close} className={styles.modalTitleIcon} alt="close" />
|
||||
</button>
|
||||
</p>
|
||||
<form className={styles.form}>
|
||||
<dl className={`${styles.formList} ${styles.hasbg}`}>
|
||||
<dt className={styles.formTitle}>
|
||||
{t(getTranslationID("trialLicenseIssuePopupPage.label.subTitle"))}
|
||||
</dt>
|
||||
<dt className={styles.overLine}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"trialLicenseIssuePopupPage.label.numberOfLicenses"
|
||||
)
|
||||
)}
|
||||
</dt>
|
||||
<dd>{numberOfLicenses}</dd>
|
||||
<dt>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"trialLicenseIssuePopupPage.label.expirationDate"
|
||||
)
|
||||
)}
|
||||
</dt>
|
||||
<dd>{expirationDate}</dd>
|
||||
<dd className={`${styles.full} ${styles.alignCenter}`}>
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(
|
||||
getTranslationID(
|
||||
"trialLicenseIssuePopupPage.label.issueButton"
|
||||
)
|
||||
)}
|
||||
className={`${styles.formSubmit} ${styles.marginBtm1} ${
|
||||
!isLoading ? styles.isActive : ""
|
||||
}`}
|
||||
onClick={onIssueTrialLicense}
|
||||
/>
|
||||
<img
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
src={progress_activit}
|
||||
className={styles.icLoading}
|
||||
alt="Loading"
|
||||
/>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@ -1,178 +0,0 @@
|
||||
import { AppDispatch } from "app/store";
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { getTranslationID } from "translation";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
changeEditCompanyName,
|
||||
changeSelectedAdminId,
|
||||
cleanupPartnerAccount,
|
||||
getPartnerUsersAsync,
|
||||
editPartnerInfoAsync,
|
||||
selectEditPartnerCompanyName,
|
||||
selectEditPartnerCountry,
|
||||
selectEditPartnerId,
|
||||
selectEditPartnerUsers,
|
||||
selectIsLoading,
|
||||
selectSelectedAdminId,
|
||||
selectOffset,
|
||||
getPartnerInfoAsync,
|
||||
LIMIT_PARTNER_VIEW_NUM,
|
||||
} from "features/partner";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
import { COUNTRY_LIST } from "../SignupPage/constants";
|
||||
|
||||
interface EditPartnerAccountPopup {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const EditPartnerAccountPopup: React.FC<EditPartnerAccountPopup> = (
|
||||
props
|
||||
) => {
|
||||
const { isOpen, onClose } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
const offset = useSelector(selectOffset);
|
||||
|
||||
const partnerId = useSelector(selectEditPartnerId);
|
||||
const companyName = useSelector(selectEditPartnerCompanyName);
|
||||
const country = useSelector(selectEditPartnerCountry);
|
||||
|
||||
const users = useSelector(selectEditPartnerUsers);
|
||||
const adminUser = users.find((user) => user.isPrimaryAdmin);
|
||||
|
||||
const selectedAdminId = useSelector(selectSelectedAdminId);
|
||||
|
||||
// ポップアップを閉じる処理
|
||||
const closePopup = useCallback(() => {
|
||||
if (isLoading) {
|
||||
return;
|
||||
}
|
||||
dispatch(cleanupPartnerAccount());
|
||||
onClose();
|
||||
}, [isLoading, onClose, dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen) {
|
||||
dispatch(getPartnerUsersAsync({ accountId: partnerId }));
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [isOpen]);
|
||||
|
||||
const onEditPartner = useCallback(async () => {
|
||||
// eslint-disable-next-line no-alert
|
||||
if (!window.confirm(t(getTranslationID("common.message.dialogConfirm")))) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(editPartnerInfoAsync());
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(
|
||||
getPartnerInfoAsync({
|
||||
limit: LIMIT_PARTNER_VIEW_NUM,
|
||||
offset,
|
||||
})
|
||||
);
|
||||
closePopup();
|
||||
}
|
||||
}, [dispatch, closePopup, t, offset]);
|
||||
|
||||
return (
|
||||
<div className={`${styles.modal} ${isOpen ? styles.isShow : ""}`}>
|
||||
<div className={styles.modalBox}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("partnerPage.label.editAccount"))}
|
||||
<button type="button" onClick={closePopup}>
|
||||
<img src={close} className={styles.modalTitleIcon} alt="close" />
|
||||
</button>
|
||||
</p>
|
||||
<form className={styles.form}>
|
||||
<dl className={`${styles.formList} ${styles.hasbg}`}>
|
||||
<dt className={styles.formTitle}>
|
||||
{t(getTranslationID("partnerPage.label.accountInformation"))}
|
||||
</dt>
|
||||
<dt>{t(getTranslationID("partnerPage.label.name"))}</dt>
|
||||
<dd>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
maxLength={255}
|
||||
value={companyName}
|
||||
className={styles.formInput}
|
||||
onChange={(e) => {
|
||||
dispatch(
|
||||
changeEditCompanyName({ companyName: e.target.value })
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</dd>
|
||||
<dt>{t(getTranslationID("partnerPage.label.country"))}</dt>
|
||||
<dd className={styles.last}>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
value={COUNTRY_LIST.find((c) => c.value === country)?.label}
|
||||
className={styles.formInput}
|
||||
readOnly
|
||||
/>
|
||||
</dd>
|
||||
<dt className={styles.formTitle}>
|
||||
{t(getTranslationID("partnerPage.label.primaryAdminInfo"))}
|
||||
</dt>
|
||||
<dt>{t(getTranslationID("partnerPage.label.adminName"))}</dt>
|
||||
<dd>
|
||||
<input
|
||||
type="text"
|
||||
size={40}
|
||||
value={adminUser?.name}
|
||||
className={styles.formInput}
|
||||
readOnly
|
||||
/>
|
||||
</dd>
|
||||
<dt>{t(getTranslationID("partnerPage.label.email"))}</dt>
|
||||
<dd className={styles.last}>
|
||||
<select
|
||||
className={styles.formInput}
|
||||
onChange={(event) => {
|
||||
dispatch(
|
||||
changeSelectedAdminId({
|
||||
adminId: Number(event.target.value),
|
||||
})
|
||||
);
|
||||
}}
|
||||
value={selectedAdminId}
|
||||
>
|
||||
{users.map((user) => (
|
||||
<option key={user.id} value={user.id}>
|
||||
{user.email}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</dd>
|
||||
<dd className={`${styles.full} ${styles.alignCenter}`}>
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(getTranslationID("partnerPage.label.saveChanges"))}
|
||||
className={`${styles.formSubmit} ${styles.marginBtm1} ${
|
||||
!isLoading && companyName.length !== 0 ? styles.isActive : ""
|
||||
}`}
|
||||
onClick={onEditPartner}
|
||||
/>
|
||||
<img
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
src={progress_activit}
|
||||
className={styles.icLoading}
|
||||
alt="Loading"
|
||||
/>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@ -1,5 +1,6 @@
|
||||
/* eslint-disable jsx-a11y/control-has-associated-label */
|
||||
import { AppDispatch } from "app/store";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import Footer from "components/footer";
|
||||
import Header from "components/header";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
@ -15,28 +16,23 @@ import {
|
||||
selectTotalPage,
|
||||
getPartnerInfoAsync,
|
||||
selectPartnersInfo,
|
||||
deletePartnerAccountAsync,
|
||||
} from "features/partner/index";
|
||||
import {
|
||||
changeDelegateAccount,
|
||||
changeEditPartner,
|
||||
savePageInfo,
|
||||
} from "features/partner/partnerSlice";
|
||||
import { getTranslationID } from "translation";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getDelegationTokenAsync } from "features/auth/operations";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Partner } from "api";
|
||||
import personAdd from "../../assets/images/person_add.svg";
|
||||
import { TIERS } from "../../components/auth/constants";
|
||||
import { AddPartnerAccountPopup } from "./addPartnerAccountPopup";
|
||||
import { EditPartnerAccountPopup } from "./editPartnerAccountPopup";
|
||||
import checkFill from "../../assets/images/check_fill.svg";
|
||||
|
||||
const PartnerPage: React.FC = (): JSX.Element => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const [isPopupOpen, setIsPopupOpen] = useState(false);
|
||||
const [isEditPopupOpen, setIsEditPopupOpen] = useState(false);
|
||||
const [t] = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const total = useSelector(selectTotal);
|
||||
@ -75,19 +71,6 @@ const PartnerPage: React.FC = (): JSX.Element => {
|
||||
const onOpen = useCallback(() => {
|
||||
setIsPopupOpen(true);
|
||||
}, [setIsPopupOpen]);
|
||||
const onOpenEditPopup = useCallback(
|
||||
(editPartner: Partner) => {
|
||||
dispatch(
|
||||
changeEditPartner({
|
||||
id: editPartner.accountId,
|
||||
companyName: editPartner.name,
|
||||
country: editPartner.country,
|
||||
})
|
||||
);
|
||||
setIsEditPopupOpen(true);
|
||||
},
|
||||
[setIsEditPopupOpen, dispatch]
|
||||
);
|
||||
|
||||
// パートナー取得APIを呼び出す
|
||||
useEffect(() => {
|
||||
@ -126,31 +109,6 @@ const PartnerPage: React.FC = (): JSX.Element => {
|
||||
[dispatch, navigate, t]
|
||||
);
|
||||
|
||||
// delete account押下時処理
|
||||
const onDeleteAccount = useCallback(
|
||||
async (accountId: number, companyName: string) => {
|
||||
// ダイアログ確認
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(
|
||||
`${t(
|
||||
getTranslationID("partnerPage.message.partnerDeleteConfirm")
|
||||
)} ${companyName}`
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(deletePartnerAccountAsync({ accountId }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(
|
||||
getPartnerInfoAsync({ limit: LIMIT_PARTNER_VIEW_NUM, offset })
|
||||
);
|
||||
}
|
||||
},
|
||||
[dispatch, t, offset]
|
||||
);
|
||||
|
||||
// HTML
|
||||
return (
|
||||
<>
|
||||
@ -160,14 +118,9 @@ const PartnerPage: React.FC = (): JSX.Element => {
|
||||
setIsPopupOpen(false);
|
||||
}}
|
||||
/>
|
||||
<EditPartnerAccountPopup
|
||||
isOpen={isEditPopupOpen}
|
||||
onClose={() => {
|
||||
setIsEditPopupOpen(false);
|
||||
}}
|
||||
/>
|
||||
<div className={styles.wrap}>
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div className={styles.pageHeader}>
|
||||
<h1 className={styles.pageTitle}>
|
||||
@ -232,30 +185,10 @@ const PartnerPage: React.FC = (): JSX.Element => {
|
||||
<tr>
|
||||
<td className={styles.clm0}>
|
||||
<ul className={styles.menuInTable}>
|
||||
{/* パートナーアカウント削除はCCB後回し分なので非表示
|
||||
{isVisibleButton && (
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
onClick={() => {
|
||||
onOpenEditPopup(x);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerPage.label.editAccount"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{isVisibleButton && (
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
onClick={() => {
|
||||
onDeleteAccount(x.accountId, x.name);
|
||||
}}
|
||||
>
|
||||
<a>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"partnerPage.label.deleteAccount"
|
||||
@ -264,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 */}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import Header from "components/header";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getTranslationID } from "translation";
|
||||
import styles from "styles/app.module.scss";
|
||||
@ -7,18 +8,11 @@ import Footer from "components/footer";
|
||||
|
||||
const SupportPage: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
// OMDS_IS-381 Support画面で表示する内容を充実したいの対応 2024年8月7日
|
||||
const userGuideDivStyles: React.CSSProperties = {
|
||||
padding: "2rem 2rem 4rem 2rem",
|
||||
};
|
||||
const appDLDivStyles: React.CSSProperties = {
|
||||
padding: "2rem 2rem 0rem 2rem",
|
||||
};
|
||||
const customUlStyles: React.CSSProperties = { marginBottom: "1rem" };
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
@ -31,8 +25,8 @@ const SupportPage: React.FC = () => {
|
||||
<div>
|
||||
<h2>{t(getTranslationID("supportPage.label.howToUse"))}</h2>
|
||||
|
||||
<div className={styles.txContents} style={userGuideDivStyles}>
|
||||
<ul className={styles.listDocument} style={customUlStyles}>
|
||||
<div className={styles.txContents}>
|
||||
<ul className={styles.listDocument}>
|
||||
<li>
|
||||
<a
|
||||
href="https://download.omsystem.com/pages/odms_download/manual/odms_cloud/"
|
||||
@ -48,105 +42,6 @@ const SupportPage: React.FC = () => {
|
||||
{t(getTranslationID("supportPage.text.notResolved"))}
|
||||
</p>
|
||||
</div>
|
||||
<h2>
|
||||
{t(getTranslationID("supportPage.label.programDownload"))}
|
||||
</h2>
|
||||
<div className={styles.txContents} style={appDLDivStyles}>
|
||||
<ul className={styles.listDocument} style={customUlStyles}>
|
||||
<li>
|
||||
<a
|
||||
href="https://download.omsystem.com/pages/odms_download/odms_cloud_desktop/en/"
|
||||
target="_blank"
|
||||
className={styles.linkTx}
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.omdsDesktopAppDownloadLink"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p className={styles.txNormal}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.omdsDesktopAppDownloadLinkDescription"
|
||||
)
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.txContents} style={appDLDivStyles}>
|
||||
<ul className={styles.listDocument} style={customUlStyles}>
|
||||
<li>
|
||||
<a
|
||||
href="https://download.omsystem.com/pages/odms_download/device_customization_program/en/"
|
||||
target="_blank"
|
||||
className={styles.linkTx}
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(getTranslationID("supportPage.label.dcpDownloadLink"))}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p className={styles.txNormal}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.dcpDownloadLinkDescription"
|
||||
)
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.txContents} style={appDLDivStyles}>
|
||||
<ul className={styles.listDocument} style={customUlStyles}>
|
||||
<li>
|
||||
<a
|
||||
href="https://download.omsystem.com/pages/odms_download/odms_cloud_backup_extraction_tool/en/"
|
||||
target="_blank"
|
||||
className={styles.linkTx}
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.backupExtractionToolDownloadLink"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p className={styles.txNormal}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.backupExtractionToolDownloadLinkDescription"
|
||||
)
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.txContents} style={appDLDivStyles}>
|
||||
<ul className={styles.listDocument} style={customUlStyles}>
|
||||
<li>
|
||||
<a
|
||||
href="https://download.omsystem.com/pages/odms_download/odms_client_virtual_driver/en/"
|
||||
target="_blank"
|
||||
className={styles.linkTx}
|
||||
rel="noreferrer"
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.virtualDriverDownloadLink"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<p className={styles.txNormal}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"supportPage.label.virtualDriverDownloadLinkDescription"
|
||||
)
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { AppDispatch } from "app/store";
|
||||
import Header from "components/header";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getTranslationID } from "translation";
|
||||
import undo from "assets/images/undo.svg";
|
||||
@ -12,7 +13,6 @@ import {
|
||||
selectTemplates,
|
||||
listTemplateAsync,
|
||||
selectIsLoading,
|
||||
deleteTemplateAsync,
|
||||
} from "features/workflow/template";
|
||||
import { selectDelegationAccessToken } from "features/auth/selectors";
|
||||
import { DelegationBar } from "components/delegate";
|
||||
@ -35,23 +35,6 @@ export const TemplateFilePage: React.FC = () => {
|
||||
dispatch(listTemplateAsync());
|
||||
}, [dispatch]);
|
||||
|
||||
const onDeleteTemplate = useCallback(
|
||||
async (templateFileId: number) => {
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(t(getTranslationID("common.message.dialogConfirm")))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(deleteTemplateAsync({ templateFileId }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(listTemplateAsync());
|
||||
}
|
||||
},
|
||||
[dispatch, t]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{isShowAddPopup && (
|
||||
@ -68,6 +51,7 @@ export const TemplateFilePage: React.FC = () => {
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
@ -117,17 +101,16 @@ export const TemplateFilePage: React.FC = () => {
|
||||
<td>{template.name}</td>
|
||||
<td>
|
||||
<ul className={`${styles.menuAction} ${styles.inTable}`}>
|
||||
{/* テンプレートファイル削除はCCB後回し分なので非表示
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
href=""
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={() => {
|
||||
onDeleteTemplate(template.id);
|
||||
}}
|
||||
>
|
||||
{t(getTranslationID("common.label.delete"))}
|
||||
</a>
|
||||
</li>
|
||||
*/}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useState } from "react";
|
||||
import Header from "components/header";
|
||||
import Footer from "components/footer";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import progress_activit from "assets/images/progress_activit.svg";
|
||||
import undo from "assets/images/undo.svg";
|
||||
import group_add from "assets/images/group_add.svg";
|
||||
@ -10,7 +11,6 @@ import {
|
||||
selectTypistGroups,
|
||||
selectIsLoading,
|
||||
listTypistGroupsAsync,
|
||||
deleteTypistGroupAsync,
|
||||
} from "features/workflow/typistGroup";
|
||||
import { AppDispatch } from "app/store";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@ -47,25 +47,6 @@ const TypistGroupSettingPage: React.FC = (): JSX.Element => {
|
||||
[setIsEditPopupOpen]
|
||||
);
|
||||
|
||||
const onDeleteTypistGroup = useCallback(
|
||||
async (typistGroupId: number) => {
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(t(getTranslationID("common.message.dialogConfirm")))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(
|
||||
deleteTypistGroupAsync({ typistGroupId })
|
||||
);
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
dispatch(listTypistGroupsAsync());
|
||||
}
|
||||
},
|
||||
[dispatch, t]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(listTypistGroupsAsync());
|
||||
}, [dispatch]);
|
||||
@ -92,6 +73,7 @@ const TypistGroupSettingPage: React.FC = (): JSX.Element => {
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
@ -160,17 +142,6 @@ const TypistGroupSettingPage: React.FC = (): JSX.Element => {
|
||||
{t(getTranslationID("common.label.edit"))}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={() => {
|
||||
onDeleteTypistGroup(group.id);
|
||||
}}
|
||||
>
|
||||
{t(getTranslationID("common.label.delete"))}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -28,13 +28,12 @@ import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
interface AllocateLicensePopupProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
clearUserSearchInputs: () => void;
|
||||
}
|
||||
|
||||
export const AllocateLicensePopup: React.FC<AllocateLicensePopupProps> = (
|
||||
props
|
||||
) => {
|
||||
const { isOpen, onClose, clearUserSearchInputs } = props;
|
||||
const { isOpen, onClose } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
@ -88,7 +87,6 @@ export const AllocateLicensePopup: React.FC<AllocateLicensePopupProps> = (
|
||||
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
closePopup();
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
}, [dispatch, closePopup, id, selectedlicenseId, hasErrorEmptyLicense]);
|
||||
@ -221,7 +219,8 @@ export const AllocateLicensePopup: React.FC<AllocateLicensePopupProps> = (
|
||||
value={selectedlicenseId ?? ""}
|
||||
>
|
||||
<option value="" hidden>
|
||||
{`-- ${t(
|
||||
{`--
|
||||
${t(
|
||||
getTranslationID(
|
||||
"allocateLicensePopupPage.label.dropDownHeading"
|
||||
)
|
||||
|
||||
@ -1,258 +0,0 @@
|
||||
import { AppDispatch } from "app/store";
|
||||
import React, { useState, useCallback } from "react";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { getTranslationID } from "translation";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
selectIsLoading,
|
||||
importUsersAsync,
|
||||
changeImportFileName,
|
||||
changeImportCsv,
|
||||
selectImportFileName,
|
||||
selectImportValidationErrors,
|
||||
cleanupImportUsers,
|
||||
} from "features/user";
|
||||
import { parseCSV } from "common/parser";
|
||||
import close from "../../assets/images/close.svg";
|
||||
import download from "../../assets/images/download.svg";
|
||||
import upload from "../../assets/images/upload.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
|
||||
interface UserAddPopupProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const ImportPopup: React.FC<UserAddPopupProps> = (props) => {
|
||||
const { isOpen, onClose } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
// AddUserの情報を取得
|
||||
|
||||
const closePopup = useCallback(() => {
|
||||
setIsPushImportButton(false);
|
||||
dispatch(cleanupImportUsers());
|
||||
onClose();
|
||||
}, [onClose, dispatch]);
|
||||
|
||||
const [isPushImportButton, setIsPushImportButton] = useState<boolean>(false);
|
||||
const isLoading = useSelector(selectIsLoading);
|
||||
|
||||
const importFileName = useSelector(selectImportFileName);
|
||||
const { invalidInput, duplicatedEmails, duplicatedAuthorIds, overMaxRow } =
|
||||
useSelector(selectImportValidationErrors);
|
||||
|
||||
const onDownloadCsv = useCallback(() => {
|
||||
// csvファイルダウンロード処理
|
||||
const filename = `import_users.csv`;
|
||||
|
||||
const importCsvHeader = [
|
||||
"name",
|
||||
"email",
|
||||
"role",
|
||||
"author_id",
|
||||
"auto_assign",
|
||||
"notification",
|
||||
"encryption",
|
||||
"encryption_password",
|
||||
"prompt",
|
||||
].toString();
|
||||
|
||||
const blob = new Blob([importCsvHeader], {
|
||||
type: "mime",
|
||||
});
|
||||
const blobURL = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = blobURL;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.parentNode?.removeChild(a);
|
||||
}, []);
|
||||
|
||||
// ファイルが選択されたときの処理
|
||||
const handleFileChange = useCallback(
|
||||
async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
// 選択されたファイルを取得(複数選択されても先頭を取得)
|
||||
const file = event.target.files?.[0];
|
||||
|
||||
// ファイルが選択されていれば、storeに保存
|
||||
if (file) {
|
||||
const text = await file.text();
|
||||
const users = await parseCSV(text.trimEnd());
|
||||
|
||||
dispatch(changeImportCsv({ users }));
|
||||
dispatch(changeImportFileName({ fileName: file.name }));
|
||||
}
|
||||
// 同名のファイルを選択した場合、onChangeが発火しないため、valueをクリアする
|
||||
event.target.value = "";
|
||||
},
|
||||
[dispatch]
|
||||
);
|
||||
|
||||
const onImportUsers = useCallback(async () => {
|
||||
setIsPushImportButton(true);
|
||||
if (
|
||||
invalidInput.length > 0 ||
|
||||
duplicatedEmails.length > 0 ||
|
||||
duplicatedAuthorIds.length > 0 ||
|
||||
overMaxRow
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
await dispatch(importUsersAsync());
|
||||
setIsPushImportButton(false);
|
||||
}, [
|
||||
dispatch,
|
||||
invalidInput,
|
||||
duplicatedEmails,
|
||||
duplicatedAuthorIds,
|
||||
overMaxRow,
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className={`${styles.modal} ${isOpen ? styles.isShow : ""}`}>
|
||||
<div className={styles.modalBox}>
|
||||
<p className={styles.modalTitle}>
|
||||
{t(getTranslationID("userListPage.label.bulkImport"))}
|
||||
<button type="button" onClick={closePopup}>
|
||||
<img src={close} className={styles.modalTitleIcon} alt="close" />
|
||||
</button>
|
||||
</p>
|
||||
<form className={styles.form}>
|
||||
<dl
|
||||
className={`${styles.formList} ${styles.userImport} ${styles.hasbg}`}
|
||||
>
|
||||
<dd className={styles.full}>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
style={{ marginInlineEnd: "350px", marginTop: "15px" }}
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={onDownloadCsv}
|
||||
>
|
||||
<img src={download} alt="" className={styles.menuIcon} />
|
||||
{t(getTranslationID("userListPage.label.downloadCsv"))}
|
||||
</a>
|
||||
{t(getTranslationID("userListPage.text.downloadExplain"))}
|
||||
</dd>
|
||||
<dd className={styles.full}>
|
||||
<label
|
||||
style={{ marginInlineEnd: "350px", marginTop: "15px" }}
|
||||
htmlFor="import"
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
>
|
||||
<input
|
||||
type="file"
|
||||
id="import"
|
||||
style={{ display: "none" }}
|
||||
onChange={handleFileChange}
|
||||
/>
|
||||
<img src={upload} alt="" className={styles.menuIcon} />
|
||||
{t(getTranslationID("userListPage.label.importCsv"))}
|
||||
</label>
|
||||
</dd>
|
||||
<dt className={styles.formTitle}>
|
||||
{t(getTranslationID("userListPage.label.inputRules"))}
|
||||
</dt>
|
||||
<dt>{t(getTranslationID("userListPage.label.nameLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.nameRule"))}</dd>
|
||||
<dt>
|
||||
{t(getTranslationID("userListPage.label.emailAddressLabel"))}
|
||||
</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.emailAddressRule"))}</dd>
|
||||
<dt>{t(getTranslationID("userListPage.label.roleLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.roleRule"))}</dd>
|
||||
<dt>{t(getTranslationID("userListPage.label.authorIdLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.authorIdRule"))}</dd>
|
||||
<dt>{t(getTranslationID("userListPage.label.autoRenewLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.autoRenewRule"))}</dd>
|
||||
<dt>
|
||||
{t(getTranslationID("userListPage.label.notificationLabel"))}
|
||||
</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.notificationRule"))}</dd>
|
||||
<dt>{t(getTranslationID("userListPage.label.encryptionLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.encryptionRule"))}</dd>
|
||||
<dt>
|
||||
{t(
|
||||
getTranslationID("userListPage.label.encryptionPasswordLabel")
|
||||
)}
|
||||
</dt>
|
||||
<dd>
|
||||
{t(getTranslationID("userListPage.text.encryptionPasswordRule"))}
|
||||
</dd>
|
||||
<dt>{t(getTranslationID("userListPage.label.promptLabel"))}</dt>
|
||||
<dd>{t(getTranslationID("userListPage.text.promptRule"))}</dd>
|
||||
<dd className={styles.full}>
|
||||
{isPushImportButton && overMaxRow && (
|
||||
<span className={styles.formError}>
|
||||
{t(getTranslationID("userListPage.message.overMaxUserError"))}
|
||||
</span>
|
||||
)}
|
||||
{isPushImportButton && invalidInput.length > 0 && (
|
||||
<>
|
||||
<span className={styles.formError}>
|
||||
{t(
|
||||
getTranslationID("userListPage.message.invalidInputError")
|
||||
)}
|
||||
</span>
|
||||
<span className={styles.formError}>
|
||||
{invalidInput.map((row) => `L${row}`).join(", ")}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
{isPushImportButton && duplicatedEmails.length > 0 && (
|
||||
<>
|
||||
<span className={styles.formError}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"userListPage.message.duplicateEmailError"
|
||||
)
|
||||
)}
|
||||
</span>
|
||||
<span className={styles.formError}>
|
||||
{duplicatedEmails.map((row) => `L${row}`).join(", ")}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
{isPushImportButton && duplicatedAuthorIds.length > 0 && (
|
||||
<>
|
||||
<span className={styles.formError}>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"userListPage.message.duplicateAuthorIdError"
|
||||
)
|
||||
)}
|
||||
</span>
|
||||
<span className={styles.formError}>
|
||||
{duplicatedAuthorIds.map((row) => `L${row}`).join(", ")}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</dd>
|
||||
<dd className={`${styles.full} ${styles.alignCenter}`}>
|
||||
<input
|
||||
type="button"
|
||||
name="submit"
|
||||
value={t(getTranslationID("userListPage.label.addUsers"))}
|
||||
className={`${styles.formSubmit} ${styles.marginBtm1} ${
|
||||
!isLoading && importFileName !== undefined
|
||||
? styles.isActive
|
||||
: ""
|
||||
}`}
|
||||
onClick={onImportUsers}
|
||||
/>
|
||||
<img
|
||||
style={{ display: isLoading ? "inline" : "none" }}
|
||||
src={progress_activit}
|
||||
className={styles.icLoading}
|
||||
alt="Loading"
|
||||
/>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@ -3,14 +3,13 @@ import React, { useCallback, useEffect, useState } from "react";
|
||||
import Header from "components/header";
|
||||
import Footer from "components/footer";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import {
|
||||
listUsersAsync,
|
||||
selectUserViews,
|
||||
selectIsLoading,
|
||||
deallocateLicenseAsync,
|
||||
deleteUserAsync,
|
||||
confirmUserForceAsync,
|
||||
} from "features/user";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { getTranslationID } from "translation";
|
||||
@ -32,12 +31,9 @@ import personAdd from "../../assets/images/person_add.svg";
|
||||
import checkFill from "../../assets/images/check_fill.svg";
|
||||
import checkOutline from "../../assets/images/check_outline.svg";
|
||||
import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
import upload from "../../assets/images/upload.svg";
|
||||
import searchIcon from "../../assets/images/search.svg";
|
||||
import { UserAddPopup } from "./popup";
|
||||
import { UserUpdatePopup } from "./updatePopup";
|
||||
import { AllocateLicensePopup } from "./allocateLicensePopup";
|
||||
import { ImportPopup } from "./importPopup";
|
||||
|
||||
const UserListPage: React.FC = (): JSX.Element => {
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
@ -49,9 +45,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
const [isUpdatePopupOpen, setIsUpdatePopupOpen] = useState(false);
|
||||
const [isAllocateLicensePopupOpen, setIsAllocateLicensePopupOpen] =
|
||||
useState(false);
|
||||
const [isImportPopupOpen, setIsImportPopupOpen] = useState(false);
|
||||
const [searchEmail, setSearchEmail] = useState("");
|
||||
const [searchUserName, setSearchUserName] = useState("");
|
||||
|
||||
const onOpen = useCallback(() => {
|
||||
setIsPopupOpen(true);
|
||||
@ -72,9 +65,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
},
|
||||
[setIsAllocateLicensePopupOpen, dispatch]
|
||||
);
|
||||
const onImportPopupOpen = useCallback(() => {
|
||||
setIsImportPopupOpen(true);
|
||||
}, [setIsImportPopupOpen]);
|
||||
|
||||
const onLicenseDeallocation = useCallback(
|
||||
async (userId: number) => {
|
||||
@ -88,72 +78,12 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
|
||||
const { meta } = await dispatch(deallocateLicenseAsync({ userId }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
},
|
||||
[dispatch, t]
|
||||
);
|
||||
|
||||
const onDeleteUser = useCallback(
|
||||
async (userId: number) => {
|
||||
// ダイアログ確認
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(t(getTranslationID("common.message.dialogConfirm")))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(deleteUserAsync({ userId }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
},
|
||||
[dispatch, t]
|
||||
);
|
||||
|
||||
const onForceEmailVerification = useCallback(
|
||||
async (userId: number) => {
|
||||
// ダイアログ確認
|
||||
if (
|
||||
/* eslint-disable-next-line no-alert */
|
||||
!window.confirm(
|
||||
t(
|
||||
getTranslationID(
|
||||
"userListPage.message.forceEmailVerificationConfirm"
|
||||
)
|
||||
)
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { meta } = await dispatch(confirmUserForceAsync({ userId }));
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
},
|
||||
[dispatch, t]
|
||||
);
|
||||
|
||||
const requestSearch = (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
dispatch(
|
||||
listUsersAsync({
|
||||
userInputUserName: searchUserName,
|
||||
userInputEmail: searchEmail,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const clearUserSearchInputs = useCallback(() => {
|
||||
setSearchEmail("");
|
||||
setSearchUserName("");
|
||||
}, [setSearchEmail, setSearchUserName]);
|
||||
|
||||
useEffect(() => {
|
||||
// ユーザ一覧取得処理を呼び出す
|
||||
dispatch(listUsersAsync());
|
||||
@ -172,27 +102,18 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
onClose={() => {
|
||||
setIsUpdatePopupOpen(false);
|
||||
}}
|
||||
clearUserSearchInputs={clearUserSearchInputs}
|
||||
/>
|
||||
<UserAddPopup
|
||||
isOpen={isPopupOpen}
|
||||
onClose={() => {
|
||||
setIsPopupOpen(false);
|
||||
}}
|
||||
clearUserSearchInputs={clearUserSearchInputs}
|
||||
/>
|
||||
<AllocateLicensePopup
|
||||
isOpen={isAllocateLicensePopupOpen}
|
||||
onClose={() => {
|
||||
setIsAllocateLicensePopupOpen(false);
|
||||
}}
|
||||
clearUserSearchInputs={clearUserSearchInputs}
|
||||
/>
|
||||
<ImportPopup
|
||||
isOpen={isImportPopupOpen}
|
||||
onClose={() => {
|
||||
setIsImportPopupOpen(false);
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
className={`${styles.wrap} ${
|
||||
@ -201,6 +122,7 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div className="">
|
||||
<div className={styles.pageHeader}>
|
||||
@ -224,60 +146,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
{t(getTranslationID("userListPage.label.addUser"))}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
className={`${styles.menuLink} ${styles.isActive}`}
|
||||
onClick={onImportPopupOpen}
|
||||
>
|
||||
<img src={upload} alt="" className={styles.menuIcon} />
|
||||
{t(getTranslationID("userListPage.label.bulkImport"))}
|
||||
</a>
|
||||
</li>
|
||||
<li className={styles.floatRight}>
|
||||
<form
|
||||
className={styles.searchBar}
|
||||
onSubmit={(e) => requestSearch(e)}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={t(
|
||||
getTranslationID("userListPage.label.name")
|
||||
)}
|
||||
value={searchUserName}
|
||||
onChange={(e) =>
|
||||
setSearchUserName(e.target.value.trimStart())
|
||||
}
|
||||
className={styles.searchInput}
|
||||
/>
|
||||
<input
|
||||
type="text"
|
||||
placeholder={t(
|
||||
getTranslationID("userListPage.label.email")
|
||||
)}
|
||||
value={searchEmail}
|
||||
onChange={(e) =>
|
||||
setSearchEmail(e.target.value.trimStart())
|
||||
}
|
||||
className={styles.searchInput}
|
||||
/>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
|
||||
<button
|
||||
className={`${styles.menuLink} ${
|
||||
!isLoading ? styles.isActive : ""
|
||||
}`}
|
||||
type="submit"
|
||||
disabled={isLoading}
|
||||
>
|
||||
<img
|
||||
src={searchIcon}
|
||||
alt="search"
|
||||
className={styles.menuIcon}
|
||||
/>
|
||||
{t(getTranslationID("userListPage.label.search"))}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
<div className={styles.tableWrap}>
|
||||
<table className={`${styles.table} ${styles.user}`}>
|
||||
@ -387,13 +255,9 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
</li>
|
||||
</>
|
||||
)}
|
||||
{/* ユーザー削除 CCB後回し分なので今は非表示
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
onClick={() => {
|
||||
onDeleteUser(user.id);
|
||||
}}
|
||||
>
|
||||
<a href="">
|
||||
{t(
|
||||
getTranslationID(
|
||||
"userListPage.label.deleteUser"
|
||||
@ -401,23 +265,7 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
{/* 第五階層の管理者が、メール認証済みではないユーザーの行をマウスオーバーしている場合のみ */}
|
||||
{isTier5 && !user.emailVerified && (
|
||||
<li>
|
||||
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
|
||||
<a
|
||||
onClick={() => {
|
||||
onForceEmailVerification(user.id);
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
getTranslationID(
|
||||
"userListPage.label.forceEmailVerification"
|
||||
)
|
||||
)}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
*/}
|
||||
</ul>
|
||||
</td>
|
||||
<td> {user.name}</td>
|
||||
|
||||
@ -28,11 +28,10 @@ import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
interface UserAddPopupProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
clearUserSearchInputs: () => void;
|
||||
}
|
||||
|
||||
export const UserAddPopup: React.FC<UserAddPopupProps> = (props) => {
|
||||
const { isOpen, onClose, clearUserSearchInputs } = props;
|
||||
const { isOpen, onClose } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
const [isPasswordHide, setIsPasswordHide] = useState<boolean>(true);
|
||||
@ -76,7 +75,6 @@ export const UserAddPopup: React.FC<UserAddPopupProps> = (props) => {
|
||||
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
closePopup();
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
}, [
|
||||
|
||||
@ -28,11 +28,10 @@ import progress_activit from "../../assets/images/progress_activit.svg";
|
||||
interface UserUpdatePopupProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
clearUserSearchInputs: () => void;
|
||||
}
|
||||
|
||||
export const UserUpdatePopup: React.FC<UserUpdatePopupProps> = (props) => {
|
||||
const { isOpen, onClose, clearUserSearchInputs } = props;
|
||||
const { isOpen, onClose } = props;
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { t } = useTranslation();
|
||||
const closePopup = useCallback(() => {
|
||||
@ -80,7 +79,6 @@ export const UserUpdatePopup: React.FC<UserUpdatePopupProps> = (props) => {
|
||||
|
||||
if (meta.requestStatus === "fulfilled") {
|
||||
closePopup();
|
||||
clearUserSearchInputs();
|
||||
dispatch(listUsersAsync());
|
||||
}
|
||||
}, [
|
||||
|
||||
@ -15,8 +15,11 @@ const UserVerifyPage: React.FC = (): JSX.Element => {
|
||||
const jwt = query.get("verify") ?? "";
|
||||
|
||||
useEffect(() => {
|
||||
if (!jwt) {
|
||||
navigate("/mail-confirm/failed");
|
||||
}
|
||||
dispatch(userVerifyAsync({ jwt }));
|
||||
}, [dispatch, jwt]);
|
||||
}, [navigate, dispatch, jwt]);
|
||||
|
||||
const verifyState = useSelector(VerifyStateSelector);
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import Footer from "components/footer";
|
||||
import Header from "components/header";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
@ -137,6 +138,7 @@ const WorktypeIdSettingPage: React.FC = (): JSX.Element => {
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div>
|
||||
<div className={styles.pageHeader}>
|
||||
|
||||
@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useState } from "react";
|
||||
import Header from "components/header";
|
||||
import Footer from "components/footer";
|
||||
import styles from "styles/app.module.scss";
|
||||
import { UpdateTokenTimer } from "components/auth/updateTokenTimer";
|
||||
import ruleAddImg from "assets/images/rule_add.svg";
|
||||
import templateSettingImg from "assets/images/template_setting.svg";
|
||||
import worktypeSettingImg from "assets/images/worktype_setting.svg";
|
||||
@ -82,6 +83,7 @@ const WorkflowPage: React.FC = (): JSX.Element => {
|
||||
>
|
||||
{delegationAccessToken && <DelegationBar />}
|
||||
<Header />
|
||||
<UpdateTokenTimer />
|
||||
<main className={styles.main}>
|
||||
<div className="">
|
||||
<div className={styles.pageHeader}>
|
||||
|
||||
@ -454,6 +454,7 @@ h3 + .brCrumb .tlIcon {
|
||||
.brCrumbLicense li a:hover {
|
||||
color: #0084b2;
|
||||
}
|
||||
|
||||
.buttonNormal {
|
||||
display: inline-block;
|
||||
width: 15rem;
|
||||
@ -1629,43 +1630,6 @@ _:-ms-lang(x)::-ms-backdrop,
|
||||
margin-bottom: 5rem;
|
||||
}
|
||||
|
||||
.formList.userImport .formTitle {
|
||||
padding: 1rem 4% 0;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.formList.userImport dt:not(.formTitle) {
|
||||
width: 30%;
|
||||
padding: 0 4% 0 4%;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.formList.userImport dt:not(.formTitle):nth-of-type(odd) {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.formList.userImport dt:not(.formTitle):nth-of-type(odd) + dd {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.formList.userImport dd {
|
||||
width: 58%;
|
||||
padding: 0.2rem 4% 0.2rem 0;
|
||||
margin-bottom: 0;
|
||||
white-space: pre-line;
|
||||
word-wrap: break-word;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.formList.userImport dd.full {
|
||||
width: 100%;
|
||||
padding: 0.2rem 4% 0.2rem 4%;
|
||||
}
|
||||
.formList.userImport dd.full .buttonText {
|
||||
padding: 0 0 0.8rem;
|
||||
}
|
||||
.formList.userImport dd .menuLink {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.6rem;
|
||||
padding: 0.5rem 1.5rem 0.5rem 1.3rem;
|
||||
}
|
||||
|
||||
.account .listVertical {
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
@ -1698,9 +1662,9 @@ _:-ms-lang(x)::-ms-backdrop,
|
||||
margin-left: 648px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.menuAction {
|
||||
margin-bottom: 0.6rem;
|
||||
position: relative;
|
||||
}
|
||||
.menuAction li {
|
||||
display: inline-block;
|
||||
@ -1893,18 +1857,6 @@ tr.isSelected .menuInTable li a.isDisable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.license .checkAvail {
|
||||
height: 30px;
|
||||
padding: 0 0.3rem 0.3rem 0;
|
||||
margin-top: -30px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.license .checkAvail label {
|
||||
cursor: pointer;
|
||||
}
|
||||
.license .checkAvail label .formCheck {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.license .listVertical dd img[src*="circle"] {
|
||||
filter: brightness(0) saturate(100%) invert(58%) sepia(41%) saturate(5814%)
|
||||
hue-rotate(143deg) brightness(96%) contrast(101%);
|
||||
@ -1998,69 +1950,11 @@ tr.isSelected .menuInTable li a.isDisable {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.formList dd.ownerChange {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.formList dd.ownerChange p.Owner,
|
||||
.formList dd.ownerChange p.newOwner {
|
||||
width: 150px;
|
||||
}
|
||||
.formList dd.ownerChange .arrowR {
|
||||
width: 8%;
|
||||
height: 20px;
|
||||
margin-top: 10px;
|
||||
margin-right: 2%;
|
||||
background: #e6e6e6;
|
||||
position: relative;
|
||||
}
|
||||
.formList dd.ownerChange .arrowR::after {
|
||||
content: "";
|
||||
border-top: 20px transparent solid;
|
||||
border-bottom: 20px transparent solid;
|
||||
border-left: 20px #e6e6e6 solid;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: -15px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.formList dd.ownerChange + .full {
|
||||
width: 66%;
|
||||
margin-left: 30%;
|
||||
margin-bottom: -10px;
|
||||
text-align: center;
|
||||
}
|
||||
.formList dd.ownerChange + .full .transOwner {
|
||||
width: 100px;
|
||||
}
|
||||
.formList dd.lowerTrans {
|
||||
margin-bottom: 1.5rem;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
.formList dd.lowerTrans select,
|
||||
.formList dd.lowerTrans span {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.formList dd .txName {
|
||||
display: block;
|
||||
width: 150px;
|
||||
padding: 0.2rem 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dictation .menuAction {
|
||||
margin-top: -1rem;
|
||||
height: 34px;
|
||||
position: relative;
|
||||
}
|
||||
.dictation .menuAction:not(:first-child) {
|
||||
margin-top: 0.6rem;
|
||||
}
|
||||
.dictation .menuAction .alignLeft {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@ -2378,9 +2272,6 @@ tr.isSelected .menuInTable li a.isDisable {
|
||||
.formList.property dt:not(.formTitle):nth-of-type(odd) + dd {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
.formList.property dt:has(+ dd.hasInput) {
|
||||
padding-top: 0.4rem;
|
||||
}
|
||||
.formList.property dd {
|
||||
width: 58%;
|
||||
padding: 0.2rem 4% 0.2rem 0;
|
||||
@ -2392,16 +2283,6 @@ tr.isSelected .menuInTable li a.isDisable {
|
||||
.formList.property dd img {
|
||||
height: 1.1rem;
|
||||
}
|
||||
.formList.property dd .formInput.short {
|
||||
width: 250px;
|
||||
padding: 0.3rem 0.3rem 0.1rem;
|
||||
}
|
||||
.formList.property dd .formSubmit {
|
||||
min-width: auto;
|
||||
padding: 0.2rem 0.5rem;
|
||||
position: absolute;
|
||||
right: 0.5rem;
|
||||
}
|
||||
.formList.property dd.full {
|
||||
width: 100%;
|
||||
padding: 0.2rem 4% 0.2rem 4%;
|
||||
@ -2767,106 +2648,4 @@ tr.isSelected .menuInTable li a.isDisable {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.modal.isShow .searchModalBox {
|
||||
display: block;
|
||||
}
|
||||
.searchModalBox {
|
||||
display: none;
|
||||
width: 70vw; /* 70% of the viewport width */
|
||||
height: 70vh; /* 70% of the viewport height */
|
||||
max-height: 95vh;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
border-radius: 0.3rem;
|
||||
overflow: auto;
|
||||
background-color: #fff;
|
||||
padding: 1rem;
|
||||
}
|
||||
.searchBar {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.searchInput {
|
||||
padding: 8px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.headerContainer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1rem;
|
||||
margin-left: -30px;
|
||||
}
|
||||
.breadcrumbPopup {
|
||||
position: absolute;
|
||||
background: white;
|
||||
border: 1px solid #000;
|
||||
padding: 0.3rem 0.3rem;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
||||
z-index: 10;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
}
|
||||
.brCrumbPartner {
|
||||
margin: 0.5rem 0 0.3rem;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
justify-content: center;
|
||||
}
|
||||
.brCrumbPartner li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1;
|
||||
letter-spacing: 0.04rem;
|
||||
white-space: nowrap;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
.brCrumbPartner li:not(:last-child)::after {
|
||||
content: "";
|
||||
border-top: 5px solid transparent;
|
||||
border-bottom: 5px solid transparent;
|
||||
border-left: 7px solid #333333;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.hoverBlue {
|
||||
cursor: pointer;
|
||||
color: inherit;
|
||||
&:hover {
|
||||
color: #0084b2;
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgb(255, 255, 255);
|
||||
opacity: 0.5;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1000;
|
||||
}
|
||||
.overlay .icLoading {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style.css.map */
|
||||
|
||||
20
dictation_client/src/styles/app.module.scss.d.ts
vendored
20
dictation_client/src/styles/app.module.scss.d.ts
vendored
@ -108,12 +108,11 @@ declare const classNames: {
|
||||
readonly clm0: "clm0";
|
||||
readonly menuInTable: "menuInTable";
|
||||
readonly isSelected: "isSelected";
|
||||
readonly userImport: "userImport";
|
||||
readonly menuLink: "menuLink";
|
||||
readonly odd: "odd";
|
||||
readonly alignRight: "alignRight";
|
||||
readonly menuAction: "menuAction";
|
||||
readonly inTable: "inTable";
|
||||
readonly menuLink: "menuLink";
|
||||
readonly menuIcon: "menuIcon";
|
||||
readonly colorLink: "colorLink";
|
||||
readonly isDisable: "isDisable";
|
||||
@ -124,18 +123,10 @@ declare const classNames: {
|
||||
readonly txNormal: "txNormal";
|
||||
readonly manageIcon: "manageIcon";
|
||||
readonly manageIconClose: "manageIconClose";
|
||||
readonly checkAvail: "checkAvail";
|
||||
readonly history: "history";
|
||||
readonly cardHistory: "cardHistory";
|
||||
readonly partner: "partner";
|
||||
readonly isOpen: "isOpen";
|
||||
readonly ownerChange: "ownerChange";
|
||||
readonly Owner: "Owner";
|
||||
readonly newOwner: "newOwner";
|
||||
readonly arrowR: "arrowR";
|
||||
readonly transOwner: "transOwner";
|
||||
readonly lowerTrans: "lowerTrans";
|
||||
readonly txName: "txName";
|
||||
readonly alignLeft: "alignLeft";
|
||||
readonly displayOptions: "displayOptions";
|
||||
readonly tableFilter: "tableFilter";
|
||||
@ -201,7 +192,6 @@ declare const classNames: {
|
||||
readonly hideO10: "hideO10";
|
||||
readonly op10: "op10";
|
||||
readonly property: "property";
|
||||
readonly hasInput: "hasInput";
|
||||
readonly formChange: "formChange";
|
||||
readonly chooseMember: "chooseMember";
|
||||
readonly holdMember: "holdMember";
|
||||
@ -233,13 +223,5 @@ declare const classNames: {
|
||||
readonly txContents: "txContents";
|
||||
readonly txIcon: "txIcon";
|
||||
readonly txWswrap: "txWswrap";
|
||||
readonly searchModalBox: "searchModalBox";
|
||||
readonly searchBar: "searchBar";
|
||||
readonly searchInput: "searchInput";
|
||||
readonly headerContainer: "headerContainer";
|
||||
readonly breadcrumbPopup: "breadcrumbPopup";
|
||||
readonly brCrumbPartner: "brCrumbPartner";
|
||||
readonly hoverBlue: "hoverBlue";
|
||||
readonly overlay: "overlay";
|
||||
};
|
||||
export = classNames;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user