Skip to content

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

Merged
merged 7 commits into from
May 9, 2025

Conversation

daniel-heppner-ibigroup
Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup commented Apr 16, 2025

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JSDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing
  • The description lists all relevant PRs included in this release (remove this if not merging to master)
  • e2e tests are all passing (remove this if not merging to master)

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.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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))
Copy link
Contributor

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)

Copy link
Contributor

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.

Copy link
Contributor Author

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>
Copy link
Contributor

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?

Copy link
Contributor Author

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')}
Copy link
Contributor

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.)

Copy link
Contributor Author

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

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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!

Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@daniel-heppner-ibigroup daniel-heppner-ibigroup merged commit 70adc13 into dev May 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants