-
Notifications
You must be signed in to change notification settings - Fork 391
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
fix: description state management in EnvironmentSettingsPage #4917
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Docker builds report
|
Uffizzi Ephemeral Environment
|
@@ -61,7 +61,7 @@ const EnvironmentSettingsPage = class extends Component { | |||
const env = ProjectStore.getEnvs().find( | |||
(v) => v.api_key === this.props.match.params.environmentId, | |||
) | |||
this.setState({ env }) | |||
this.setState({ env, description: env.description ?? "" }) |
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'm interested to know why description
has to be handled differently? Shouldn't it just be updated as part of the environment object? 🤔
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.
My approach here was to make sure we're consistent in how we're getting and updating the data from, previously we were mixing internal states with context one, which in my opinion is more confusing and prone to bugs. So, either using environment object or description internal states is fine.
value={
typeof this.state.description === 'string'
? this.state.description
: env.description
}
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Before
not_fixed.mov
After
fixed.mov
How did you test this code?
Please describe.