saito.k 9ca4ae61f8 Merged PR 434: 画面実装(テンプレートファイルアップロードPopupデザイン)
## 概要
[Task2664: 画面実装(テンプレートファイルアップロードPopupデザイン)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2664)

- デザイン反映
- ファイルピッカーからファイル取得→storeに保存

## レビューポイント
- デザイン反映に不備はあるか
- 想定としてstoreに保持したfileを、Operationsでblobにアップロードする流れにしようとしているがよさそうか

## UIの変更
- https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task2664?csf=1&web=1&e=optFai

## 動作確認状況
- ローカルで確認、develop環境で確認など

## 補足
- 相談、参考資料などがあれば
2023-09-25 07:53:45 +00:00

27 lines
809 B
TypeScript

import { RootState } from "app/store";
import { UPLOAD_FILE_SIZE_LIMIT } from "./constants";
export const selectTemplates = (state: RootState) =>
state.template.domain.templates;
export const selectIsLoading = (state: RootState) =>
state.template.apps.isLoading;
export const selectUploadFile = (state: RootState) =>
state.template.apps.uploadFile;
export const selectUploadFileError = (state: RootState) => {
const { uploadFile } = state.template.apps;
// 必須チェック
if (!uploadFile) {
return { hasErrorRequired: true, hasErrorFileSize: false };
}
// ファイルサイズチェック(5MB)
if (uploadFile.size > UPLOAD_FILE_SIZE_LIMIT) {
return { hasErrorRequired: false, hasErrorFileSize: true };
}
return { hasErrorRequired: false, hasErrorFileSize: false };
};