mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Sanitise the component and Demo shell from embedded strings (#2474)
This commit is contained in:
committed by
Denys Vuika
parent
bfe8fc8d15
commit
9663971256
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
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 { WebscriptComponent } from './src/webscript.component';
|
||||
@@ -30,6 +30,16 @@ export { WebscriptComponent } from './src/webscript.component';
|
||||
declarations: [
|
||||
WebscriptComponent
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-webscript',
|
||||
source: 'assets/ng2-alfresco-webscript'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
WebscriptComponent
|
||||
]
|
||||
|
@@ -1,3 +1,5 @@
|
||||
{
|
||||
|
||||
"WEBSCRIPT": {
|
||||
"ERROR": "Error during the deserialization of {{data}} as {{contentType}}"
|
||||
}
|
||||
}
|
||||
|
@@ -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>
|
@@ -42,15 +42,7 @@ import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
*/
|
||||
@Component({
|
||||
selector: 'adf-webscript-get, alfresco-webscript-get',
|
||||
template: `
|
||||
<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>
|
||||
`
|
||||
templateUrl: 'webscript.component.html'
|
||||
})
|
||||
export class WebscriptComponent implements OnChanges {
|
||||
|
||||
|
Reference in New Issue
Block a user