1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

WIP vendored dep upgrades

This commit is contained in:
Harvey Kandola 2018-01-19 11:36:38 +00:00
parent 5f59e95495
commit 6409ad0d63
190 changed files with 64265 additions and 109666 deletions

View file

@ -18,7 +18,7 @@ export default Component.extend({
didReceiveAttrs() {
this._super(...arguments);
this.get('documentService').getActivity(this.get('document.id')).then((activity) => {
this.get('documentService').getActivity(this.get('document.id'), 7).then((activity) => {
this.set('activity', activity);
});
}

View file

@ -18,6 +18,7 @@ export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
documentId: attr('string'),
pageId: attr('string'),
userId: attr('string'),
firstname: attr('string'),
lastname: attr('string'),

View file

@ -0,0 +1,44 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import Service, { inject as service } from '@ember/service';
export default Service.extend({
sessionService: service('session'),
ajax: service(),
store: service(),
// document number of views, edits, approvals, etc.
getDocumentSummary(documentId, days) {
return this.get('ajax').request(`activity/document/${documentId}?days=${days}`, {
method: "GET"
}).then((response) => {
let data = {
viewers: [],
changers: []
};
data.viewers = response.viewers.map((obj) => {
let data = this.get('store').normalize('documentActivity', obj);
return this.get('store').push(data);
});
data.changers = response.changers.map((obj) => {
let data = this.get('store').normalize('documentActivity', obj);
return this.get('store').push(data);
});
return data;
}).catch(() => {
return [];
});
},
});

View file

@ -208,8 +208,8 @@ export default Service.extend({
//**************************************************
// document meta referes to number of views, edits, approvals, etc.
getActivity(documentId) {
return this.get('ajax').request(`documents/${documentId}/activity`, {
getActivity(documentId, days) {
return this.get('ajax').request(`documents/${documentId}/activity?days=${days}`, {
method: "GET"
}).then((response) => {
let data = [];