mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
New user role: view analytics
This commit is contained in:
parent
b65a00dd1c
commit
19a916a4b4
13 changed files with 68 additions and 29 deletions
|
@ -27,7 +27,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
init() {
|
||||
this._super(...arguments);
|
||||
this.password = {};
|
||||
this.selectedUsers = [];
|
||||
this.selectedUsers = [];
|
||||
},
|
||||
|
||||
didReceiveAttrs() {
|
||||
|
@ -91,6 +91,13 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
cb(user);
|
||||
},
|
||||
|
||||
toggleAnalytics(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
user.set('analytics', !user.get('analytics'));
|
||||
let cb = this.get('onSave');
|
||||
cb(user);
|
||||
},
|
||||
|
||||
toggleUsers(id) {
|
||||
let user = this.users.findBy("id", id);
|
||||
user.set('viewUsers', !user.get('viewUsers'));
|
||||
|
@ -208,7 +215,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
|
||||
this.get('groupSvc').leave(groupId, userId).then(() => {
|
||||
this.filterUsers();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onJoinGroup(groupId) {
|
||||
|
@ -222,7 +229,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
|
||||
this.get('groupSvc').join(groupId, userId).then(() => {
|
||||
this.filterUsers();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -22,6 +22,7 @@ export default Model.extend({
|
|||
editor: attr('boolean', { defaultValue: false }),
|
||||
admin: attr('boolean', { defaultValue: false }),
|
||||
viewUsers: attr('boolean', { defaultValue: false }),
|
||||
analytics: attr('boolean', { defaultValue: false }),
|
||||
global: attr('boolean', { defaultValue: false }),
|
||||
accounts: attr(),
|
||||
groups: attr(),
|
||||
|
|
|
@ -386,6 +386,8 @@ export default Service.extend({
|
|||
let userHasChangeAwaitingReview = false;
|
||||
let userHasChangeRejected = false;
|
||||
|
||||
if (is.null(source) || is.undefined(source)) source = "";
|
||||
|
||||
return this.get('ajax').request(`fetch/page/${documentId}?source=${source}`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="view-customize my-5">
|
||||
|
||||
|
||||
<div class="my-2">
|
||||
<span class="font-weight-bold">Spaces</span>
|
||||
<span class="text-muted"> — can add spaces, both personal and shared with others</span>
|
||||
|
@ -12,6 +12,10 @@
|
|||
<span class="font-weight-bold">Admin</span>
|
||||
<span class="text-muted"> — can manage all aspects of Documize, like this screen</span>
|
||||
</div>
|
||||
<div class="my-2">
|
||||
<span class="font-weight-bold">Analytics</span>
|
||||
<span class="text-muted"> — can view analytical reports</span>
|
||||
</div>
|
||||
<div class="mt-2 mb-4">
|
||||
<span class="font-weight-bold">Active</span>
|
||||
<span class="text-muted"> — can login and use Documize</span>
|
||||
|
@ -28,11 +32,12 @@
|
|||
<th class="text-muted">
|
||||
{{#if hasSelectedUsers}}
|
||||
<button id="bulk-delete-users" type="button" class="btn btn-danger" data-toggle="modal" data-target="#admin-user-delete-modal" data-backdrop="static">Delete selected users</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</th>
|
||||
<th class="no-width">Spaces</th>
|
||||
<th class="no-width">Visible</th>
|
||||
<th class="no-width">Admin</th>
|
||||
<th class="no-width">Analytics</th>
|
||||
<th class="no-width">Active</th>
|
||||
<th class="no-width">
|
||||
</th>
|
||||
|
@ -87,6 +92,13 @@
|
|||
<i class="material-icons checkbox" {{action 'toggleAdmin' user.id}}>check_box_outline_blank</i>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="no-width text-center">
|
||||
{{#if user.analytics}}
|
||||
<i class="material-icons checkbox" {{action 'toggleAnalytics' user.id}}>check_box</i>
|
||||
{{else}}
|
||||
<i class="material-icons checkbox" {{action 'toggleAnalytics' user.id}}>check_box_outline_blank</i>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="no-width text-center">
|
||||
{{#if user.me}}
|
||||
<i class="material-icons color-gray">check_box</i>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue