-
Notifications
You must be signed in to change notification settings - Fork 234
COMPASS-221: DDL: Update Create Index Modal to Match new Designs #558
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
COMPASS-221: DDL: Update Create Index Modal to Match new Designs #558
Conversation
1129a13
to
53076de
Compare
Just confirming, are you saying that when there are 2 or more rows the bottom one (with 'Select a field name') can be deleted by pressing the active - button? |
Yeah, exactly! Also, it seems like the process of adding a new field hasn't been updated. Users shouldn't have to press "add another" to save the field, as fields should be saved automatically. Let me know if this isn't clear, and we can talk it through. Thanks! |
Ok that makes sense, I was wondering about that. So the add implementation is different now. So pressing the add button would make a new row at the bottom with the zero state for field and type ('Select a field name' + 'Select a type'). Now does that mean there could be multiple zero state rows if the user keeps pressing the ADD FIELD button and not filling them out? Or should this be limited to at most 1. |
Yeah - a user can press the add field without filling them out, so there could be multiple zero state rows at once. We could impose a reasonable limit to how many zero states can be shown at once. Also, if a user presses "create" without filling out their inputs, they'll see an error message along with those respective inputs highlighted in red. |
fba0087
to
8d18c39
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.
This looks good. Couple of small suggestions inline.
I fixed the following things:
- adding a red border on field validation (I guess?)
- the "add another" button is now oddly shifted to the side.
'loadIndexes', | ||
'sortIndexes', | ||
'triggerIndexCreation', | ||
'updateField', |
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.
is the updateField
action still used? If not, can you remove all occurrences of it?
handleFieldSelect(field) { | ||
this.setState({field: field}); | ||
selectName(name) { | ||
// this.setState({name: name}); |
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.
remove obsolete code if not needed (this line and others below...)
fields: React.PropTypes.array.isRequired, | ||
field: React.PropTypes.object.isRequired, | ||
idx: React.PropTypes.number.isRequired, | ||
remove: React.PropTypes.bool.isRequired |
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 does the remove
boolean prop represent? if the remove button is enabled/disabled? If so, maybe a better name would be canBeRemoved
or isRemovable
or enableRemove
or something like that.
const fieldUI = { | ||
name: field.name === '' ? DEFAULT_FIELD.name : field.name, | ||
type: field.type === '' ? DEFAULT_FIELD.type : field.type | ||
}; |
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.
Yes, this is much nicer than "misusing" the index name to represent the placeholder text. 👍
…ropdown, make highlight red same hex as error message
LGTM. |
* COMPASS-221 changed heading for field options * COMPASS-221 rough implementation of designs * Quick style fixes * COMPASS-221 mostly done, may need some css clean up * COMPASS-221 added some extra actions * COMPASS-221 implemented add create index from store to ui * COMPASS-221 implemented updating field name and type * COMPASS-221 set initial state for fields * COMPASS-221 implemented remove index field * COMPASS-221 added some error cases * COMPASS-221 clean up a few files after refactoring * COMPASS-221 added some test cases * validation of index fields, button styling * fix index store test. * COMPASS-221 disable fields that are already used * Added bottom margins for each row, truncate long field names in the dropdown, make highlight red same hex as error message * COMPASS-221 made some minor fixes after review
Backported to 1.5-releases so COMPASS-98 could be backported cleanly. |
This requires more css changes