diff options
31 files changed, 239 insertions, 571 deletions
diff --git a/cds-ui/client/package.json b/cds-ui/client/package.json index 8963be367..04dd30861 100644 --- a/cds-ui/client/package.json +++ b/cds-ui/client/package.json @@ -28,11 +28,13 @@ "@ngrx/store": "^6.1.2", "@ngrx/store-devtools": "^6.1.2", "@types/d3": "^5.7.0", + "ang-jsoneditor": "1.6.1", "core-js": "^2.5.4", "d3": "^5.9.1", "file-saver": "^2.0.1", "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", + "jsoneditor": "^5.31.1", "jszip": "^3.2.0", "material-design-icons": "^3.0.1", "ng2-ace-editor": "^0.3.9", diff --git a/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts b/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts index 092531ee3..b0d37c3d1 100644 --- a/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts +++ b/cds-ui/client/src/app/common/shared/pipes/search.pipe.ts @@ -26,11 +26,12 @@ import { Pipe, PipeTransform } from '@angular/core'; export class SearchPipe implements PipeTransform{ - transform(item: any, searchText: any): any { - if(searchText == null) return item; - - return item.filter(function(search){ - return search.type.toLowerCase().indexOf(searchText.toLowerCase()) > -1; - }) - } + transform(items: any[], searchText: string): any[] { + if(!items) return []; + if(!searchText) return items; + searchText = searchText.toLowerCase(); + return items.filter( it => { + return it.toLowerCase().includes(searchText); + }); + } }
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.scss index 1a3674c56..4af107276 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.scss @@ -67,6 +67,6 @@ limitations under the License. .designerTmp { display: flex; flex-direction: row; - height: 524px; + height: 490px; width: 100% }
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.html b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.html index 64b201d81..308f9cc1f 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.html +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.html @@ -20,8 +20,8 @@ limitations under the License. <div class="container"> <div class="fileViewContainer"> - <mat-tree [dataSource]="dataSource" [treeControl]="treeControl"> - <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding> + <mat-tree [dataSource]="dataSource" [treeControl]="treeControl" style="background-color: #ebebeb"> + <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)="selectFileToView(node);activeNode = node" [ngClass]="{ 'background-highlight': activeNode === node }"> <button mat-icon-button disabled></button> <button mat-icon-button (click)="selectFileToView(node)">{{node.name}}</button> </mat-tree-node> @@ -31,7 +31,7 @@ limitations under the License. {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}} </mat-icon> </button> - <button mat-icon-button (click)="selectFileToView(node)">{{node.name}}</button> + <button mat-icon-button>{{node.name}}</button> </mat-tree-node> </mat-tree> </div> @@ -39,50 +39,4 @@ limitations under the License. <i class="fa fa-save save-icon" style="font-size:24px" (click)="updateBlueprint()"></i> <ace-editor [(text)]="text" [(mode)]="mode" #editor class="aceEditor"></ace-editor> </div> -</div> - -<!-- <div style="display: flex;flex-direction: row"> - <div style="height: 6em; - width: 30em;"> - - </div> - <div style="height: 6em; - width: 16em"> - <button style="margin: 0.5em; - background-color: #3f51b5; - color: white; - border-radius: 2em; - padding: 0.5em; - min-width: 6em;" (click)="updateBlueprint()">Save Changes</button> - </div> - <div style="height: 6em; - width: 100%;"> - <div style="margin-left: 38em"> - <mat-form-field> - <select matNativeControl required> - <option value="volvo">SDC</option> - <option value="saab">CCSDK</option> - </select> - </mat-form-field> - <button style="margin: 0.5em; - background-color: #3f51b5; - color: white; - border-radius: 2em; - padding: 0.5em; - min-width: 6em;">Deploy</button> - <button style="margin: 0.5em; - background-color: #3f51b5; - color: white; - border-radius: 2em; - padding: 0.5em; - min-width: 6em;">Save</button> - <button style="margin: 0.5em; - background-color: #3f51b5; - color: white; - border-radius: 2em; - padding: 0.5em; - min-width: 6em;" (click)="download()">Download</button> - - </div> - </div> -</div> -->
\ No newline at end of file +</div>
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.scss index 136c08bfa..2f16af7a5 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.scss @@ -29,6 +29,7 @@ limitations under the License. height: 490px !important; overflow-x: scroll; overflow-y: scroll; + background-color: #ebebeb; } .editorConatiner { width: 80%; @@ -57,4 +58,8 @@ limitations under the License. font-size: 24px; cursor: pointer; z-index: 1; -}
\ No newline at end of file +} + +.background-highlight { + background-color: whitesmoke !important; + }
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts index 7203dc8b3..e48177d0a 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts +++ b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts @@ -82,6 +82,7 @@ export class EditorComponent implements OnInit { fileExtension: string; mode: string; private zipFile: JSZip = new JSZip(); + activeNode: any; private transformer = (node: Node, level: number) => { return { @@ -143,7 +144,7 @@ export class EditorComponent implements OnInit { blueprint.push(this.blueprintdata[key]); } } - this.text = JSON.stringify(this.blueprintdata, null, '\t'); + // this.text = JSON.stringify(this.blueprintdata, null, '\t'); // this.editor.getEditor().getSession().setMode("ace/mode/json"); this.editor.getEditor().getSession().setTabSize(2); this.editor.getEditor().getSession().setUseWrapMode(true); diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss index 88ce560c0..1e49773ec 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss @@ -31,7 +31,10 @@ limitations under the License. .matBtn { color: white; - background: gray; + background:#3f51b5; margin-top: 10px; position: absolute; + border-radius: 4px; + min-width: 6em; + cursor: pointer; }
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.html index 66e3aeb36..b58be9fce 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.html +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.html @@ -22,5 +22,5 @@ limitations under the License. <input type="file" accept=".zip" (change)="fileChanged($event)"> </div> <div> - <button mat-button matStepperNext class="matStepNextBtn" (click)="updateBlueprintState()" [disabled]="!validfile">Upload</button> + <button mat-button matStepperNext (click)="updateBlueprintState()" [ngClass] = "{'mat-upload-btn-disabled': !validfile, 'matStepNextBtn': validfile}" [disabled]="!validfile">Upload</button> </div>
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.scss index 66f3f28de..beb05e26f 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.scss @@ -25,5 +25,18 @@ limitations under the License. margin-top: 10px; position: absolute; margin-bottom: 5px; - border-radius: 2em; + border-radius: 4px; + min-width: 6em; + cursor: pointer; +} + +.mat-upload-btn-disabled { + background-color: #c5cae8; + margin-top: 10px; + border-radius: 4px; + margin-bottom: 5px; + color: darkgray; + min-width: 6em; + border: none; + cursor: initial; }
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.scss index 931e1d445..37d1feb7f 100644 --- a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.scss +++ b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.scss @@ -25,14 +25,12 @@ limitations under the License. margin-top: 10px; position: absolute; margin-bottom: 5px; - border-radius: 2em; + border-radius: 4px; + min-width: 6em; + cursor: pointer; } .matStepContent { margin-top: 15px !important; margin-bottom: 20px !important; -} - -// .mat-vertical-content { -// margin: 10px !important; -// }
\ No newline at end of file +}
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.html deleted file mode 100644 index f85a2e49f..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.html +++ /dev/null @@ -1,24 +0,0 @@ -<!--/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/--> - - -<p> - browse-file works! -</p> diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.scss deleted file mode 100644 index cafd2bf8f..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.scss +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.spec.ts deleted file mode 100644 index df67a6024..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.spec.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { BrowseFileComponent } from './browse-file.component'; - -describe('BrowseFileComponent', () => { - let component: BrowseFileComponent; - let fixture: ComponentFixture<BrowseFileComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ BrowseFileComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(BrowseFileComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.ts deleted file mode 100644 index 5c00aa0e4..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/browse-file/browse-file.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-browse-file', - templateUrl: './browse-file.component.html', - styleUrls: ['./browse-file.component.scss'] -}) -export class BrowseFileComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.module.ts index c618e2748..0e056530d 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.module.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.module.ts @@ -24,7 +24,6 @@ import { CommonModule } from '@angular/common'; import { ResourceDefinitionRoutingModule } from './resource-definition-routing.module'; import { ResourceDefinitionComponent } from './resource-definition.component'; import { SharedModule } from '../../../app/common/shared/shared.module'; -import { SaveResourceModule } from './save-resource/save-resource.module'; import { ResourceCreationModule } from './resource-creation/resource-creation.module'; import { ResourceEditModule } from './resource-edit/resource-edit.module'; @@ -39,7 +38,6 @@ import { MatIconModule } from '@angular/material/icon'; CommonModule, ResourceDefinitionRoutingModule, SharedModule, - SaveResourceModule, ResourceCreationModule, ResourceEditModule, MatToolbarModule, diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts index 8f28021c8..2b25ae339 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts @@ -29,6 +29,7 @@ import { SharedModule } from '../../../../app/common/shared/shared.module'; import { SourcesTemplateComponent } from './sources-template/sources-template.component'; import { ResourceMetadataComponent } from './resource-metadata/resource-metadata.component'; import { DragDropModule } from '@angular/cdk/drag-drop'; +import { NgJsonEditorModule } from 'ang-jsoneditor'; @NgModule({ declarations: [ ResourceEditComponent,SourcesTemplateComponent,ResourceMetadataComponent ], @@ -38,8 +39,8 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; SharedModule, FormsModule,ReactiveFormsModule, DragDropModule, - MatExpansionModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule, MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule - + MatExpansionModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule, MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule, + NgJsonEditorModule ], exports: [ ResourceEditComponent,SharedModule ] }) diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html index 123594a50..903c6d319 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html @@ -21,17 +21,17 @@ <div class="sources-container"> <div cdkDropList - [cdkDropListData]="todo" + [cdkDropListData]="sourcesOptions" class="sources-list" (cdkDropListDropped)="drop($event)"> - <div class="sources-box" *ngFor="let item of todo" cdkDrag> + <div class="sources-box" *ngFor="let item of sourcesOptions" cdkDrag> <mat-expansion-panel class="expansion-panel"> <mat-expansion-panel-header> <mat-panel-title> - {{item.type}} + {{item}} </mat-panel-title> </mat-expansion-panel-header> - {{item}} + <json-editor [options]="options" [data]="selected(item)" on-change="onChange()"></json-editor> </mat-expansion-panel> </div> </div> @@ -47,10 +47,10 @@ <br><br> <div cdkDropList - [cdkDropListData]="sourcesOptions" + [cdkDropListData]="option" class="options-list" (cdkDropListDropped)="drop($event)"> - <div class="options-box" *ngFor="let item of sourcesOptions | search : searchText" cdkDrag>{{item.type}}</div> + <div class="options-box" *ngFor="let item of option | search :searchText" cdkDrag>{{item}}</div> </div> </div> </div>
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts index 8c6d99ca7..c43d1debd 100644 --- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts +++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; import { IResources } from 'src/app/common/core/store/models/resources.model'; import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model'; @@ -28,6 +28,7 @@ import { IAppState } from '../../../../common/core/store/state/app.state'; import { A11yModule } from '@angular/cdk/a11y'; import { LoadResourcesSuccess } from 'src/app/common/core/store/actions/resources.action'; import { ISourcesData } from 'src/app/common/core/store/models/sourcesData.model'; +import { JsonEditorComponent, JsonEditorOptions } from 'ang-jsoneditor'; @Component({ selector: 'app-sources-template', @@ -35,14 +36,29 @@ import { ISourcesData } from 'src/app/common/core/store/models/sourcesData.model styleUrls: ['./sources-template.component.scss'] }) export class SourcesTemplateComponent implements OnInit { +// rdState: Observable<IResourcesState>; +// resources: IResources; +// todo = []; +// sources:ISourcesData; +// sourcesOptions = []; + + @ViewChild(JsonEditorComponent) editor: JsonEditorComponent; + options = new JsonEditorOptions(); + rdState: Observable<IResourcesState>; resources: IResources; - todo = []; + option = ['mdsal','default']; sources:ISourcesData; sourcesOptions = []; - + sourcesData = []; + constructor(private store: Store<IAppState>) { - this.rdState = this.store.select('resources'); + this.rdState = this.store.select('resources'); + this.options.mode = 'text'; + this.options.modes = [ 'text', 'tree', 'view']; + this.options.statusBar = false; + this.options.onChange = () => console.log(this.editor.get()); + } ngOnInit() { @@ -51,14 +67,22 @@ export class SourcesTemplateComponent implements OnInit { var resourcesState: IResourcesState = { resources: resourcesdata.resources, isLoadSuccess: resourcesdata.isLoadSuccess, isSaveSuccess: resourcesdata.isSaveSuccess, isUpdateSuccess: resourcesdata.isUpdateSuccess }; this.sources = resourcesState.resources.sources; for (let key in this.sources) { - if (this.sources.hasOwnProperty(key)) { - this.sourcesOptions.push(this.sources[key]); - } + this.sourcesOptions.push(key); } - console.log(this.sourcesOptions); + //console.log(this.sourcesOptions); }) } + onChange() { + console.log(this.editor.get()) + }; + + selected(value){ + console.log(value); + this.sourcesData=this.sources[value]; + return this.sourcesData; + } + drop(event: CdkDragDrop<string[]>) { if (event.previousContainer === event.container) { moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource-routing.module.ts deleted file mode 100644 index c0346ca7e..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource-routing.module.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { SaveResourceComponent } from './save-resource.component'; - -const routes: Routes = [ - { - path: '', - component: SaveResourceComponent - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class SaveResourceRoutingModule { } diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.html deleted file mode 100644 index 2ecb4a041..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.html +++ /dev/null @@ -1,25 +0,0 @@ -<!--/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/--> - - -<p> - save-resource works! -</p> -<router-outlet></router-outlet>
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.scss deleted file mode 100644 index cafd2bf8f..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.scss +++ /dev/null @@ -1,19 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/
\ No newline at end of file diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.spec.ts deleted file mode 100644 index 6a3299940..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.spec.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { SaveResourceComponent } from './save-resource.component'; - -describe('SaveResourceComponent', () => { - let component: SaveResourceComponent; - let fixture: ComponentFixture<SaveResourceComponent>; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ SaveResourceComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(SaveResourceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.ts deleted file mode 100644 index f4a046b55..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-save-resource', - templateUrl: './save-resource.component.html', - styleUrls: ['./save-resource.component.scss'] -}) -export class SaveResourceComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.module.ts deleted file mode 100644 index d87cfe31b..000000000 --- a/cds-ui/client/src/app/feature-modules/resource-definition/save-resource/save-resource.module.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : CDS -* ================================================================================ -* Copyright 2019 TechMahindra -*================================================================================= -* 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. -* ============LICENSE_END========================================================= -*/ - -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { SaveResourceComponent } from './save-resource.component'; -import { SaveResourceRoutingModule } from './save-resource-routing.module'; - -@NgModule({ - declarations: [SaveResourceComponent], - exports: [ SaveResourceComponent ], - imports: [ - CommonModule, - SaveResourceRoutingModule - ] -}) -export class SaveResourceModule { } diff --git a/cds-ui/client/src/styles.scss b/cds-ui/client/src/styles.scss index 10d55776d..54eb74689 100644 --- a/cds-ui/client/src/styles.scss +++ b/cds-ui/client/src/styles.scss @@ -20,7 +20,7 @@ limitations under the License. */ /* You can add global styles to this file, and also import other style files */ - +@import "~jsoneditor/dist/jsoneditor.min.css"; .mat-card:not([class*=mat-elevation-z]) { box-shadow: none !important; } diff --git a/docs/CBA/index.rst b/docs/CBA/index.rst index 06d902a74..3bc6aca95 100644 --- a/docs/CBA/index.rst +++ b/docs/CBA/index.rst @@ -31,20 +31,64 @@ Architecture: Installation: ============= -.. toctree:: - :maxdepth: 1 - :glob: - - sections/installation/index +Building client html and js files +================================= + + * FROM alpine:3.8 as builder + + * RUN apk add --no-cache npm + + * WORKDIR /opt/cds-ui/client/ + + * COPY client/package.json /opt/cds-ui/client/ + + * RUN npm install + + * COPY client /opt/cds-ui/client/ + + * RUN npm run build + + +Building and creating server +============================ + + * FROM alpine:3.8 + + * WORKDIR /opt/cds-ui/ + + * RUN apk add --no-cache npm + + * COPY server/package.json /opt/cds-ui/ + + * RUN npm install + + * COPY server /opt/cds-ui/ + + * COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public + + * RUN npm run build + + * EXPOSE 3000 + + * CMD [ "npm", "start" ] Development: ============= -.. toctree:: - :maxdepth: 1 - :glob: - - sections/development/index +Pre-requiste: +============= + Visual Studio code editor + Git bash + +Steps +===== + To compile CDS code: + + 1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains + references to the ONAP repositories and OpenDaylight repositories. + 2. git clone https://(LFID)@gerrit.onap.org/r/a/ccsdk/cds + 3. cd cds ; mvn clean install ; cd .. + 4. Open the cds-ui/client code for development Data Flow: ========== diff --git a/docs/CBA/resourceassignment.rst b/docs/CBA/resourceassignment.rst new file mode 100644 index 000000000..be8b08e25 --- /dev/null +++ b/docs/CBA/resourceassignment.rst @@ -0,0 +1,73 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright (C) 2019 IBM. + +Resource Assignment +=================== +.. toctree:: + :maxdepth: 1 + + +Component executor: +=================== +Workflow: +========= + +A workflow defines an overall action to be taken for the service; it can be composed of a set of sub-actions to execute. Currently, workflows are backed by Directed Graph engine. + +A CBA can have as many workflow as needed. + +Template: +========= + +A template is an artifact. + +A template is parameterized and each parameter must be defined in a corresponding mapping file. + +In order to know which mapping correlate to which template, the file name must start with an artifact-prefix, serving as identifier to the overall template + mapping. + +The requirement is as follow: + +${artifact-prefix}-template +${artifact-prefix}-mapping + +A template can represent anything, such as device config, payload to interact with 3rd party systems, resource-accumulator template, etc... + +Mapping: +======== +Defines the contract of each resource to be resolved. Each placeholder in the template must have a corresponding mapping definition. + +A mapping is comprised of: + +- name +- required / optional +- type (support complex type) +- dictionary-name +- dictionary-source + +Dependencies: +============= + +This allows to make sure given resources get resolved prior the resolution of the resources defining the dependency. +The dictionary fields reference to a specific data dictionary. + +Resource accumulator: +===================== + +In order to resolve HEAT environment variables, resource accumulator templates are being in used for Dublin. + +These templates are specific to the pre-instantiation scenario, and relies on GR-API within SDNC. + +It is composed of the following sections: + +resource-accumulator-resolved-data: defines all the resources that can be resolved directly from the context. It expresses a direct mapping between the name of the resource and its value. + +capability-data: defines what capability to use to create a specific resource, along with the ingredients required to invoke the capability and the output mapping. + +- Scripts +- Library +- NetconfClient + +In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available. This NetconfClient can be used when using the netconf-component-executor. + +The client can be find here: https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py
\ No newline at end of file diff --git a/docs/CBA/sections/development/index.rst b/docs/CBA/sections/development/index.rst deleted file mode 100644 index dc61a238c..000000000 --- a/docs/CBA/sections/development/index.rst +++ /dev/null @@ -1,26 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 -.. Copyright (C) 2019 IBM. - -Development ------------- -.. toctree:: - :maxdepth: 1 - -Pre-requiste: -============= - Visual Studio code editor - Git bash - -Steps -===== - To compile CDS code: - - 1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains - references to the ONAP repositories and OpenDaylight repositories. - 2. git clone https://(LFID)@gerrit.onap.org/r/a/ccsdk/cds - 3. cd cds ; mvn clean install ; cd .. - 4. Open the cds-ui/client code for development - - - diff --git a/docs/CBA/sections/installation/index.rst b/docs/CBA/sections/installation/index.rst deleted file mode 100644 index eb7676d08..000000000 --- a/docs/CBA/sections/installation/index.rst +++ /dev/null @@ -1,47 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 -.. Copyright (C) 2019 IBM. - -Installation ------------- - -Building client html and js files -================================= - - * FROM alpine:3.8 as builder - - * RUN apk add --no-cache npm - - * WORKDIR /opt/cds-ui/client/ - - * COPY client/package.json /opt/cds-ui/client/ - - * RUN npm install - - * COPY client /opt/cds-ui/client/ - - * RUN npm run build - - -Building and creating server -============================ - - * FROM alpine:3.8 - - * WORKDIR /opt/cds-ui/ - - * RUN apk add --no-cache npm - - * COPY server/package.json /opt/cds-ui/ - - * RUN npm install - - * COPY server /opt/cds-ui/ - - * COPY --from=builder /opt/cds-ui/server/public /opt/cds-ui/public - - * RUN npm run build - - * EXPOSE 3000 - - * CMD [ "npm", "start" ]
\ No newline at end of file diff --git a/docs/datadictionary/index.rst b/docs/datadictionary/index.rst index 3243fd23f..83c6e47b8 100644 --- a/docs/datadictionary/index.rst +++ b/docs/datadictionary/index.rst @@ -2,44 +2,44 @@ .. http://creativecommons.org/licenses/by/4.0 .. Copyright (C) 2019 IBM. -Data Dictionary ----------------- +Resource Definition +------------------- .. toctree:: :maxdepth: 1 Introduction: ============= -A data dictionary defines a specifc resource that can be resolved using the bellow supported sources. +A Resource Definition defines a specifc resource that can be resolved using the bellow supported sources. -A data dictionary can support multiple sources. +A Resource Definition can support multiple sources. -The main goal of data dictionary is to define generic entity that could be shared accross services. +The main goal of Resource Definition is to define generic entity that could be shared accross services. Resolution sources: =================== - Input - Default - DB - REST - Capability + * Input + * Default + * DB + * REST + * Capability Artifacts: ========== - artifact-mapping-resource - artifact-template-velocity - artifact-directed-graph - + * artifact-mapping-resource + * artifact-template-velocity + * artifact-directed-graph Node type: ========== - component-resource-resolution - component-jython-executor - component-netconf-executor - component-restconf-executor + + * component-resource-resolution + * component-jython-executor + * component-netconf-executor + * component-restconf-executor Data type: ========== - vnf-netconf-device
\ No newline at end of file + * vnf-netconf-device
\ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index b5a9576da..f46653ab6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -32,69 +32,11 @@ The GUI handles direct user input and allows for displaying both design time and Resource assignment: ===================== -Component executor: -=================== -Workflow: -========= - -A workflow defines an overall action to be taken for the service; it can be composed of a set of sub-actions to execute. Currently, workflows are backed by Directed Graph engine. - -A CBA can have as many workflow as needed. - -Template: -========= - -A template is an artifact. - -A template is parameterized and each parameter must be defined in a corresponding mapping file. - -In order to know which mapping correlate to which template, the file name must start with an artifact-prefix, serving as identifier to the overall template + mapping. - -The requirement is as follow: - -${artifact-prefix}-template -${artifact-prefix}-mapping - -A template can represent anything, such as device config, payload to interact with 3rd party systems, resource-accumulator template, etc... - -Mapping: -======== -Defines the contract of each resource to be resolved. Each placeholder in the template must have a corresponding mapping definition. - -A mapping is comprised of: - -- name -- required / optional -- type (support complex type) -- dictionary-name -- dictionary-source - -Dependencies: -============= - -This allows to make sure given resources get resolved prior the resolution of the resources defining the dependency. -The dictionary fields reference to a specific data dictionary. - -Resource accumulator: -===================== - -In order to resolve HEAT environment variables, resource accumulator templates are being in used for Dublin. - -These templates are specific to the pre-instantiation scenario, and relies on GR-API within SDNC. - -It is composed of the following sections: - -resource-accumulator-resolved-data: defines all the resources that can be resolved directly from the context. It expresses a direct mapping between the name of the resource and its value. - -capability-data: defines what capability to use to create a specific resource, along with the ingredients required to invoke the capability and the output mapping. - -- Scripts -- Library -- NetconfClient - -In order to facilitate NETCONF interaction within scripts, a python NetconfClient binded to our Kotlin implementation is made available. This NetconfClient can be used when using the netconf-component-executor. - -The client can be find here: https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/netconfclient.py +.. toctree:: + :maxdepth: 1 + :glob: + + resourceassignment ResolutionHelper: ================= |