このコミットが含まれているのは:
@@ -83,6 +83,24 @@ export const resultRepairMode = (
|
||||
: 'all'
|
||||
|
||||
|
||||
export const canEditReviewRow = (row: PostImportRow): boolean =>
|
||||
!(row.importStatus === 'created'
|
||||
|| row.importStatus === 'skipped'
|
||||
|| (row.importStatus === 'failed' && row.recoverable !== true))
|
||||
|
||||
|
||||
export const canEditResultRow = (row: PostImportRow): boolean =>
|
||||
row.recoverable === true
|
||||
&& (row.importStatus === 'failed'
|
||||
|| (row.importStatus === 'pending' && hasValidationErrors (row)))
|
||||
|
||||
|
||||
export const canRetryResultRow = (row: PostImportRow): boolean =>
|
||||
row.recoverable === true
|
||||
&& (row.importStatus === 'failed'
|
||||
|| (row.importStatus === 'pending' && !(hasValidationErrors (row))))
|
||||
|
||||
|
||||
export const resultRowMessages = (row: PostImportRow): string[] =>
|
||||
[...new Set ([
|
||||
...Object.values (row.validationErrors ?? { }).flat (),
|
||||
@@ -95,6 +113,19 @@ export const resultRowWarnings = (row: PostImportRow): string[] =>
|
||||
...row.baseWarnings])]
|
||||
|
||||
|
||||
export const hasExactSourceRows = (
|
||||
expected: number[],
|
||||
actual: Array<{ sourceRow: number }>,
|
||||
): boolean => {
|
||||
if (expected.length !== actual.length)
|
||||
return false
|
||||
|
||||
const expectedSorted = [...expected].sort ((a, b) => a - b)
|
||||
const actualSorted = actual.map (_1 => _1.sourceRow).sort ((a, b) => a - b)
|
||||
return expectedSorted.every ((value, index) => value === actualSorted[index])
|
||||
}
|
||||
|
||||
|
||||
export const replaceImportRow = (
|
||||
rows: PostImportRow[],
|
||||
nextRow: PostImportRow,
|
||||
|
||||
新しい課題から参照
ユーザをブロックする