Commit 36e4b68a authored by rajkumar's avatar rajkumar
Browse files

Adding ace editor for updating xmls from application

parent bdc097d0
......@@ -11,21 +11,40 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"baseHref" : "/ena/submit/webin/",
"baseHref": "/ena/submit/webin/",
"deployUrl": "/ena/submit/webin/",
"outputPath": "../src/main/resources/static",
"outputPath": "dist/webin-portal",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico"
"src/favicon.ico",
{
"glob": "worker-xml.js",
"input": "./node_modules/ace-builds/src-min/",
"output": "/"
},
{
"glob": "worker-css.js",
"input": "./node_modules/ace-builds/src-min/",
"output": "/"
},
{
"glob": "worker-json.js",
"input": "./node_modules/ace-builds/src-min/",
"output": "/"
}
],
"styles": [
"src/styles.scss"
],
"scripts": []
"scripts": [
"./node_modules/ace-builds/src/ace.js",
"./node_modules/ace-builds/src/mode-xml.js",
"./node_modules/ace-builds/src/theme-eclipse.js"
]
},
"configurations": {
"dev": {
......@@ -153,4 +172,4 @@
"prefix": "app"
}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -37,6 +37,7 @@
"file-saver": "^2.0.0-rc.4",
"hammerjs": "^2.0.8",
"moment": "^2.27.0",
"ng2-ace-editor": "^0.3.9",
"rxjs": "^6.5.5",
"tslib": "^1.9.0",
"twit": "^2.2.11",
......
......@@ -61,6 +61,7 @@ import { TaxonomyManagementComponent } from './taxonomy-management/taxonomy-mana
import { TaxonomyDialogModalComponent } from './taxonomy-dialog-modal/taxonomy-dialog-modal.component';
import { UniqueNameByArrayDirective } from './directives/unique-name-by-array.directive';
import { NonSubmissionResultDialogComponent } from './non-submission-result-dialog/non-submission-result-dialog.component';
import { AceEditorModule } from 'ng2-ace-editor';
const appRoutes: Routes = [
......@@ -160,6 +161,7 @@ const appRoutes: Routes = [
onSameUrlNavigation: "reload"
}
),
AceEditorModule,
],
declarations: [
AppComponent,
......
<h2 mat-dialog-title>{{getTitle()}}</h2>
<mat-dialog-content>
<mat-dialog-content style="height:100%">
<div *ngIf="isRetrieveXmlError()">
......@@ -12,12 +12,14 @@
</div>
</div>
<div *ngIf="!isRetrieveXmlError() && !isUpdateXmlResult()">
<div *ngIf="!isRetrieveXmlError() && !isUpdateXmlResult()" style="height:100%;overflow: hidden;">
<!-- Show XML editor -->
<textarea matInput [(ngModel)]="xml" rows="15">
</textarea>
<ace-editor [(value)]="xml" [mode]="'xml'" [(ngModel)]="xml" [theme]="'eclipse'" [wrap]="'false'"
style="min-height: 100% ;">
</ace-editor>
</div>
<!-- Show XML update result -->
......
......@@ -20,6 +20,7 @@ import { SubmissionResultComponent } from '../submission-result/submission-resul
import { ReportType } from '../report-type.enum';
import { ReportActionInterface } from '../report-action.interface';
import { AceEditorModule } from 'ng2-ace-editor';
@Component({
selector: 'app-report-edit-dialog',
......
......@@ -520,10 +520,13 @@ export class ReportComponent implements OnInit {
editXml(action: ReportActionInterface): void {
const reportDialogRef = this._reportDialog.open(ReportEditDialogComponent, {
width: '600px',
width: window.innerWidth + 'px',
height: window.innerHeight - 200 + 'px',
data: action
});
reportDialogRef.afterClosed().subscribe();
reportDialogRef.afterClosed().subscribe(result => {
this.report();
});
}
reset() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment