Sanitise the component and Demo shell from embedded strings (#2474)

This commit is contained in:
Eugenio Romano
2017-10-14 14:27:41 +01:00
committed by Denys Vuika
parent bfe8fc8d15
commit 9663971256
17 changed files with 158 additions and 73 deletions

View File

@@ -3,7 +3,7 @@
<md-nav-list> <md-nav-list>
<a md-list-item *ngFor="let link of links" [routerLink]="link.href" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="sidenav.close()" class="adf-sidenav-link"> <a md-list-item *ngFor="let link of links" [routerLink]="link.href" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" (click)="sidenav.close()" class="adf-sidenav-link">
<md-icon mdListIcon>{{link.icon}}</md-icon> <md-icon mdListIcon>{{link.icon}}</md-icon>
<span>{{link.title}}</span> <span>{{link.title | translate }}</span>
</a> </a>
<a md-list-item adf-logout (click)="sidenav.close()"> <a md-list-item adf-logout (click)="sidenav.close()">
<md-icon mdListIcon>exit_to_app</md-icon> <md-icon mdListIcon>exit_to_app</md-icon>
@@ -19,15 +19,15 @@
[menuPositionY]="'above'"> [menuPositionY]="'above'">
</adf-userinfo> </adf-userinfo>
<span fxFlex="1 1 auto" fxShow fxHide.lt-sm="true">ADF Demo Application</span> <span fxFlex="1 1 auto" fxShow fxHide.lt-sm="true">{{'APP_LAYOUT.APP_NAME' | translate }}</span>
<div class="adf-app-layout-menu-spacer"></div> <div class="adf-app-layout-menu-spacer"></div>
<search-bar fxFlex="0 1 auto"></search-bar> <search-bar fxFlex="0 1 auto"></search-bar>
<a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="home" href="" routerLink="/home" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">Home</a> <a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="home" href="" routerLink="/home" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">{{'APP_LAYOUT.HOME' | translate }}</a>
<a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="files" href="" routerLink="/files" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">Content Services</a> <a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="files" href="" routerLink="/files" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">{{'APP_LAYOUT.CONTENT_SERVICES' | translate }}</a>
<a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="activiti" href="" routerLink="/activiti" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">Process Services</a> <a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="activiti" href="" routerLink="/activiti" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">{{'APP_LAYOUT.PROCESS_SERVICES' | translate }}</a>
<a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="login" href="" routerLink="/login">Login</a> <a fxFlex="0 0 auto" class="adf-toolbar-link" fxShow fxHide.lt-md="true" md-button data-automation-id="login" href="" routerLink="/login">Login</a>
<theme-picker></theme-picker> <theme-picker></theme-picker>
@@ -46,4 +46,4 @@
</md-toolbar> </md-toolbar>
<router-outlet></router-outlet> <router-outlet></router-outlet>
</md-sidenav-container> </md-sidenav-container>

View File

@@ -22,10 +22,10 @@
</alfresco-datatable> </alfresco-datatable>
</div> </div>
<div class="p-10" data-automation-id="multiselect"> <div class="p-10" data-automation-id="multiselect">
<md-checkbox [(ngModel)]="multiselect">Multiselect</md-checkbox> <md-checkbox [(ngModel)]="multiselect">{{ 'DATATABLE.MULTISELECT'| translate }}</md-checkbox>
</div> </div>
<div class="p-10"> <div class="p-10">
<p>For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.</p> <p>{{ 'DATATABLE.MULTISELECT_DESCRIPTION'| translate }}</p>
<md-select placeholder="Selection Mode" [(ngModel)]="selectionMode" name="food"> <md-select placeholder="Selection Mode" [(ngModel)]="selectionMode" name="food">
<md-option *ngFor="let mode of selectionModes" [value]="mode.value"> <md-option *ngFor="let mode of selectionModes" [value]="mode.value">
{{mode.viewValue}} {{mode.viewValue}}
@@ -33,9 +33,9 @@
</md-select> </md-select>
</div> </div>
<div class="p-10"> <div class="p-10">
<button md-raised-button (click)="reset()">Reset to default</button> <button md-raised-button (click)="reset()">{{ 'DATATABLE.RESET_DEFAULT'| translate }}</button>
<button md-raised-button (click)="addRow()">Add row</button> <button md-raised-button (click)="addRow()">{{ 'DATATABLE.ADD_ROW'| translate }}</button>
<button md-raised-button (click)="replaceRows()">Replace rows</button> <button md-raised-button (click)="replaceRows()">{{ 'DATATABLE.REPLACE_ROWS'| translate }}</button>
<button md-raised-button (click)="replaceColumns()">Replace columns</button> <button md-raised-button (click)="replaceColumns()">{{ 'DATATABLE.REPLACE_COLUMNS'| translate }}</button>
<button md-raised-button (click)="getRowForNode()">Load Node</button> <button md-raised-button (click)="getRowForNode()">{{ 'DATATABLE.LOAD_NODE'| translate }}</button>
</div> </div>

View File

@@ -92,7 +92,7 @@
<md-icon>delete</md-icon> <md-icon>delete</md-icon>
<span>Delete</span> <span>Delete</span>
</button> </button>
</md-menu> </md-menu>
</adf-toolbar> </adf-toolbar>
<adf-document-list <adf-document-list
#documentList #documentList
@@ -232,7 +232,7 @@
<div class="adf-content-service-settings"> <div class="adf-content-service-settings">
<p>Current folder ID: {{ documentList.currentFolderId }}</p> <p>Current folder ID: {{ documentList.currentFolderId }}</p>
<div class="p-10"> <div class="p-10">
Selected Nodes: Selected Nodes:
<ul> <ul>
@@ -241,28 +241,28 @@
</li> </li>
</ul> </ul>
</div> </div>
<div class="container"> <div class="container">
<section> <section>
<md-slide-toggle [color]="'primary'" [(ngModel)]="multiselect">Multiselect (with checkboxes)</md-slide-toggle> <md-slide-toggle [color]="'primary'" [(ngModel)]="multiselect">{{'DOCUMENT_LIST.MULTISELECT_CHECKBOXES' | translate}}</md-slide-toggle>
</section> </section>
<section> <section>
<md-slide-toggle [color]="'primary'" [(ngModel)]="multipleFileUpload">Multiple File Upload</md-slide-toggle> <md-slide-toggle [color]="'primary'" [(ngModel)]="multipleFileUpload">{{'DOCUMENT_LIST.MULTIPLE_FILE_UPLOAD' | translate}}</md-slide-toggle>
</section> </section>
<section> <section>
<md-slide-toggle [color]="'primary'" [(ngModel)]="folderUpload">Folder upload</md-slide-toggle> <md-slide-toggle [color]="'primary'" [(ngModel)]="folderUpload">{{'DOCUMENT_LIST.FOLDER_UPLOAD' | translate}}</md-slide-toggle>
</section> </section>
<section> <section>
<md-slide-toggle [color]="'primary'" [(ngModel)]="acceptedFilesTypeShow">Custom extensions filter</md-slide-toggle> <md-slide-toggle [color]="'primary'" [(ngModel)]="acceptedFilesTypeShow">{{'DOCUMENT_LIST.CUSTOM_FILTER' | translate}}</md-slide-toggle>
</section> </section>
<section> <section>
<md-slide-toggle [color]="'primary'" [(ngModel)]="versioning">Enable versioning</md-slide-toggle> <md-slide-toggle [color]="'primary'" [(ngModel)]="versioning">{{'DOCUMENT_LIST.ENABLE_VERSIONING' | translate}}</md-slide-toggle>
</section> </section>
<h5>Upload</h5> <h5>Upload</h5>
<section *ngIf="acceptedFilesTypeShow"> <section *ngIf="acceptedFilesTypeShow">
<md-input-container> <md-input-container>
@@ -301,18 +301,22 @@
</adf-upload-button> </adf-upload-button>
</div> </div>
<section> <section>
<md-checkbox [(ngModel)]="enableUpload">Enable upload (demoing enabled/disabled state only if the permission are not checked dynamically)</md-checkbox> <md-checkbox [(ngModel)]="enableUpload">
{{'DOCUMENT_LIST.DESCRIPTION_UPLOAD' | translate}}
</md-checkbox>
</section> </section>
</div> </div>
<div class="p-10"> <div class="p-10">
<p>For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.</p> <p>
{{'DOCUMENT_LIST.MULTISELECT_DESCRIPTION' | translate}}
</p>
<md-select placeholder="Selection Mode" [(ngModel)]="selectionMode" name="food"> <md-select placeholder="Selection Mode" [(ngModel)]="selectionMode" name="food">
<md-option *ngFor="let mode of selectionModes" [value]="mode.value"> <md-option *ngFor="let mode of selectionModes" [value]="mode.value">
{{mode.viewValue}} {{mode.viewValue}}
</md-option> </md-option>
</md-select> </md-select>
</div> </div>
</div> </div>
<file-uploading-dialog #fileDialog></file-uploading-dialog> <file-uploading-dialog #fileDialog></file-uploading-dialog>

View File

@@ -7,7 +7,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleECM()" (change)="toggleECM()"
[checked]="isECM"> [checked]="isECM">
Content Services {{ 'LOGIN.CONTENT_SERVICES'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
<p class="toggle"> <p class="toggle">
@@ -16,7 +16,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleBPM()" (change)="toggleBPM()"
[checked]="isBPM"> [checked]="isBPM">
Process Services {{ 'LOGIN.PROCESS_SERVICES'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
<p class="toggle"> <p class="toggle">
@@ -34,7 +34,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleFooter()" (change)="toggleFooter()"
[checked]="showFooter"> [checked]="showFooter">
Login footer {{ 'LOGIN.LOGIN_FOOTER'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
</div> </div>
@@ -62,7 +62,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleECM()" (change)="toggleECM()"
[checked]="isECM"> [checked]="isECM">
Content Services {{ 'LOGIN.CONTENT_SERVICES'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
<p> <p>
@@ -71,7 +71,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleBPM()" (change)="toggleBPM()"
[checked]="isBPM"> [checked]="isBPM">
Process Services {{ 'LOGIN.PROCESS_SERVICES'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
<p> <p>
@@ -89,7 +89,7 @@
[color]="'primary'" [color]="'primary'"
(change)="toggleFooter()" (change)="toggleFooter()"
[checked]="showFooter"> [checked]="showFooter">
Login footer {{ 'LOGIN.LOGIN_FOOTER'| translate }}
</md-slide-toggle> </md-slide-toggle>
</p> </p>
</div> </div>

View File

@@ -1,5 +1,5 @@
<div class="search-results-container"> <div class="search-results-container">
<div class="adf-search-title">Search results</div> <div class="adf-search-title">{{ 'SEARCH.RESULTS'| translate }}</div>
<adf-search <adf-search
[navigate]="false" [navigate]="false"
(nodeDbClick)="nodeDbClick($event)"></adf-search> (nodeDbClick)="nodeDbClick($event)"></adf-search>

View File

@@ -21,7 +21,7 @@
value="{{ecmHost}}" value="{{ecmHost}}"
placeholder="http(s)://host|ip:port(/path)"> placeholder="http(s)://host|ip:port(/path)">
<md-error *ngIf="urlFormControlEcm.hasError('pattern')"> <md-error *ngIf="urlFormControlEcm.hasError('pattern')">
ECM host is not valid! http(s)://host|ip:port(/path) {{ 'SETTINGS.NOT_VALID'| translate }}
</md-error> </md-error>
</md-input-container> </md-input-container>
<p> <p>
@@ -40,7 +40,7 @@
value="{{bpmHost}}" value="{{bpmHost}}"
placeholder="http(s)://host|ip:port(/path)"> placeholder="http(s)://host|ip:port(/path)">
<md-error *ngIf="urlFormControlBpm.hasError('pattern')"> <md-error *ngIf="urlFormControlBpm.hasError('pattern')">
BPM host is not valid! http(s)://host|ip:port(/path) {{ 'SETTINGS.NOT_VALID'| translate }}
</md-error> </md-error>
</md-input-container> </md-input-container>

View File

@@ -4,13 +4,17 @@
<div fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch"> <div fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch">
<div class="adf-social-example-area" fxFlex.gt-md="1 1 auto"> <div class="adf-social-example-area" fxFlex.gt-md="1 1 auto">
<md-card> <md-card>
<div class="adf-social-title">Like component</div> <div class="adf-social-title">
{{'SOCIAL.LIKE' | translate }}
</div>
<adf-like [nodeId]="nodeId"></adf-like> <adf-like [nodeId]="nodeId"></adf-like>
</md-card> </md-card>
</div> </div>
<div class="adf-social-example-area" fxFlex.gt-md="1 1 auto"> <div class="adf-social-example-area" fxFlex.gt-md="1 1 auto">
<md-card> <md-card>
<div class="adf-social-title">Rating component</div> <div class="adf-social-title">
{{'SOCIAL.RATING' | translate }}
</div>
<adf-rating [nodeId]="nodeId"></adf-rating> <adf-rating [nodeId]="nodeId"></adf-rating>
</md-card> </md-card>
</div> </div>

View File

@@ -1,4 +1,4 @@
<label for="nodeId"><b>Insert Node Id</b></label><br> <label for="nodeId"><b>{{'TAG.INSERT' | translate }}</b></label><br>
<input id="nodeId" type="text" size="48" [(ngModel)]="nodeId"><br> <input id="nodeId" type="text" size="48" [(ngModel)]="nodeId"><br>
<div fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch"> <div fxLayout="row" fxLayout.lt-lg="column" fxLayoutAlign="stretch">
<div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto"> <div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto">
@@ -8,13 +8,17 @@
</div> </div>
<div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto"> <div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto">
<md-card> <md-card>
<div class="adf-tag-example-title">List Tags Content Services</div> <div class="adf-tag-example-title">
{{'TAG.LIST' | translate }}
</div>
<adf-tag-list></adf-tag-list> <adf-tag-list></adf-tag-list>
</md-card> </md-card>
</div> </div>
<div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto"> <div class="adf-tag-example-area" fxFlex.gt-md="1 1 auto">
<md-card> <md-card>
<div class="adf-tag-example-title">Tag list By Node ID</div> <div class="adf-tag-example-title">
{{'TAG.NODE_LIST' | translate }}
</div>
<adf-tag-node-list [nodeId]="nodeId"></adf-tag-node-list> <adf-tag-node-list [nodeId]="nodeId"></adf-tag-node-list>
</md-card> </md-card>
</div> </div>

View File

@@ -145,11 +145,7 @@ module.exports = {
inline: true, inline: true,
proxy: { proxy: {
'/ecm': { '/ecm': {
target: { target: 'http://adfdev.lab.alfresco.me/',
host: "0.0.0.0",
protocol: 'http:',
port: 8080
},
pathRewrite: { pathRewrite: {
'^/ecm': '' '^/ecm': ''
}, },
@@ -164,11 +160,7 @@ module.exports = {
} }
}, },
'/bpm': { '/bpm': {
target: { target: 'http://adfdev.lab.alfresco.me/',
host: "0.0.0.0",
protocol: 'http:',
port: 9999
},
pathRewrite: { pathRewrite: {
'^/bpm': '' '^/bpm': ''
}, },

View File

@@ -1,6 +1,30 @@
{ {
"title": "Welcome", "title": "Welcome",
"APP_LAYOUT": {
"APP_NAME": "ADF Demo Application",
"HOME": "Home",
"CONTENT_SERVICES": "Content Services",
"PROCESS_SERVICES": "Process Services",
"LOGIN": "Login",
"CUSTOM_SOURCES": "DL: Custom Sources",
"DATATABLE": "Datatable",
"FORM": "Form",
"FORM_LIST": "Form List",
"UPLOADER": "Uploader",
"WEBSCRIPT": "Webscript",
"TAG": "Tag",
"SOCIAL": "Social",
"SETTINGS": "Settings",
"ABOUT": "About"
},
"DOCUMENT_LIST": { "DOCUMENT_LIST": {
"MULTISELECT_CHECKBOXES" :"Multiselect (with checkboxes)",
"MULTIPLE_FILE_UPLOAD" :"Multiple File Upload",
"FOLDER_UPLOAD" :"Folder upload",
"CUSTOM_FILTER" :"Custom extensions filter",
"ENABLE_VERSIONING" :"Enable versioning",
"MULTISELECT_DESCRIPTION" : "Enable upload (demoing enabled/disabled state only if the permission are not checked dynamically)",
"DESCRIPTION_" : "For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items.",
"COLUMNS": { "COLUMNS": {
"DISPLAY_NAME": "Display name", "DISPLAY_NAME": "Display name",
"TAG": "Tag", "TAG": "Tag",
@@ -22,6 +46,15 @@
} }
} }
}, },
"DATATABLE" :{
"RESET_DEFAULT":"Reset to default",
"ADD_ROW":"Add row",
"REPLACE_ROWS":"Replace rows",
"REPLACE_COLUMNS":"Replace columns",
"LOAD_NODE":"Load Node",
"MULTISELECT":"Multiselect",
"MULTISELECT_DESCRIPTION":"For 'Multiple' selection mode use Cmd (macOS) or Ctrl (Win) to toggle selection of multiple items."
},
"ANALYTICS_REPORT": { "ANALYTICS_REPORT": {
"NO_REPORT_MESSAGE": "No report selected. Choose a report from the list" "NO_REPORT_MESSAGE": "No report selected. Choose a report from the list"
}, },
@@ -38,10 +71,28 @@
"CS-HOST": "Content Services host URL configuration", "CS-HOST": "Content Services host URL configuration",
"BP-HOST": "Process Services host URL configuration", "BP-HOST": "Process Services host URL configuration",
"BACK": "Back", "BACK": "Back",
"APPLY": "APPLY" "APPLY": "APPLY",
"NOT_VALID": "Host not valid! http(s)://host|ip:port(/path)"
}, },
"FORM-LIST":{ "FORM-LIST": {
"STORE": "Store", "STORE": "Store",
"RESTORE": "Restore" "RESTORE": "Restore"
},
"LOGIN": {
"CONTENT_SERVICES": "Content Services",
"PROCESS_SERVICES": "Process Services",
"LOGIN_FOOTER": "Login footer"
},
"SEARCH": {
"RESULTS": "Search results"
},
"SOCIAL": {
"LIKE":"Like component",
"RATING":"Rating component"
},
"TAG": {
"LIST":"List Tags Content Services",
"INSERT":"Insert Node Id",
"NODE_LIST":"Tag list By Node ID"
} }
} }

View File

@@ -16,8 +16,7 @@
*/ */
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CoreModule } from 'ng2-alfresco-core'; import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { MaterialModule } from './src/material.module'; import { MaterialModule } from './src/material.module';
export { ViewerComponent } from './src/components/viewer.component'; export { ViewerComponent } from './src/components/viewer.component';
@@ -49,11 +48,20 @@ export function declarations() {
], ],
declarations: declarations(), declarations: declarations(),
providers: [ providers: [
RenderingQueueServices RenderingQueueServices,
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'ng2-alfresco-viewer',
source: 'assets/ng2-alfresco-viewer'
}
}
], ],
exports: [ exports: [
MaterialModule, MaterialModule,
...declarations() ...declarations()
] ]
}) })
export class ViewerModule {} export class ViewerModule {
}

View File

@@ -1,6 +1,6 @@
<div class="adf-viewer__unknown-format-view"> <div class="adf-viewer__unknown-format-view">
<div> <div>
<md-icon class="icon">wifi_tethering</md-icon> <md-icon class="icon">wifi_tethering</md-icon>
<div class="label">Document preview could not be loaded.</div> <div class="label">{{'VIEWER.UNKNOWN' | translate}}</div>
</div> </div>
</div> </div>

View File

@@ -1,3 +1,5 @@
{ {
"VIEWER": {
"UNKNOWN": "Document preview could not be loaded"
}
} }

View File

@@ -16,7 +16,7 @@
*/ */
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CoreModule } from 'ng2-alfresco-core'; import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable'; import { DataTableModule } from 'ng2-alfresco-datatable';
import { WebscriptComponent } from './src/webscript.component'; import { WebscriptComponent } from './src/webscript.component';
@@ -30,6 +30,16 @@ export { WebscriptComponent } from './src/webscript.component';
declarations: [ declarations: [
WebscriptComponent WebscriptComponent
], ],
providers: [
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'ng2-alfresco-webscript',
source: 'assets/ng2-alfresco-webscript'
}
}
],
exports: [ exports: [
WebscriptComponent WebscriptComponent
] ]

View File

@@ -1,3 +1,5 @@
{ {
"WEBSCRIPT": {
"ERROR": "Error during the deserialization of {{data}} as {{contentType}}"
}
} }

View File

@@ -0,0 +1,16 @@
<div *ngIf="showData">
<div *ngIf="contentType === 'JSON'" id="webscript-data-JSON">{{data | json}}</div>
<div *ngIf="contentType === 'HTML'" id="webscript-data-HTML" [innerHTML]="data"></div>
<div *ngIf="contentType === 'TEXT'" id="webscript-data-TEXT">{{data}}</div>
<div *ngIf="isDataTableContent()">
<alfresco-datatable id="webscript-datatable-wrapper" [data]="data"></alfresco-datatable>
<div>
<div *ngIf="showError" id="error">{{'WEBSCRIPT.ERROR' | translate: {
data: data,
contentType: contentType
}
}}
</div>
</div>
</div>
</div>

View File

@@ -42,15 +42,7 @@ import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
*/ */
@Component({ @Component({
selector: 'adf-webscript-get, alfresco-webscript-get', selector: 'adf-webscript-get, alfresco-webscript-get',
template: ` templateUrl: 'webscript.component.html'
<div *ngIf="showData">
<div *ngIf="contentType === 'JSON'" id="webscript-data-JSON">{{data | json}}</div>
<div *ngIf="contentType === 'HTML'" id="webscript-data-HTML" [innerHTML]="data"></div>
<div *ngIf="contentType === 'TEXT'" id="webscript-data-TEXT" >{{data}}</div>
<div *ngIf="isDataTableContent()"><alfresco-datatable id="webscript-datatable-wrapper" [data]="data"></alfresco-datatable><div>
<div *ngIf="showError" id="error">Error during the deserialization of {{data}} as {{contentType}}</div>
</div>
`
}) })
export class WebscriptComponent implements OnChanges { export class WebscriptComponent implements OnChanges {