Skip to content

Commit 2d62c9f

Browse files
committed
refactor(transformations): add error for including .txt
1 parent 44807e7 commit 2d62c9f

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

i18n/english.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ components:
489489
label: Replace %tablePlaceholder% from %versionPlaceholder%
490490
name: Replace file from version transformation
491491
FeedTransformationErrors:
492+
csvNameContainsTxt: Custom CSV name cannot contain .txt
492493
csvMissingName: Custom CSV must have a name.
493494
undefinedCSVData: CSV data must be defined.
494495
undefinedTable: Table must be defined

i18n/german.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,7 @@ components:
14621462
numLines: "%numLines% lines."
14631463
FeedTransformationErrors:
14641464
csvMissingName: Custom CSV must have a name.
1465+
csvNameContainsTxt: Custom CSV name cannot contain .txt
14651466
undefinedCSVData: CSV data must be defined.
14661467
undefinedTable: Table must be defined
14671468
PatternStopCard:

i18n/polish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ components:
14331433
adminTestFailed: You have attempted to view a restricted page without proper credentials
14341434
FeedTransformationErrors:
14351435
csvMissingName: Custom CSV must have a name.
1436+
csvNameContainsTxt: Custom CSV name cannot contain .txt
14361437
undefinedCSVData: CSV data must be defined.
14371438
undefinedTable: Table must be defined
14381439
PatternStopCard:

lib/manager/components/transform/AddCustomFile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export default class AddCustomFile extends Component<TransformProps<AddCustomFil
5858
if (!table) {
5959
issues.push(CSV_VALIDATION_ERRORS.CSV_MUST_HAVE_NAME)
6060
}
61+
if (table && table.includes('.txt')) {
62+
issues.push(CSV_VALIDATION_ERRORS.CSV_NAME_CONTAINS_TXT)
63+
}
6164
return issues
6265
}
6366

lib/manager/util/enums/transform.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Values are keys to YAML error messages.
33
const CSV_VALIDATION_ERRORS = {
44
CSV_MUST_HAVE_NAME: 'csvMissingName',
5+
CSV_NAME_CONTAINS_TXT: 'csvNameContainsTxt',
56
TABLE_MUST_BE_DEFINED: 'undefinedTable',
67
UNDEFINED_CSV_DATA: 'undefinedCSVData'
78
}

0 commit comments

Comments
 (0)