gitlab-org--gitlab-foss/app/assets/javascripts/group.js
Douglas Lovell d0beb755f9 Add a name field to the group edit form
Enables user specification of group name vs. name inferred from group path.

Cause new group form to copy name from path

Adds some new page-specific javascript that copies entry from the
group path field to the group name field when the group name field
is initially empty.

Remove duplicate group name entry field on group edit form

This corrects the duplicated name entry field and tests that the
JavaScript does not update the group name field if the user
edits the group path.  (Editing the group path is not recommended
in any case, but it is possible.)

Address eslint errors in group.js

Enable group name copy with dispatch and explore group creation

The dispatch and explore group creation forms require the group.js
asset, and their tests now require testing against poltergeist

Update workflow new group instruction

Update the gitlab basics group creation document

Add a change log entry

Remove unused variable for eslint
2017-04-09 08:43:49 -05:00

21 lines
569 B
JavaScript

export default class Group {
constructor() {
this.groupPath = $('#group_path');
this.groupName = $('#group_name');
this.updateHandler = this.update.bind(this);
this.resetHandler = this.reset.bind(this);
if (this.groupName.val() === '') {
this.groupPath.on('keyup', this.updateHandler);
this.groupName.on('keydown', this.resetHandler);
}
}
update() {
this.groupName.val(this.groupPath.val());
}
reset() {
this.groupPath.off('keyup', this.updateHandler);
this.groupName.off('keydown', this.resetHandler);
}
}