mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Support for replaceable action services
- angular services for system document/folder actions
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {Component} from 'angular2/core';
|
||||
import {DOCUMENT_LIST_DIRECTIVES} from 'ng2-alfresco-documentlist/ng2-alfresco-documentlist';
|
||||
import {DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS} from 'ng2-alfresco-documentlist/ng2-alfresco-documentlist';
|
||||
import {MDL} from 'ng2-alfresco-core/material';
|
||||
|
||||
@Component({
|
||||
@@ -83,7 +83,8 @@ import {MDL} from 'ng2-alfresco-core/material';
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
directives: [DOCUMENT_LIST_DIRECTIVES, MDL]
|
||||
directives: [DOCUMENT_LIST_DIRECTIVES, MDL],
|
||||
providers: [DOCUMENT_LIST_PROVIDERS]
|
||||
})
|
||||
export class FilesComponent {
|
||||
thumbnails: boolean = true;
|
||||
|
@@ -7,6 +7,7 @@ import { FolderAction } from './src/components/folder-action';
|
||||
import { FolderActionList } from './src/components/folder-action-list';
|
||||
import { QuickFolderAction } from './src/components/quick-folder-action';
|
||||
import { QuickFolderActionList } from './src/components/quick-folder-action-list';
|
||||
import { FolderActionsService } from './src/services/folder-actions.service';
|
||||
export * from './src/components/document-list';
|
||||
export * from './src/components/document-action';
|
||||
export * from './src/components/document-action-list';
|
||||
@@ -16,9 +17,12 @@ export * from './src/components/folder-action';
|
||||
export * from './src/components/folder-action-list';
|
||||
export * from './src/components/quick-folder-action';
|
||||
export * from './src/components/quick-folder-action-list';
|
||||
export * from './src/services/folder-actions.service';
|
||||
export * from './src/services/document-actions.service';
|
||||
declare var _default: {
|
||||
directives: (typeof DocumentList | typeof DocumentAction | typeof DocumentActionList | typeof QuickDocumentAction | typeof QuickDocumentActionList | typeof FolderAction | typeof FolderActionList | typeof QuickFolderAction | typeof QuickFolderActionList)[];
|
||||
providers: undefined[];
|
||||
providers: typeof FolderActionsService[];
|
||||
};
|
||||
export default _default;
|
||||
export declare const DOCUMENT_LIST_DIRECTIVES: [any];
|
||||
export declare const DOCUMENT_LIST_PROVIDERS: [any];
|
||||
|
@@ -1,10 +1,11 @@
|
||||
System.register(['./src/components/document-list', './src/components/document-action', './src/components/document-action-list', './src/components/quick-document-action', './src/components/quick-document-action-list', './src/components/folder-action', './src/components/folder-action-list', './src/components/quick-folder-action', './src/components/quick-folder-action-list'], function(exports_1, context_1) {
|
||||
System.register(['./src/components/document-list', './src/components/document-action', './src/components/document-action-list', './src/components/quick-document-action', './src/components/quick-document-action-list', './src/components/folder-action', './src/components/folder-action-list', './src/components/quick-folder-action', './src/components/quick-folder-action-list', './src/services/folder-actions.service', './src/services/document-actions.service'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var document_list_1, document_action_1, document_action_list_1, quick_document_action_1, quick_document_action_list_1, folder_action_1, folder_action_list_1, quick_folder_action_1, quick_folder_action_list_1;
|
||||
var DOCUMENT_LIST_DIRECTIVES;
|
||||
var document_list_1, document_action_1, document_action_list_1, quick_document_action_1, quick_document_action_list_1, folder_action_1, folder_action_list_1, quick_folder_action_1, quick_folder_action_list_1, folder_actions_service_1, document_actions_service_1;
|
||||
var DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS;
|
||||
var exportedNames_1 = {
|
||||
'DOCUMENT_LIST_DIRECTIVES': true
|
||||
'DOCUMENT_LIST_DIRECTIVES': true,
|
||||
'DOCUMENT_LIST_PROVIDERS': true
|
||||
};
|
||||
function exportStar_1(m) {
|
||||
var exports = {};
|
||||
@@ -50,6 +51,14 @@ System.register(['./src/components/document-list', './src/components/document-ac
|
||||
function (quick_folder_action_list_1_1) {
|
||||
quick_folder_action_list_1 = quick_folder_action_list_1_1;
|
||||
exportStar_1(quick_folder_action_list_1_1);
|
||||
},
|
||||
function (folder_actions_service_1_1) {
|
||||
folder_actions_service_1 = folder_actions_service_1_1;
|
||||
exportStar_1(folder_actions_service_1_1);
|
||||
},
|
||||
function (document_actions_service_1_1) {
|
||||
document_actions_service_1 = document_actions_service_1_1;
|
||||
exportStar_1(document_actions_service_1_1);
|
||||
}],
|
||||
execute: function() {
|
||||
exports_1("default",{
|
||||
@@ -64,7 +73,10 @@ System.register(['./src/components/document-list', './src/components/document-ac
|
||||
quick_folder_action_1.QuickFolderAction,
|
||||
quick_folder_action_list_1.QuickFolderActionList
|
||||
],
|
||||
providers: []
|
||||
providers: [
|
||||
folder_actions_service_1.FolderActionsService,
|
||||
document_actions_service_1.DocumentActionsService
|
||||
]
|
||||
});
|
||||
exports_1("DOCUMENT_LIST_DIRECTIVES", DOCUMENT_LIST_DIRECTIVES = [
|
||||
document_list_1.DocumentList,
|
||||
@@ -77,6 +89,10 @@ System.register(['./src/components/document-list', './src/components/document-ac
|
||||
quick_folder_action_1.QuickFolderAction,
|
||||
quick_folder_action_list_1.QuickFolderActionList
|
||||
]);
|
||||
exports_1("DOCUMENT_LIST_PROVIDERS", DOCUMENT_LIST_PROVIDERS = [
|
||||
folder_actions_service_1.FolderActionsService,
|
||||
document_actions_service_1.DocumentActionsService
|
||||
]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"ng2-alfresco-documentlist.js","sourceRoot":"","sources":["ng2-alfresco-documentlist.ts"],"names":[],"mappings":";;;;QAmCa,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAfrC,oBAAe;gBACX,UAAU,EAAE;oBACR,4BAAY;oBACZ,gCAAc;oBACd,yCAAkB;oBAClB,2CAAmB;oBACnB,oDAAuB;oBACvB,4BAAY;oBACZ,qCAAgB;oBAChB,uCAAiB;oBACjB,gDAAqB;iBACxB;gBACD,SAAS,EAAE,EAAE;aAChB,EAAA;YAEY,sCAAA,wBAAwB,GAAU;gBAC3C,4BAAY;gBACZ,gCAAc;gBACd,yCAAkB;gBAClB,2CAAmB;gBACnB,oDAAuB;gBACvB,4BAAY;gBACZ,qCAAgB;gBAChB,uCAAiB;gBACjB,gDAAqB;aACxB,CAAA,CAAC"}
|
||||
{"version":3,"file":"ng2-alfresco-documentlist.js","sourceRoot":"","sources":["ng2-alfresco-documentlist.ts"],"names":[],"mappings":";;;;QA4Ca,wBAAwB,EAYxB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA9BpC,oBAAe;gBACX,UAAU,EAAE;oBACR,4BAAY;oBACZ,gCAAc;oBACd,yCAAkB;oBAClB,2CAAmB;oBACnB,oDAAuB;oBACvB,4BAAY;oBACZ,qCAAgB;oBAChB,uCAAiB;oBACjB,gDAAqB;iBACxB;gBACD,SAAS,EAAE;oBACP,6CAAoB;oBACpB,iDAAsB;iBACzB;aACJ,EAAA;YAEY,sCAAA,wBAAwB,GAAU;gBAC3C,4BAAY;gBACZ,gCAAc;gBACd,yCAAkB;gBAClB,2CAAmB;gBACnB,oDAAuB;gBACvB,4BAAY;gBACZ,qCAAgB;gBAChB,uCAAiB;gBACjB,gDAAqB;aACxB,CAAA,CAAC;YAEW,qCAAA,uBAAuB,GAAU;gBAC1C,6CAAoB;gBACpB,iDAAsB;aACzB,CAAA,CAAC"}
|
@@ -7,7 +7,10 @@ import {FolderAction} from './src/components/folder-action';
|
||||
import {FolderActionList} from './src/components/folder-action-list';
|
||||
import {QuickFolderAction} from './src/components/quick-folder-action';
|
||||
import {QuickFolderActionList} from './src/components/quick-folder-action-list';
|
||||
import {FolderActionsService} from './src/services/folder-actions.service';
|
||||
import {DocumentActionsService} from './src/services/document-actions.service';
|
||||
|
||||
// components
|
||||
export * from './src/components/document-list';
|
||||
export * from './src/components/document-action';
|
||||
export * from './src/components/document-action-list';
|
||||
@@ -17,6 +20,9 @@ export * from './src/components/folder-action';
|
||||
export * from './src/components/folder-action-list';
|
||||
export * from './src/components/quick-folder-action'
|
||||
export * from './src/components/quick-folder-action-list';
|
||||
// services
|
||||
export * from './src/services/folder-actions.service';
|
||||
export * from './src/services/document-actions.service';
|
||||
|
||||
export default {
|
||||
directives: [
|
||||
@@ -30,7 +36,10 @@ export default {
|
||||
QuickFolderAction,
|
||||
QuickFolderActionList
|
||||
],
|
||||
providers: []
|
||||
providers: [
|
||||
FolderActionsService,
|
||||
DocumentActionsService
|
||||
]
|
||||
}
|
||||
|
||||
export const DOCUMENT_LIST_DIRECTIVES: [any] = [
|
||||
@@ -44,3 +53,8 @@ export const DOCUMENT_LIST_DIRECTIVES: [any] = [
|
||||
QuickFolderAction,
|
||||
QuickFolderActionList
|
||||
];
|
||||
|
||||
export const DOCUMENT_LIST_PROVIDERS: [any] = [
|
||||
FolderActionsService,
|
||||
DocumentActionsService
|
||||
];
|
||||
|
@@ -16,14 +16,13 @@
|
||||
*/
|
||||
import { OnInit, EventEmitter } from 'angular2/core';
|
||||
import { DocumentActionList } from './document-action-list';
|
||||
import { DocumentActionsService } from '../services/document-actions.service';
|
||||
export declare class DocumentAction implements OnInit {
|
||||
private list;
|
||||
private documentActions;
|
||||
title: string;
|
||||
handler: string;
|
||||
execute: EventEmitter<{}>;
|
||||
private defaultHandlers;
|
||||
constructor(list: DocumentActionList);
|
||||
constructor(list: DocumentActionList, documentActions: DocumentActionsService);
|
||||
ngOnInit(): void;
|
||||
handleStandardAction1(document: any): void;
|
||||
handleStandardAction2(document: any): void;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', './../models/content-action.model', './document-action-list'], function(exports_1, context_1) {
|
||||
System.register(['angular2/core', './../models/content-action.model', './document-action-list', '../services/document-actions.service'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
@@ -26,7 +26,7 @@ System.register(['angular2/core', './../models/content-action.model', './documen
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, content_action_model_1, document_action_list_1;
|
||||
var core_1, content_action_model_1, document_action_list_1, document_actions_service_1;
|
||||
var DocumentAction;
|
||||
return {
|
||||
setters:[
|
||||
@@ -38,27 +38,24 @@ System.register(['angular2/core', './../models/content-action.model', './documen
|
||||
},
|
||||
function (document_action_list_1_1) {
|
||||
document_action_list_1 = document_action_list_1_1;
|
||||
},
|
||||
function (document_actions_service_1_1) {
|
||||
document_actions_service_1 = document_actions_service_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
DocumentAction = (function () {
|
||||
function DocumentAction(list) {
|
||||
function DocumentAction(list, documentActions) {
|
||||
this.list = list;
|
||||
this.documentActions = documentActions;
|
||||
this.title = 'Action';
|
||||
this.execute = new core_1.EventEmitter();
|
||||
this.defaultHandlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
DocumentAction.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
var model = new content_action_model_1.ContentActionModel();
|
||||
model.title = this.title;
|
||||
if (this.handler) {
|
||||
var defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.documentActions.getHandler(this.handler);
|
||||
}
|
||||
else if (this.execute) {
|
||||
model.handler = function (document) {
|
||||
@@ -69,12 +66,6 @@ System.register(['angular2/core', './../models/content-action.model', './documen
|
||||
}
|
||||
this.list.registerAction(model);
|
||||
};
|
||||
DocumentAction.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('standard action 1');
|
||||
};
|
||||
DocumentAction.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('standard action 2');
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
@@ -92,7 +83,7 @@ System.register(['angular2/core', './../models/content-action.model', './documen
|
||||
selector: 'document-action',
|
||||
template: ''
|
||||
}),
|
||||
__metadata('design:paramtypes', [document_action_list_1.DocumentActionList])
|
||||
__metadata('design:paramtypes', [document_action_list_1.DocumentActionList, document_actions_service_1.DocumentActionsService])
|
||||
], DocumentAction);
|
||||
return DocumentAction;
|
||||
}());
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"document-action.js","sourceRoot":"","sources":["document-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAOI,wBAAoB,IAAwB;oBAAxB,SAAI,GAAJ,IAAI,CAAoB;oBANnC,UAAK,GAAW,QAAQ,CAAC;oBAExB,YAAO,GAAG,IAAI,mBAAY,EAAE,CAAC;oBAE/B,oBAAe,GAA4C,EAAE,CAAC;oBAGlE,qEAAqE;oBACrE,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBAC7D,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBACjE,CAAC;gBAED,iCAAQ,GAAR;oBAAA,iBAkBC;oBAjBG,IAAI,KAAK,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;oBAEzB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACf,IAAI,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBACxD,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;4BACjB,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC;wBACnC,CAAC;oBACL,CAAC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I,CAAC,KAAK,CAAC;oBAEzB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACf,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAClE,CAAC;oBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACtB,KAAK,CAAC,OAAO,GAAG,UAAC,QAAa;4BAC1B,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gCACd,KAAK,EAAE,QAAQ;6BAClB,CAAC,CAAC;wBACP,CAAC,CAAC;oBACN,CAAC;oBAED,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;gBAxBD;oBAAC,YAAK,EAAE;;6DAAA;gBACR;oBAAC,YAAK,EAAE;;+DAAA;gBACR;oBAAC,aAAM,EAAE;;+DAAA;gBAPb;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;kCAAA;gBA2BF,qBAAC;YAAD,CAAC,AA1BD,IA0BC;YA1BD,2CA0BC,CAAA"}
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import {Component, OnInit, Input, Output, EventEmitter} from 'angular2/core';
|
||||
import {ContentActionModel, ContentActionHandler} from './../models/content-action.model';
|
||||
import {ContentActionModel} from './../models/content-action.model';
|
||||
import {DocumentActionList} from './document-action-list';
|
||||
import {DocumentActionsService} from '../services/document-actions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'document-action',
|
||||
@@ -28,12 +29,9 @@ export class DocumentAction implements OnInit {
|
||||
@Input() handler: string;
|
||||
@Output() execute = new EventEmitter();
|
||||
|
||||
private defaultHandlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor(private list: DocumentActionList) {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
constructor(
|
||||
private list: DocumentActionList,
|
||||
private documentActions: DocumentActionsService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -41,10 +39,7 @@ export class DocumentAction implements OnInit {
|
||||
model.title = this.title;
|
||||
|
||||
if (this.handler) {
|
||||
let defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.documentActions.getHandler(this.handler);
|
||||
} else if (this.execute) {
|
||||
model.handler = (document: any): void => {
|
||||
this.execute.emit({
|
||||
@@ -55,12 +50,4 @@ export class DocumentAction implements OnInit {
|
||||
|
||||
this.list.registerAction(model);
|
||||
}
|
||||
|
||||
handleStandardAction1(document: any) {
|
||||
window.alert('standard action 1');
|
||||
}
|
||||
|
||||
handleStandardAction2(document: any) {
|
||||
window.alert('standard action 2');
|
||||
}
|
||||
}
|
||||
|
@@ -16,14 +16,13 @@
|
||||
*/
|
||||
import { OnInit, EventEmitter } from 'angular2/core';
|
||||
import { FolderActionList } from './folder-action-list';
|
||||
import { FolderActionsService } from '../services/folder-actions.service';
|
||||
export declare class FolderAction implements OnInit {
|
||||
private list;
|
||||
private folderActions;
|
||||
title: string;
|
||||
handler: string;
|
||||
execute: EventEmitter<{}>;
|
||||
private defaultHandlers;
|
||||
constructor(list: FolderActionList);
|
||||
constructor(list: FolderActionList, folderActions: FolderActionsService);
|
||||
ngOnInit(): void;
|
||||
handleStandardAction1(document: any): void;
|
||||
handleStandardAction2(document: any): void;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', './../models/content-action.model', './folder-action-list'], function(exports_1, context_1) {
|
||||
System.register(['angular2/core', './../models/content-action.model', './folder-action-list', '../services/folder-actions.service'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
@@ -26,7 +26,7 @@ System.register(['angular2/core', './../models/content-action.model', './folder-
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, content_action_model_1, folder_action_list_1;
|
||||
var core_1, content_action_model_1, folder_action_list_1, folder_actions_service_1;
|
||||
var FolderAction;
|
||||
return {
|
||||
setters:[
|
||||
@@ -38,27 +38,24 @@ System.register(['angular2/core', './../models/content-action.model', './folder-
|
||||
},
|
||||
function (folder_action_list_1_1) {
|
||||
folder_action_list_1 = folder_action_list_1_1;
|
||||
},
|
||||
function (folder_actions_service_1_1) {
|
||||
folder_actions_service_1 = folder_actions_service_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
FolderAction = (function () {
|
||||
function FolderAction(list) {
|
||||
function FolderAction(list, folderActions) {
|
||||
this.list = list;
|
||||
this.folderActions = folderActions;
|
||||
this.title = 'Action';
|
||||
this.execute = new core_1.EventEmitter();
|
||||
this.defaultHandlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
FolderAction.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
var model = new content_action_model_1.ContentActionModel();
|
||||
model.title = this.title;
|
||||
if (this.handler) {
|
||||
var defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.folderActions.getHandler(this.handler);
|
||||
}
|
||||
else if (this.execute) {
|
||||
model.handler = function (document) {
|
||||
@@ -69,12 +66,6 @@ System.register(['angular2/core', './../models/content-action.model', './folder-
|
||||
}
|
||||
this.list.registerAction(model);
|
||||
};
|
||||
FolderAction.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('dummy folder action 1');
|
||||
};
|
||||
FolderAction.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('dummy folder action 2');
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
@@ -92,7 +83,7 @@ System.register(['angular2/core', './../models/content-action.model', './folder-
|
||||
selector: 'folder-action',
|
||||
template: ''
|
||||
}),
|
||||
__metadata('design:paramtypes', [folder_action_list_1.FolderActionList])
|
||||
__metadata('design:paramtypes', [folder_action_list_1.FolderActionList, folder_actions_service_1.FolderActionsService])
|
||||
], FolderAction);
|
||||
return FolderAction;
|
||||
}());
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"folder-action.js","sourceRoot":"","sources":["folder-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAOI,sBAAoB,IAAsB;oBAAtB,SAAI,GAAJ,IAAI,CAAkB;oBANjC,UAAK,GAAW,QAAQ,CAAC;oBAExB,YAAO,GAAG,IAAI,mBAAY,EAAE,CAAC;oBAE/B,oBAAe,GAA4C,EAAE,CAAC;oBAGlE,qEAAqE;oBACrE,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBAC7D,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBACjE,CAAC;gBAED,+BAAQ,GAAR;oBAAA,iBAkBC;oBAjBG,IAAI,KAAK,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;oBAEzB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACf,IAAI,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,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,CAAC;gBAED,+BAAQ,GAAR;oBAAA,iBAeC;oBAdG,IAAI,KAAK,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACrC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;oBAEzB,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACf,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAChE,CAAC;oBAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBACtB,KAAK,CAAC,OAAO,GAAG,UAAC,QAAa;4BAC1B,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gCACd,KAAK,EAAE,QAAQ;6BAClB,CAAC,CAAC;wBACP,CAAC,CAAC;oBACN,CAAC;oBAED,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;gBAxBD;oBAAC,YAAK,EAAE;;2DAAA;gBACR;oBAAC,YAAK,EAAE;;6DAAA;gBACR;oBAAC,aAAM,EAAE;;6DAAA;gBAPb;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,eAAe;wBACzB,QAAQ,EAAE,EAAE;qBACf,CAAC;;gCAAA;gBA2BF,mBAAC;YAAD,CAAC,AA1BD,IA0BC;YA1BD,uCA0BC,CAAA"}
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import {Component, OnInit, Input, Output, EventEmitter} from 'angular2/core';
|
||||
import {ContentActionModel, ContentActionHandler} from './../models/content-action.model';
|
||||
import {ContentActionModel} from './../models/content-action.model';
|
||||
import {FolderActionList} from './folder-action-list';
|
||||
import {FolderActionsService} from '../services/folder-actions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'folder-action',
|
||||
@@ -28,12 +29,9 @@ export class FolderAction implements OnInit {
|
||||
@Input() handler: string;
|
||||
@Output() execute = new EventEmitter();
|
||||
|
||||
private defaultHandlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor(private list: FolderActionList) {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
constructor(
|
||||
private list: FolderActionList,
|
||||
private folderActions: FolderActionsService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -41,10 +39,7 @@ export class FolderAction implements OnInit {
|
||||
model.title = this.title;
|
||||
|
||||
if (this.handler) {
|
||||
let defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.folderActions.getHandler(this.handler);
|
||||
} else if (this.execute) {
|
||||
model.handler = (document: any): void => {
|
||||
this.execute.emit({
|
||||
@@ -55,12 +50,4 @@ export class FolderAction implements OnInit {
|
||||
|
||||
this.list.registerAction(model);
|
||||
}
|
||||
|
||||
handleStandardAction1(document: any) {
|
||||
window.alert('dummy folder action 1');
|
||||
}
|
||||
|
||||
handleStandardAction2(document: any) {
|
||||
window.alert('dummy folder action 2');
|
||||
}
|
||||
}
|
||||
|
@@ -16,15 +16,14 @@
|
||||
*/
|
||||
import { OnInit, EventEmitter } from 'angular2/core';
|
||||
import { QuickDocumentActionList } from './quick-document-action-list';
|
||||
import { DocumentActionsService } from '../services/document-actions.service';
|
||||
export declare class QuickDocumentAction implements OnInit {
|
||||
private list;
|
||||
private documentActions;
|
||||
icon: string;
|
||||
title: string;
|
||||
handler: string;
|
||||
execute: EventEmitter<{}>;
|
||||
private defaultHandlers;
|
||||
constructor(list: QuickDocumentActionList);
|
||||
constructor(list: QuickDocumentActionList, documentActions: DocumentActionsService);
|
||||
ngOnInit(): void;
|
||||
handleStandardAction1(document: any): void;
|
||||
handleStandardAction2(document: any): void;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', '../models/content-action.model', './quick-document-action-list'], function(exports_1, context_1) {
|
||||
System.register(['angular2/core', '../models/content-action.model', './quick-document-action-list', '../services/document-actions.service'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
@@ -26,7 +26,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-doc
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, content_action_model_1, quick_document_action_list_1;
|
||||
var core_1, content_action_model_1, quick_document_action_list_1, document_actions_service_1;
|
||||
var QuickDocumentAction;
|
||||
return {
|
||||
setters:[
|
||||
@@ -38,16 +38,16 @@ System.register(['angular2/core', '../models/content-action.model', './quick-doc
|
||||
},
|
||||
function (quick_document_action_list_1_1) {
|
||||
quick_document_action_list_1 = quick_document_action_list_1_1;
|
||||
},
|
||||
function (document_actions_service_1_1) {
|
||||
document_actions_service_1 = document_actions_service_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
QuickDocumentAction = (function () {
|
||||
function QuickDocumentAction(list) {
|
||||
function QuickDocumentAction(list, documentActions) {
|
||||
this.list = list;
|
||||
this.documentActions = documentActions;
|
||||
this.execute = new core_1.EventEmitter();
|
||||
this.defaultHandlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
QuickDocumentAction.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
@@ -55,10 +55,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-doc
|
||||
model.icon = this.icon;
|
||||
model.title = this.title;
|
||||
if (this.handler) {
|
||||
var defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.documentActions.getHandler(this.handler);
|
||||
}
|
||||
else if (this.execute) {
|
||||
model.handler = function (document) {
|
||||
@@ -69,12 +66,6 @@ System.register(['angular2/core', '../models/content-action.model', './quick-doc
|
||||
}
|
||||
this.list.registerAction(model);
|
||||
};
|
||||
QuickDocumentAction.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('quick doc action 1');
|
||||
};
|
||||
QuickDocumentAction.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('quick doc action 2');
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
@@ -96,7 +87,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-doc
|
||||
selector: 'quick-document-action',
|
||||
template: ''
|
||||
}),
|
||||
__metadata('design:paramtypes', [quick_document_action_list_1.QuickDocumentActionList])
|
||||
__metadata('design:paramtypes', [quick_document_action_list_1.QuickDocumentActionList, document_actions_service_1.DocumentActionsService])
|
||||
], QuickDocumentAction);
|
||||
return QuickDocumentAction;
|
||||
}());
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"quick-document-action.js","sourceRoot":"","sources":["quick-document-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAQI,6BAAoB,IAA6B;oBAA7B,SAAI,GAAJ,IAAI,CAAyB;oBAJvC,YAAO,GAAG,IAAI,mBAAY,EAAE,CAAC;oBAE/B,oBAAe,GAA4C,EAAE,CAAC;oBAGlE,qEAAqE;oBACrE,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBAC7D,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBACjE,CAAC;gBAED,sCAAQ,GAAR;oBAAA,iB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gBA6BF,0BAAC;YAAD,CAAC,AA5BD,IA4BC;YA5BD,qDA4BC,CAAA"}
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import {Component, OnInit, Input, Output, EventEmitter} from 'angular2/core';
|
||||
import {ContentActionModel, ContentActionHandler} from '../models/content-action.model';
|
||||
import {ContentActionModel} from '../models/content-action.model';
|
||||
import {QuickDocumentActionList} from './quick-document-action-list';
|
||||
import {DocumentActionsService} from '../services/document-actions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'quick-document-action',
|
||||
@@ -29,12 +30,9 @@ export class QuickDocumentAction implements OnInit {
|
||||
@Input() handler: string;
|
||||
@Output() execute = new EventEmitter();
|
||||
|
||||
private defaultHandlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor(private list: QuickDocumentActionList) {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
constructor(
|
||||
private list: QuickDocumentActionList,
|
||||
private documentActions: DocumentActionsService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -43,10 +41,7 @@ export class QuickDocumentAction implements OnInit {
|
||||
model.title = this.title;
|
||||
|
||||
if (this.handler) {
|
||||
let defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.documentActions.getHandler(this.handler);
|
||||
} else if (this.execute) {
|
||||
model.handler = (document: any): void => {
|
||||
this.execute.emit({
|
||||
@@ -57,12 +52,4 @@ export class QuickDocumentAction implements OnInit {
|
||||
|
||||
this.list.registerAction(model);
|
||||
}
|
||||
|
||||
handleStandardAction1(document: any) {
|
||||
window.alert('quick doc action 1');
|
||||
}
|
||||
|
||||
handleStandardAction2(document: any) {
|
||||
window.alert('quick doc action 2');
|
||||
}
|
||||
}
|
||||
|
@@ -16,15 +16,14 @@
|
||||
*/
|
||||
import { OnInit, EventEmitter } from 'angular2/core';
|
||||
import { QuickFolderActionList } from './quick-folder-action-list';
|
||||
import { FolderActionsService } from '../services/folder-actions.service';
|
||||
export declare class QuickFolderAction implements OnInit {
|
||||
private list;
|
||||
private folderActions;
|
||||
icon: string;
|
||||
title: string;
|
||||
handler: string;
|
||||
execute: EventEmitter<{}>;
|
||||
private defaultHandlers;
|
||||
constructor(list: QuickFolderActionList);
|
||||
constructor(list: QuickFolderActionList, folderActions: FolderActionsService);
|
||||
ngOnInit(): void;
|
||||
handleStandardAction1(document: any): void;
|
||||
handleStandardAction2(document: any): void;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', '../models/content-action.model', './quick-folder-action-list'], function(exports_1, context_1) {
|
||||
System.register(['angular2/core', '../models/content-action.model', './quick-folder-action-list', '../services/folder-actions.service'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
@@ -26,7 +26,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-fol
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, content_action_model_1, quick_folder_action_list_1;
|
||||
var core_1, content_action_model_1, quick_folder_action_list_1, folder_actions_service_1;
|
||||
var QuickFolderAction;
|
||||
return {
|
||||
setters:[
|
||||
@@ -38,16 +38,16 @@ System.register(['angular2/core', '../models/content-action.model', './quick-fol
|
||||
},
|
||||
function (quick_folder_action_list_1_1) {
|
||||
quick_folder_action_list_1 = quick_folder_action_list_1_1;
|
||||
},
|
||||
function (folder_actions_service_1_1) {
|
||||
folder_actions_service_1 = folder_actions_service_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
QuickFolderAction = (function () {
|
||||
function QuickFolderAction(list) {
|
||||
function QuickFolderAction(list, folderActions) {
|
||||
this.list = list;
|
||||
this.folderActions = folderActions;
|
||||
this.execute = new core_1.EventEmitter();
|
||||
this.defaultHandlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
QuickFolderAction.prototype.ngOnInit = function () {
|
||||
var _this = this;
|
||||
@@ -55,10 +55,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-fol
|
||||
model.icon = this.icon;
|
||||
model.title = this.title;
|
||||
if (this.handler) {
|
||||
var defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.folderActions.getHandler(this.handler);
|
||||
}
|
||||
else if (this.execute) {
|
||||
model.handler = function (document) {
|
||||
@@ -69,12 +66,6 @@ System.register(['angular2/core', '../models/content-action.model', './quick-fol
|
||||
}
|
||||
this.list.registerAction(model);
|
||||
};
|
||||
QuickFolderAction.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('quick folder action 1');
|
||||
};
|
||||
QuickFolderAction.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('quick folder action 2');
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
@@ -96,7 +87,7 @@ System.register(['angular2/core', '../models/content-action.model', './quick-fol
|
||||
selector: 'quick-folder-action',
|
||||
template: ''
|
||||
}),
|
||||
__metadata('design:paramtypes', [quick_folder_action_list_1.QuickFolderActionList])
|
||||
__metadata('design:paramtypes', [quick_folder_action_list_1.QuickFolderActionList, folder_actions_service_1.FolderActionsService])
|
||||
], QuickFolderAction);
|
||||
return QuickFolderAction;
|
||||
}());
|
||||
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"quick-folder-action.js","sourceRoot":"","sources":["quick-folder-action.ts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C,QAAa;4BAC1B,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gCACd,KAAK,EAAE,QAAQ;6BAClB,CAAC,CAAC;wBACP,CAAC,CAAC;oBACN,CAAC;oBAED,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;gBA1BD;oBAAC,YAAK,EAAE;;+DAAA;gBACR;oBAAC,YAAK,EAAE;;gEAAA;gBACR;oBAAC,YAAK,EAAE;;kEAAA;gBACR;oBAAC,aAAM,EAAE;;kEAAA;gBARb;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,qBAAqB;wBAC/B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBA6BF,wBAAC;YAAD,CAAC,AA5BD,IA4BC;YA5BD,iDA4BC,CAAA"}
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import {Component, OnInit, Input, Output, EventEmitter} from 'angular2/core';
|
||||
import {ContentActionModel, ContentActionHandler} from '../models/content-action.model';
|
||||
import {ContentActionModel} from '../models/content-action.model';
|
||||
import {QuickFolderActionList} from './quick-folder-action-list';
|
||||
import {FolderActionsService} from '../services/folder-actions.service';
|
||||
|
||||
@Component({
|
||||
selector: 'quick-folder-action',
|
||||
@@ -29,12 +30,9 @@ export class QuickFolderAction implements OnInit {
|
||||
@Input() handler: string;
|
||||
@Output() execute = new EventEmitter();
|
||||
|
||||
private defaultHandlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor(private list: QuickFolderActionList) {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.defaultHandlers['system1'] = this.handleStandardAction1;
|
||||
this.defaultHandlers['system2'] = this.handleStandardAction2;
|
||||
constructor(
|
||||
private list: QuickFolderActionList,
|
||||
private folderActions: FolderActionsService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -43,10 +41,7 @@ export class QuickFolderAction implements OnInit {
|
||||
model.title = this.title;
|
||||
|
||||
if (this.handler) {
|
||||
let defaultHandler = this.defaultHandlers[this.handler];
|
||||
if (defaultHandler) {
|
||||
model.handler = defaultHandler;
|
||||
}
|
||||
model.handler = this.folderActions.getHandler(this.handler);
|
||||
} else if (this.execute) {
|
||||
model.handler = (document: any): void => {
|
||||
this.execute.emit({
|
||||
@@ -57,12 +52,4 @@ export class QuickFolderAction implements OnInit {
|
||||
|
||||
this.list.registerAction(model);
|
||||
}
|
||||
|
||||
handleStandardAction1(document: any) {
|
||||
window.alert('quick folder action 1');
|
||||
}
|
||||
|
||||
handleStandardAction2(document: any) {
|
||||
window.alert('quick folder action 2');
|
||||
}
|
||||
}
|
||||
|
8
ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.d.ts
vendored
Normal file
8
ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
export declare class DocumentActionsService {
|
||||
private handlers;
|
||||
constructor();
|
||||
getHandler(key: string): ContentActionHandler;
|
||||
private handleStandardAction1(document);
|
||||
private handleStandardAction2(document);
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1;
|
||||
var DocumentActionsService;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
DocumentActionsService = (function () {
|
||||
function DocumentActionsService() {
|
||||
this.handlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.handlers['system1'] = this.handleStandardAction1;
|
||||
this.handlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
DocumentActionsService.prototype.getHandler = function (key) {
|
||||
return this.handlers[key];
|
||||
};
|
||||
DocumentActionsService.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('standard document action 1');
|
||||
};
|
||||
DocumentActionsService.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('standard document action 2');
|
||||
};
|
||||
DocumentActionsService = __decorate([
|
||||
core_1.Injectable(),
|
||||
__metadata('design:paramtypes', [])
|
||||
], DocumentActionsService);
|
||||
return DocumentActionsService;
|
||||
}());
|
||||
exports_1("DocumentActionsService", DocumentActionsService);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=document-actions.service.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"document-actions.service.js","sourceRoot":"","sources":["document-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBACtD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBAC1D,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW;oBAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC9B,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBApBL;oBAAC,iBAAU,EAAE;;0CAAA;gBAqBb,6BAAC;YAAD,CAAC,AApBD,IAoBC;YApBD,2DAoBC,CAAA"}
|
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {ContentActionHandler} from '../models/content-action.model';
|
||||
|
||||
@Injectable()
|
||||
export class DocumentActionsService {
|
||||
private handlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor() {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.handlers['system1'] = this.handleStandardAction1;
|
||||
this.handlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
|
||||
getHandler(key: string): ContentActionHandler {
|
||||
return this.handlers[key];
|
||||
}
|
||||
|
||||
private handleStandardAction1(document: any) {
|
||||
window.alert('standard document action 1');
|
||||
}
|
||||
|
||||
private handleStandardAction2(document: any) {
|
||||
window.alert('standard document action 2');
|
||||
}
|
||||
}
|
8
ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.d.ts
vendored
Normal file
8
ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ContentActionHandler } from '../models/content-action.model';
|
||||
export declare class FolderActionsService {
|
||||
private handlers;
|
||||
constructor();
|
||||
getHandler(key: string): ContentActionHandler;
|
||||
private handleStandardAction1(document);
|
||||
private handleStandardAction2(document);
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1;
|
||||
var FolderActionsService;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
FolderActionsService = (function () {
|
||||
function FolderActionsService() {
|
||||
this.handlers = {};
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.handlers['system1'] = this.handleStandardAction1;
|
||||
this.handlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
FolderActionsService.prototype.getHandler = function (key) {
|
||||
return this.handlers[key];
|
||||
};
|
||||
FolderActionsService.prototype.handleStandardAction1 = function (document) {
|
||||
window.alert('standard folder action 1');
|
||||
};
|
||||
FolderActionsService.prototype.handleStandardAction2 = function (document) {
|
||||
window.alert('standard folder action 2');
|
||||
};
|
||||
FolderActionsService = __decorate([
|
||||
core_1.Injectable(),
|
||||
__metadata('design:paramtypes', [])
|
||||
], FolderActionsService);
|
||||
return FolderActionsService;
|
||||
}());
|
||||
exports_1("FolderActionsService", FolderActionsService);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=folder-actions.service.js.map
|
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"folder-actions.service.js","sourceRoot":"","sources":["folder-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBACtD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBAC1D,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW;oBAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC9B,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBApBL;oBAAC,iBAAU,EAAE;;wCAAA;gBAqBb,2BAAC;YAAD,CAAC,AApBD,IAoBC;YApBD,uDAoBC,CAAA"}
|
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {ContentActionHandler} from '../models/content-action.model';
|
||||
|
||||
@Injectable()
|
||||
export class FolderActionsService {
|
||||
private handlers: { [id: string]: ContentActionHandler; } = {};
|
||||
|
||||
constructor() {
|
||||
// todo: just for dev/demo purposes, to be replaced with real actions
|
||||
this.handlers['system1'] = this.handleStandardAction1;
|
||||
this.handlers['system2'] = this.handleStandardAction2;
|
||||
}
|
||||
|
||||
getHandler(key: string): ContentActionHandler {
|
||||
return this.handlers[key];
|
||||
}
|
||||
|
||||
private handleStandardAction1(document: any) {
|
||||
window.alert('standard folder action 1');
|
||||
}
|
||||
|
||||
private handleStandardAction2(document: any) {
|
||||
window.alert('standard folder action 2');
|
||||
}
|
||||
}
|
@@ -1 +1 @@
|
||||
{"version":3,"file":"authentication.service.spec.js","sourceRoot":"","sources":["authentication.service.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAMA,kBAAQ,CAAC,gBAAgB,EAAE;gBACvB,IAAI,QAAQ,EACR,OAAO,EACP,WAAW,EACX,WAAW,EACX,OAAO,CAAC;gBAEZ,UAAU,CAAC;oBACP,QAAQ,GAAG,eAAQ,CAAC,gBAAgB,CAAC;wBACjC,qBAAc;wBACd,qBAAW;wBACX,cAAO,CAAC,iBAAU,EAAE,EAAC,QAAQ,EAAE,qBAAW,EAAC,CAAC;wBAC5C,uCAAc;qBACjB,CAAC,CAAC;oBAEH,IAAI,KAAK,GAAG,EAAE,CAAC;oBAEf,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,GAAG;wBACrD,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBACtB,CAAC,CAAC,CAAC;oBACH,KAAK,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,GAAG,EAAE,KAAK;wBAC5D,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;oBACnC,CAAC,CAAC,CAAC;oBACH,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;wBACtC,KAAK,GAAG,EAAE,CAAC;oBACf,CAAC,CAAC,CAAC;oBACH,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,GAAG;wBACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;oBACtB,CAAC,CAAC,CAAC;oBACH,K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