mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 09:48:10 -05:00
Fixed group modal
This commit is contained in:
@@ -97,6 +97,9 @@ CNAMEs need to be created for the various services. Create the CNAMEs below with
|
|||||||
|
|
||||||
After doing this, you should have the following domains: api.domain.com, account.domain.com, media.domain.com, admin.domain.compose
|
After doing this, you should have the following domains: api.domain.com, account.domain.com, media.domain.com, admin.domain.compose
|
||||||
|
|
||||||
|
openmhz.test:3000
|
||||||
|
|
||||||
|
|
||||||
### Mailjet
|
### Mailjet
|
||||||
Sign up for MailJet!
|
Sign up for MailJet!
|
||||||
https://www.mailjet.com
|
https://www.mailjet.com
|
||||||
|
|||||||
@@ -65,18 +65,21 @@ class GroupModal extends Component {
|
|||||||
// we want to remove that are part of the Group from the list on the Left
|
// we want to remove that are part of the Group from the list on the Left
|
||||||
const group = { name: editGroup.groupName, items: items }
|
const group = { name: editGroup.groupName, items: items }
|
||||||
this.setState({ group: group, talkgroups: talkgroups, groupName: editGroup.groupName });
|
this.setState({ group: group, talkgroups: talkgroups, groupName: editGroup.groupName });
|
||||||
} else {
|
|
||||||
// If we are not editing, make sure there is the full list on the left.
|
|
||||||
this.setState({ talkgroups: this.props.talkgroups })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.talkgroups && !prevProps.talkgroups) {
|
||||||
|
// If we are not editing, make sure there is the full list on the left.
|
||||||
|
this.setState({ talkgroups: [...this.props.talkgroups] })
|
||||||
|
}
|
||||||
|
|
||||||
// If we are done editing, clear out the modal
|
// If we are done editing, clear out the modal
|
||||||
if (!this.props.editGroupId && (this.props.editGroupId !== prevProps.editGroupId)) {
|
if (!this.props.editGroupId && (this.props.editGroupId !== prevProps.editGroupId)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
groupName: "", group: {
|
groupName: "", group: {
|
||||||
name: "",
|
name: "",
|
||||||
items: []
|
items: []
|
||||||
}
|
},
|
||||||
|
talkgroups: [...this.props.talkgroups]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -120,10 +123,19 @@ class GroupModal extends Component {
|
|||||||
.concat(this.state.talkgroups.slice(index + 1))
|
.concat(this.state.talkgroups.slice(index + 1))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleClose = () => this.props.onClose(false);
|
handleClose = () => {
|
||||||
|
this.setState({
|
||||||
|
groupName: "", group: {
|
||||||
|
name: "",
|
||||||
|
items: []
|
||||||
|
},
|
||||||
|
talkgroups: [...this.props.talkgroups]
|
||||||
|
});
|
||||||
|
this.props.onClose(false);
|
||||||
|
}
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
var talkgroupNums = this.state.group.items.map(a => a.num);
|
var talkgroupNums = this.state.group.items.map(a => a.num);
|
||||||
|
|
||||||
if (this.props.editGroupId) {
|
if (this.props.editGroupId) {
|
||||||
const data = {
|
const data = {
|
||||||
_id: this.props.editGroupId,
|
_id: this.props.editGroupId,
|
||||||
@@ -132,6 +144,13 @@ class GroupModal extends Component {
|
|||||||
talkgroups: JSON.stringify(talkgroupNums)
|
talkgroups: JSON.stringify(talkgroupNums)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
groupName: "", group: {
|
||||||
|
name: "",
|
||||||
|
items: []
|
||||||
|
},
|
||||||
|
talkgroups: [...this.props.talkgroups]
|
||||||
|
});
|
||||||
this.props.groupActions.updateGroup(data).then(requestMessage => {
|
this.props.groupActions.updateGroup(data).then(requestMessage => {
|
||||||
if (requestMessage) {
|
if (requestMessage) {
|
||||||
// report to the user is there was a problem during registration
|
// report to the user is there was a problem during registration
|
||||||
@@ -150,6 +169,14 @@ class GroupModal extends Component {
|
|||||||
talkgroups: JSON.stringify(talkgroupNums)
|
talkgroups: JSON.stringify(talkgroupNums)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
groupName: "", group: {
|
||||||
|
name: "",
|
||||||
|
items: []
|
||||||
|
},
|
||||||
|
talkgroups: [...this.props.talkgroups]
|
||||||
|
});
|
||||||
|
|
||||||
this.props.groupActions.createGroup(data).then(requestMessage => {
|
this.props.groupActions.createGroup(data).then(requestMessage => {
|
||||||
if (requestMessage) {
|
if (requestMessage) {
|
||||||
// report to the user is there was a problem during registration
|
// report to the user is there was a problem during registration
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class System extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidReceiveProps(prevProp) {
|
componentDidUpdate(prevProp) {
|
||||||
|
|
||||||
// If we just received the error statistics for a system, for the first time, proccess them.
|
// If we just received the error statistics for a system, for the first time, proccess them.
|
||||||
if (this.props.errors && !prevProp.errors) {
|
if (this.props.errors && !prevProp.errors) {
|
||||||
|
|||||||
Reference in New Issue
Block a user