Merged PR 791: タスク一覧画面の取得件数が10件となっているバグの対応

## 概要
[Task3815: タスク一覧画面の取得件数が10件となっているバグの対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3815)

- OptionItemのソート順を変換処理の中で行うように修正
  - OrderByでソートするのはfindメソッドの作り的に無理そうなので
  - 調査にも時間がかかるため

## レビューポイント
- タスクの中にこのバグが発生した原因を記載し、なぜこの修正にしたのか記述したのでそちらを確認していただいて変なところがあれば指摘していただきたいです。
  - 書いている内容がよくわからない場合は、ハドルでの説明をさせてください。

## UIの変更
- Before/Afterのスクショなど
- スクショ置き場

## 動作確認状況
- ローカルで確認

## 補足
- 相談、参考資料などがあれば
This commit is contained in:
saito.k 2024-02-29 01:16:15 +00:00
parent 6d56255a5a
commit ce6e09a7d0
2 changed files with 12 additions and 19 deletions

View File

@ -79,12 +79,18 @@ const createTask = (
const createAudioOptionItems = (
optionItems: AudioOptionItemEntity[],
): AudioOptionItem[] => {
return optionItems.map((x) => {
return {
optionItemLabel: x.label,
optionItemValue: x.value,
};
});
// バグ 3786: [FB対応]タスク一覧画面のOptionItemがソート条件によって表示順がおかしくなる の対応
// 並び順をID順に固定する
// 本来はRepository側でソートするべきだが、TYPEORMの仕様でソートすると取得件数が想定通りに取得できないため、ここでソートする
// 詳細は タスク 3815: タスク一覧画面の取得件数が10件となっているバグの対応
return optionItems
.sort((a: AudioOptionItemEntity, b: AudioOptionItemEntity) => a.id - b.id)
.map((x) => {
return {
optionItemLabel: x.label,
optionItemValue: x.value,
};
});
};
// Repository側のDTOからAssigneeオブジェクトを構築する

View File

@ -1462,91 +1462,78 @@ const makeOrder = (
priority: 'DESC',
job_number: direction,
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'STATUS':
return {
priority: 'DESC',
status: direction,
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'TRANSCRIPTION_FINISHED_DATE':
return {
priority: 'DESC',
finished_at: direction,
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'TRANSCRIPTION_STARTED_DATE':
return {
priority: 'DESC',
started_at: direction,
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'AUTHOR_ID':
return {
priority: 'DESC',
file: { author_id: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'ENCRYPTION':
return {
priority: 'DESC',
file: { is_encrypted: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'FILE_LENGTH':
return {
priority: 'DESC',
file: { duration: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'FILE_NAME':
return {
priority: 'DESC',
file: { file_name: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'FILE_SIZE':
return {
priority: 'DESC',
file: { file_size: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'RECORDING_FINISHED_DATE':
return {
priority: 'DESC',
file: { finished_at: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'RECORDING_STARTED_DATE':
return {
priority: 'DESC',
file: { started_at: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'UPLOAD_DATE':
return {
priority: 'DESC',
file: { uploaded_at: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
case 'WORK_TYPE':
return {
priority: 'DESC',
file: { work_type_id: direction },
id: 'ASC',
option_items: { id: 'ASC' },
};
default:
// switchのcase漏れが発生した場合に型エラーになるようにする