UX: Replace route when users try to access invalid group management page.

https://meta.discourse.org/t/unable-to-save-changes-to-a-group/84954
This commit is contained in:
Guo Xiang Tan 2018-04-11 10:55:45 +08:00
parent f40f10240c
commit 9176b2591d
3 changed files with 20 additions and 2 deletions

View File

@ -0,0 +1,5 @@
export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.manage.interaction.title');
},
});

View File

@ -0,0 +1,11 @@
export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.manage.membership.title');
},
afterModel(group) {
if (group.get('automatic')) {
this.replaceWith("group.manage.interaction", group);
}
},
});

View File

@ -3,7 +3,9 @@ export default Discourse.Route.extend({
return I18n.t('groups.manage.profile.title');
},
model() {
return this.modelFor('group');
afterModel(group) {
if (group.get('automatic')) {
this.replaceWith("group.manage.interaction", group);
}
},
});