This commit is contained in:
Joffrey JAFFEUX 2019-09-11 10:30:39 -05:00
parent 51a0b9318a
commit a3ae064654
7 changed files with 10 additions and 19 deletions

View File

@ -55,10 +55,10 @@ export default Ember.Controller.extend({
}, },
@computed("selectedItem", "editing") @computed("selectedItem", "editing")
selectedGroupNames(selectedItem) { selectedGroupNames() {
const groupIds = this.selectedItem.group_ids || []; const groupIds = this.selectedItem.group_ids || [];
const groupNames = groupIds.map(id => { const groupNames = groupIds.map(id => {
return this.groupOptions.find(groupOption => groupOption.id == id).name; return this.groupOptions.find(groupOption => groupOption.id === id).name;
}); });
return groupNames.join(", "); return groupNames.join(", ");
}, },
@ -97,7 +97,7 @@ export default Ember.Controller.extend({
this.set("loading", true); this.set("loading", true);
if (this.get("selectedItem.description") === "") if (this.get("selectedItem.description") === "")
this.set("selectedItem.description", ""); this.set("selectedItem.description", "");
return this.selectedItem return this.selectedItem
.save() .save()
.then(() => { .then(() => {

View File

@ -1,10 +1,3 @@
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";
import { ajax } from "discourse/lib/ajax";
import {
default as computed,
observes
} from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({ export default Ember.Controller.extend({
queries: Ember.computed.alias("model.queries") queries: Ember.computed.alias("model.queries")
}); });

View File

@ -1,10 +1,5 @@
import Query from "discourse/plugins/discourse-data-explorer/discourse/models/query";
import { popupAjaxError } from "discourse/lib/ajax-error"; import { popupAjaxError } from "discourse/lib/ajax-error";
import { ajax } from "discourse/lib/ajax"; import { ajax } from "discourse/lib/ajax";
import {
default as computed,
observes
} from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({ export default Ember.Controller.extend({
showResults: false, showResults: false,

View File

@ -5,7 +5,9 @@ export default Discourse.Route.extend({
model() { model() {
const groupPromise = this.store.findAll("group"); const groupPromise = this.store.findAll("group");
const schemaPromise = ajax("/admin/plugins/explorer/schema.json", { cache: true }); const schemaPromise = ajax("/admin/plugins/explorer/schema.json", {
cache: true
});
const queryPromise = this.store.findAll("query"); const queryPromise = this.store.findAll("query");
return groupPromise return groupPromise

View File

@ -16,12 +16,13 @@ export default Discourse.Route.extend({
this.transitionTo("group.members", group); this.transitionTo("group.members", group);
}); });
}, },
afterModel(model) { afterModel(model) {
if ( if (
!model.group.get("is_group_user") && !model.group.get("is_group_user") &&
!(this.currentUser && this.currentUser.admin) !(this.currentUser && this.currentUser.admin)
) { ) {
this.transitionTo("group.members", group); this.transitionTo("group.members", model.group);
} }
}, },

View File

@ -12,7 +12,7 @@ export default Discourse.Route.extend({
group: group group: group
}; };
}) })
.catch(err => { .catch(() => {
this.transitionTo("group.members", group); this.transitionTo("group.members", group);
}); });
}, },

View File

@ -14,7 +14,7 @@ table.group-reports {
} }
tbody { tbody {
border-top: 3px solid #e3ebf2; border-top: 3px solid #e3ebf2;
tr { tr {
border-bottom: 1px solid #e3ebf2; border-bottom: 1px solid #e3ebf2;