From b1ce3d40b0f056a6275ab9ecb48fd0b16b9bb394 Mon Sep 17 00:00:00 2001 From: od7427 Date: Thu, 23 Aug 2018 11:49:12 -0400 Subject: APPC CDT to Support Multiple Templates for VNFCs APPC CDT Should Support Multiple Templates For Configure and ConfigModify for VNFs with VNFC level templates. CDT would be used to create a single reference artifact for a VNF. For the Configure related actions (Configure and ConfigModify) vnfc-type to be shown at the top. The user would have a new link below it, to be able to add each vnfc-type. For each vnfc-type, the user would create the associated template and PD file as usual. The fix required to modify several visual elements and variables related to VNFC Types on MyVNFS page, ReferenceData page, Template page and Parameters page. Also a number of supporting services were modified. New Modal window type is now used for VNFC-related dialogs. Change-Id: Ibbbb50e2ff6f96783c0aea89a6870d7c28021ba0 Issue-ID: APPC-1010 Signed-off-by: od7427 --- src/app/about-us/aboutus.component.html | 6 +- src/app/about-us/aboutus.component.ts | 23 +- src/app/shared/services/mapping-editor.service.ts | 6 +- .../services/utilityService/utility.service.ts | 18 + .../build-artifacts/build-artifacts.component.ts | 31 +- .../parameter-definitions/parameter.component.html | 10 +- .../parameter-definitions/parameter.component.ts | 4 +- .../reference-dataform.component.html | 46 +- .../reference-dataform.component.ts | 771 +++++++++++++++++---- .../reference-dataform/reference-dataform.util.ts | 169 +++++ .../param-name-value.component.html | 11 +- .../template-configuration.component.html | 9 +- .../template-configuration.component.ts | 11 + src/app/vnfs/myvnfs/myvnfs.component.html | 42 +- src/app/vnfs/myvnfs/myvnfs.component.ts | 95 ++- 15 files changed, 1040 insertions(+), 212 deletions(-) create mode 100644 src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.util.ts diff --git a/src/app/about-us/aboutus.component.html b/src/app/about-us/aboutus.component.html index 554fd4a..d7460f3 100644 --- a/src/app/about-us/aboutus.component.html +++ b/src/app/about-us/aboutus.component.html @@ -26,7 +26,7 @@ limitations under the License.
-
CONTACT DETAILS
+
CONTACT DETAILS
Contact us @: @@ -35,7 +35,7 @@ limitations under the License.
    
-
VERSION DETAILS
+
VERSION DETAILS
@@ -69,4 +69,4 @@ limitations under the License. - \ No newline at end of file + diff --git a/src/app/about-us/aboutus.component.ts b/src/app/about-us/aboutus.component.ts index 5b0fd26..04eee0d 100644 --- a/src/app/about-us/aboutus.component.ts +++ b/src/app/about-us/aboutus.component.ts @@ -31,6 +31,7 @@ import { saveAs } from 'file-saver'; import { DialogService } from 'ng2-bootstrap-modal'; import { ConfirmComponent } from '../shared/confirmModal/confirm.component'; import { appConstants } from '../../constants/app-constants'; +import {UtilityService} from '../shared/services/utilityService/utility.service'; @Component({ selector: 'app-help', @@ -38,7 +39,7 @@ import { appConstants } from '../../constants/app-constants'; styleUrls: ['./aboutus.component.css'] }) export class AboutUsComponent implements OnInit, OnDestroy { - + clName= "AboutUsComponent"; public releaseName: any; public versionNo: any; public contactUsMail: any; @@ -53,7 +54,9 @@ export class AboutUsComponent implements OnInit, OnDestroy { maxLength: 200 }; - constructor(private http: Http, private dialogService: DialogService, private notificationsService: NotificationsService) { + constructor( + private http: Http, private dialogService: DialogService, private notificationsService: NotificationsService, + private utilSvc: UtilityService ) { } ngOnInit() { @@ -101,4 +104,20 @@ export class AboutUsComponent implements OnInit, OnDestroy { }); saveAs(blob, 'versionLog.txt'); } + + tlPlus() { //.. increase tracelvl - more tracing in console + let tracelvl= this.utilSvc.getTracelvl(); + if( tracelvl < 2 ) { + tracelvl++; this.utilSvc.setTracelvl( tracelvl); + }; + console.log( this.clName+": tlPlus: tracelvl="+this.utilSvc.getTracelvl() ); + } + + tlMinus() { //.. decrease tracelvl - less tracing in console + let tracelvl= this.utilSvc.getTracelvl(); + if( tracelvl > 0 ) { + tracelvl--; this.utilSvc.setTracelvl( tracelvl); + }; + console.log( this.clName+": tlMinus: tracelvl="+this.utilSvc.getTracelvl() ); + } } diff --git a/src/app/shared/services/mapping-editor.service.ts b/src/app/shared/services/mapping-editor.service.ts index c27d95e..b9e2b53 100644 --- a/src/app/shared/services/mapping-editor.service.ts +++ b/src/app/shared/services/mapping-editor.service.ts @@ -71,6 +71,7 @@ export class MappingEditorService { private _navItem = {}; private _observer: Observer; private referenceList = []; + newObject: any; constructor() { this.navChange$ = new Observable(observer => @@ -103,6 +104,9 @@ export class MappingEditorService { saveLatestAction(data) { this.latestAction = data; } + selectedObj(data) { + this.newObject = data; + } saveLatestIdentifier(identifier) { this.identifier = identifier; @@ -589,4 +593,4 @@ export class MappingEditorService { } -} \ No newline at end of file +} diff --git a/src/app/shared/services/utilityService/utility.service.ts b/src/app/shared/services/utilityService/utility.service.ts index a683f33..8a9f945 100644 --- a/src/app/shared/services/utilityService/utility.service.ts +++ b/src/app/shared/services/utilityService/utility.service.ts @@ -30,6 +30,7 @@ import { appConstants } from '../../../../constants/app-constants'; @Injectable() export class UtilityService { + clName= "UtilityService"; public putAction = appConstants.messages.artifactUploadAction; public getAction = appConstants.messages.artifactgetAction; private retrievalSuccessMessage = appConstants.messages.retrievalSuccessMessage; @@ -44,6 +45,23 @@ export class UtilityService { constructor(private notificationService: NotificationsService) { } + public setTracelvl( tlvl: number ) { + // console.log( this.clName+": setTracelvl: arg="+tlvl ); + let tracelvl= tlvl; + if( tracelvl == null || tracelvl == undefined ) tracelvl= 0; + localStorage["Tracelvl"]= tracelvl; + } + + public getTracelvl() : number { + let tracelvl= localStorage["Tracelvl"]; + // console.log( this.clName+": getTracelvl: locS: tracelvl="+tracelvl ); + if( tracelvl == null || tracelvl == undefined ) { + tracelvl=0; localStorage["Tracelvl"]= tracelvl; + }; + // console.log( this.clName+": getTracelvl: tracelvl="+tracelvl ); + return tracelvl; + }; + public randomId() { let x = (new Date().getUTCMilliseconds()) * Math.random(); return (x + '').substr(4, 12); diff --git a/src/app/vnfs/build-artifacts/build-artifacts.component.ts b/src/app/vnfs/build-artifacts/build-artifacts.component.ts index ca45e61..095c239 100644 --- a/src/app/vnfs/build-artifacts/build-artifacts.component.ts +++ b/src/app/vnfs/build-artifacts/build-artifacts.component.ts @@ -28,6 +28,7 @@ import * as _ from 'underscore'; import { NotificationsService } from 'angular2-notifications'; import { appConstants } from '../../../constants/app-constants'; +export const ACTIONS_REQUIRED_DROPDOWN = ['Configure', 'ConfigModify', 'ConfigScaleOut']; @Component({ selector: 'app-build-design', templateUrl: './build-artifacts.component.html', styleUrls: ['./build-artifacts.component.css'] }) export class BuildDesignComponent implements OnInit { @@ -69,17 +70,33 @@ export class BuildDesignComponent implements OnInit { } } - public getRefData(referenceList) { + public getRefData( referenceList, reqObj?) { + console.log( "getRefData: start: referenceList.action:["+ + referenceList.action+"]"); this.refList = referenceList; - if (referenceList.action !== appConstants.Actions.blank && referenceList.scope['vnf-type'] !== '' && referenceList['device-protocol'] !== appConstants.DeviceProtocols.blank) { - if (referenceList.action === appConstants.Actions.configScaleOut) { - if (referenceList.hasOwnProperty('template-id') && referenceList['template-id'] !== undefined && referenceList['template-id'] != '') - this.refDataRequiredFiels = true; + if( referenceList.action !== '' && + referenceList.scope['vnf-type'] !== '' && + referenceList['device-protocol'] !== '' ) + { + if( ACTIONS_REQUIRED_DROPDOWN.indexOf(referenceList.action) > -1) + { + if( referenceList.action == 'ConfigScaleOut') + { + if( reqObj != undefined && reqObj.hasOwnProperty('reqField') && + reqObj.reqField != '' + ) + this.refDataRequiredFiels = true; + else + this.refDataRequiredFiels = false; } - else this.refDataRequiredFiels = true; + else + this.refDataRequiredFiels = true; + } + else + this.refDataRequiredFiels = true; } else { - this.refDataRequiredFiels = false; + this.refDataRequiredFiels = false; } } diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.html b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.html index bfe281b..799627b 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.html +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.html @@ -18,7 +18,6 @@ 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. -ECOMP is a trademark and service mark of AT&T Intellectual Property. ============LICENSE_END============================================ --> @@ -40,14 +39,17 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
+
+
+
+
- +
@@ -215,4 +217,4 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. - \ No newline at end of file + diff --git a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts index 19a5f6d..28c2a19 100644 --- a/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts +++ b/src/app/vnfs/build-artifacts/parameter-definitions/parameter.component.ts @@ -106,7 +106,7 @@ export class ParameterComponent implements OnInit { public appDataObject: any; public downloadDataObject: any; public artifact_fileName = ""; - identifier: any; + template_id: any; private selectedActionReference: any; constructor(private httpService: HttpUtilService, @@ -165,7 +165,7 @@ export class ParameterComponent implements OnInit { }; } - this.identifier = this.mappingEditorService.identifier; + this.template_id = this.mappingEditorService.identifier; } ngAfterViewInit() { diff --git a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html index ebcb9c0..6065e6d 100644 --- a/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html +++ b/src/app/vnfs/build-artifacts/reference-dataform/reference-dataform.component.html @@ -29,7 +29,7 @@ limitations under the License.
-
-
+ +
- + + + Add New VNFC Type +
+ +
@@ -58,11 +68,11 @@ limitations under the License.
- - Required Field +
@@ -141,7 +151,7 @@ limitations under the License.
- +
@@ -201,7 +211,7 @@ limitations under the License.
- + Required Field
@@ -298,6 +308,26 @@ limitations under the License.
+ + + + + + + +
+ + {{errorMessage}} +
+
+ +
+ + +
+
+
+