-
Notifications
You must be signed in to change notification settings - Fork 82
feat: support overriding feed filenames #1030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the bundle filename validation crash when creating a new feed source and fix the failing flow checks (I indicated a few, but there are probably more).
url: !model.url || validator.isURL(model.url) | ||
name: !!model.name && model.name.length > 0, | ||
url: !model.url || validator.isURL(model.url), | ||
filename: !model.filename || (/^[^<>:"/\\|?* ]*$/.test(model.filename) && !/\.zip$/i.test(model.filename)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the first .test()
doing? (Add a comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line might not be passing flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're both checking the regexes, but the regexes do different things.
@@ -195,6 +199,21 @@ export default class CreateFeedSource extends Component<Props, State> { | |||
</small> | |||
</FormGroup> | |||
</ListGroupItem> | |||
<ListGroupItem> | |||
<FormGroup validationState={validationState(validation.filename)}> | |||
<ControlLabel>Override filename for bundle (optional)</ControlLabel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to use a localized message here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use the localized messages in this file because nothing else here is localized and I didn't want to add support for localization as part of this PR because it felt out of scope. I haven't looked into how to get the localization object into a component though, so I don't know how hard it is.
disabled={!model.deployable} | ||
name={'filename'} | ||
placeholder='e.g., agency_bundle.zip' | ||
onChange={this._onInputChange('filename')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show stopper: Typing the suggested file name followed by ".zip" crashes the "Create Feed Source" UI. (There is no crash when editing an existing feed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to replicate the crash, maybe I fixed it through other fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now with the latest changes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works great! Beautuifl
@@ -759,6 +764,7 @@ components: | |||
title: Log in | |||
ManagerHeader: | |||
noUpdateYet: n/a | |||
bundleFilename: Bundle Filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not re-use the string from feed info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annoyingly, the way the internationalization works in DT is that the key is already scoped to ManagerHeader inside the ManagerHeader component, so you can't reach to other strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Checklist
dev
before they can be merged tomaster
)Description
This PR adds support for overriding the feed filenames that will be used in the bundle. This feature allows us to override feed specific build settings in the build config.