-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement Edit Data Source #29
Conversation
f88d53e
to
5ddd74c
Compare
default: | ||
return null; | ||
} | ||
isDisabled() { |
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 be a constant instead of a function if all it does is return false.
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.
TL;DR: NO 😄
This is an implementation of super.isDisabled().
What it is for? It determines which FormControls are disabled. For example when adding, you want all of them available (maybe, for now) but in case of editing, you want to disable "Data Source Type". If you take a look at BaseDataSourceDialog, all the forms have this property disabled={this.isDisabled(<control-id>)}
.
Example: Let's say while creating a Postgres data source, you want to enforce timestamp data
, then you could do this by adding the condition inside this method:
isDisabled(controlId) {
if (controlId === "timestampData" && this.state.type === DataSourceType.Postgres) {
return true;
}
return false;
}
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.
Ah thanks for the explanation ;-)
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.
Verified locally
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 @josemigallas!
validations: { | ||
name: null, | ||
type: "success", | ||
inMemoryValues: "success" |
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.
@darahayes I think I understand what you really meant in last PR with this field. At that time I didn't realize these "values" really belonged to config.options
. I think it will work with a single generic options
that contains all the different possibilities.
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.
Sorry wrong line, I meant line 28
@darahayes @psturc @pb82
|
5b39987
to
baa7857
Compare
d944c72
to
f1c2b1e
Compare
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.
Verified latest changes
JIRA: https://issues.jboss.org/browse/AEROGEAR-3544
This PR introduces big changes to the DataSourcesDialog:
BaseDataSourceDialog
.AddDataSourceDialog
andEditDataSourceDialog
are new children classes that shares common validation logic.Important changes in
DataSourcesContainer
:selectedDataSource
that is updated whenever the "Edit" option under the three dots dropdown is selected. That property is then passed into the appropriate modal as a prop. This approach could (or would) be used to "Delete Data Source" as well. Pinging @cfoskin .