Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Autofill Community ID from Community Name #5656

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/views/dialogs/CreateGroupDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class CreateGroupDialog extends React.Component {
state = {
groupName: '',
groupId: '',
groupIdHasOwnValue: false,
groupError: null,
creating: false,
createError: null,
Expand All @@ -37,12 +38,16 @@ export default class CreateGroupDialog extends React.Component {
_onGroupNameChange = e => {
this.setState({
groupName: e.target.value,
groupId: !this.state.groupIdHasOwnValue
? e.target.value.toLowerCase().replace(/[^0-9a-z=_\-./]+/g, '-')
: this.state.groupId,
});
};

_onGroupIdChange = e => {
this.setState({
groupId: e.target.value,
groupIdHasOwnValue: Boolean(e.target.value),
});
};

Expand Down