============LICENSE_START==========================================
===================================================================
Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+
+Modifications Copyright (C) 2019 TechMahindra
===================================================================
Unless otherwise specified, all software contained herein is licensed
{
path: 'resource-definition',
loadChildren: './feature-modules/resource-definition/resource-definition.module#ResourceDefinitionModule'
+ },
+ {
+ path: 'controller-catalog',
+ loadChildren: './feature-modules/controller-catalog/controller-catalog.module#ControllerCatalogModule'
}
]
}
============LICENSE_START==========================================
===================================================================
Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+
+Modifications Copyright (C) 2019 TechMahindra
===================================================================
Unless otherwise specified, all software contained herein is licensed
getSources: '/resourcedictionary/source-mapping',
getModelType: '/resourcedictionary/model-type',
getDataType: '/resourcedictionary/model-type/by-definition/data_type'
+}
+
+export const ControllerCatalogURLs = {
+ searchControllerCatalogByTags: '/controllercatalog/search',
+ saveControllerCatalog: '/controllercatalog/save',
+ getDefinition: '/controllercatalog/model-type/by-definition',
+ getDerivedFrom: '/controllercatalog/model-type/by-derivedfrom'
}
\ No newline at end of file
import { EffectsModule } from '@ngrx/effects';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
import { HttpClientModule } from '@angular/common/http';
-
import { appReducers } from './store/reducers/app.reducer';
import { BlueprintEffects } from './store/effects/blueprint.effects';
import { ResourcesEffects } from './store/effects/resources.effects';
import { ApiService } from './services/api.service';
import { NotificationHandlerService } from './services/notification-handler.service';
import { LoaderService } from './services/loader.service';
+import { CatalogEffects } from './store/effects/catalog.effect';
// import { BlueprintService } from './services/blueprint.service';
@NgModule({
imports: [
CommonModule,
StoreModule.forRoot(appReducers),
- EffectsModule.forRoot([BlueprintEffects, ResourcesEffects]),
+ EffectsModule.forRoot([BlueprintEffects, ResourcesEffects, CatalogEffects]),
StoreRouterConnectingModule.forRoot({ stateKey: 'router' }),
HttpClientModule
],
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { Injectable } from '@angular/core';
+import { Action, Store } from '@ngrx/store';
+import { ICatalog } from '../models/catalog.model';
+import { ICatalogState } from '../models/catalogState.model';
+
+export const LOAD_CATALOG = 'LOAD_CATALOG';
+export const LOAD_CATALOG_SUCCESS = 'LOAD_CATALOG_SUCCESS';
+export const LOAD_CATALOG_FAILURE = 'LOAD_CATALOG_FAILURE';
+export const UPDATE_CATALOG ='UPDATE_CATALOG';
+export const UPDATE_CATALOG_SUCCESS = 'UPDATE_CATALOG_SUCCESS';
+export const UPDATE_CATALOG_FAILURE = 'UPDATE_CATALOG_FAILURE';
+export const SAVE_CATALOG = 'SAVE_CATALOG';
+export const SAVE_CATALOG_SUCCESS = 'SAVE_CATALOG_SUCCESS';
+export const SAVE_CATALOG_FAILURE = 'SAVE_CATALOG_FAILURE';
+
+export const SET_CATALOG = 'SET CATALOG';
+export const REMOVE_CATALOG = 'Remove CATALOG';
+
+export const SET_CATALOG_STATE = 'SET CATALOG state';
+
+
+export class LoadCatalog implements Action {
+ readonly type = LOAD_CATALOG;
+ constructor(public startLoadSuccess?: boolean) {}
+}
+
+export class LoadCatalogSuccess implements Action {
+ readonly type = LOAD_CATALOG_SUCCESS;
+ constructor(public payload: ICatalog) {}
+}
+
+export class LoadCatalogFailure implements Action {
+ readonly type = LOAD_CATALOG_FAILURE;
+ constructor(public error: any) {}
+}
+
+export class SetCatalogState implements Action {
+ readonly type = SET_CATALOG_STATE;
+ constructor(public payload: ICatalogState) {}
+}
+
+// export class SetCatalog implements Action {
+// readonly type = SET_CATALOG;
+// constructor(public payload: Catalog) {}
+// }
+
+// export class RemoveCatalog implements Action {
+// readonly type = REMOVE_CATALOG;
+// constructor(public payload: Catalog) {}
+// }
+
+export class UpdateCatalog implements Action {
+ readonly type = UPDATE_CATALOG;
+ constructor(public payload: ICatalog) {}
+}
+
+export type Actions = LoadCatalog | LoadCatalogSuccess | LoadCatalogFailure | SetCatalogState;
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+import { Injectable } from '@angular/core';\r
+import { Effect, ofType, Actions } from '@ngrx/effects';\r
+import { Store, select } from '@ngrx/store';\r
+import { of } from 'rxjs';\r
+import { switchMap, map, withLatestFrom, catchError } from 'rxjs/operators';\r
+\r
+import { IAppState } from '../state/app.state';\r
+import * as CatalogActions from '../actions/catalog.action';\r
+\r
+@Injectable()\r
+export class CatalogEffects {\r
+\r
+ constructor(\r
+ private _actions$: Actions,\r
+ private _store: Store<IAppState>\r
+ ) {}\r
+}
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ICatalog } from './catalog.model';
+
+export interface ICatalogHttp {
+ catalog: ICatalog;
+}
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+export interface ICatalog { \r
+ Model_Name: string;\r
+ User_id: string;\r
+ _tags: string;\r
+ _type: string;\r
+ Derived_From: string;\r
+ _description : string;\r
+ definition: object[];\r
+}
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ICatalog } from './catalog.model';
+
+export interface ICatalogState {
+ catalog: ICatalog,
+ isLoadSuccess?: boolean;
+ isUpdateSuccess?: boolean;
+ isSaveSuccess?: boolean;
+}
\ No newline at end of file
import { ActionReducerMap } from '@ngrx/store';
import { routerReducer } from '@ngrx/router-store';
-
import { IAppState } from '../state/app.state';
import { blueprintReducer } from '../reducers/blueprint.reducer';
import { resourcesReducer } from '../reducers/resources.reducer';
+import { catalogReducer } from '../reducers/catalog.reducer';
export const appReducers: ActionReducerMap<IAppState, any> = {
router: routerReducer,
blueprint: blueprintReducer,
- resources:resourcesReducer
+ resources:resourcesReducer,
+ catalog: catalogReducer
};
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { Action } from '@ngrx/store';
+import { initialCatalogState } from '../state/catalog.state';
+import * as CatalogActions from '../actions/catalog.action';
+import { ICatalogState } from '../models/catalogState.model';
+
+export function catalogReducer(state: ICatalogState = initialCatalogState, action: CatalogActions.Actions) : ICatalogState {
+ switch(action.type) {
+ case CatalogActions.LOAD_CATALOG_SUCCESS:
+ return {...state,
+ catalog: action.payload
+ }
+ case CatalogActions.SET_CATALOG_STATE:
+ return {...state,
+ catalog: action.payload.catalog
+ }
+ default:
+ return state;
+ }
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { createSelector } from '@ngrx/store';
+
+import { IAppState } from '../state/app.state';
+import { ICatalogState } from '../models/catalogState.model';
+
+const selectCatalogFromAppState = (state: IAppState) => state.catalog;
+
+export const selectCatalog = createSelector(
+ selectCatalogFromAppState,
+ (state: ICatalogState) => state.catalog
+);
\ No newline at end of file
import { initialBlueprintState } from './blueprint.state';
import { IResourcesState } from '../models/resourcesState.model';
import { initialResourcesState } from './resources.state';
+import { ICatalogState } from '../models/catalogState.model';
+import { initialCatalogState } from './catalog.state';
export interface IAppState {
router? : RouterReducerState,
blueprint: IBlueprintState,
- resources: IResourcesState
+ resources: IResourcesState,
+ catalog: ICatalogState
}
-
export const initialAppState: IAppState = {
blueprint: initialBlueprintState,
- resources: initialResourcesState
+ resources: initialResourcesState,
+ catalog: initialCatalogState
}
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ICatalogState } from '../models/catalogState.model';
+import { ICatalog } from '../models/catalog.model';
+
+export const initialCatalogState : ICatalogState = {
+ catalog : {} as ICatalog,
+ isLoadSuccess: false,
+ isUpdateSuccess: false,
+ isSaveSuccess: false,
+}
\ No newline at end of file
<!-- ============LICENSE_START==========================================
===================================================================
Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+
+Modifications Copyright (C) 2019 TechMahindra
===================================================================
Unless otherwise specified, all software contained herein is licensed
</ul>
</nav> -->
<a mat-list-item [routerLink]="['/resource-definition']">Resource Definition</a>
+ <a mat-list-item [routerLink]="['/controller-catalog']">Controller Catalog</a>
</mat-nav-list>
</mat-sidenav>
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ControllerCatalogComponent } from './controller-catalog.component';
+import { Routes, RouterModule } from '@angular/router';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: ControllerCatalogComponent
+ }
+];
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class ControllerCatalogRoutingModule { }
--- /dev/null
+<!--/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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=========================================================
+*/-->
+
+<mat-card class="RDform">
+ <mat-card-content>
+ <mat-horizontal-stepper [linear]="isLinear" #stepper>
+ <mat-step [stepControl]="firstFormGroup">
+ <ng-template matStepLabel>Catalog Creation Method</ng-template>
+ <app-select-template (option)="selectedOption($event)"></app-select-template><br><br>
+ <div>
+ <button mat-button matStepperNext class="matStepNextBtn">Proceed</button>
+ </div>
+ </mat-step>
+ <mat-step [stepControl]="secondFormGroup">
+ <ng-template matStepLabel>Catalog Create/Search</ng-template>
+ <app-create-catalog *ngIf="selectedValue == 1"></app-create-catalog><br>
+ <app-search-catalog *ngIf="selectedValue == 2"></app-search-catalog><br>
+ <div>
+ <button mat-button matStepperPrevious class="matStepNextBtn">Back</button>
+ </div>
+ </mat-step>
+ </mat-horizontal-stepper>
+ </mat-card-content>
+</mat-card>
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+.mat-card {\r
+ padding: 0px !important;\r
+}\r
+\r
+.matStepNextBtn{\r
+ color:white;\r
+ background:#3f51b5;\r
+ margin-top: 10px;\r
+ position: absolute;\r
+ margin-bottom: 5px;\r
+ border-radius: 4px;\r
+}\r
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ControllerCatalogComponent } from './controller-catalog.component';
+
+describe('ControllerCatalogComponent', () => {
+ let component: ControllerCatalogComponent;
+ let fixture: ComponentFixture<ControllerCatalogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ControllerCatalogComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ControllerCatalogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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-controller-catalog',
+ templateUrl: './controller-catalog.component.html',
+ styleUrls: ['./controller-catalog.component.scss']
+})
+export class ControllerCatalogComponent implements OnInit {
+
+ selectedValue: any;
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+ selectedOption(value){
+ this.selectedValue=value;
+ console.log(this.selectedValue);
+ }
+
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { ControllerCatalogRoutingModule } from './controller-catalog-routing.module';
+import { ControllerCatalogComponent } from './controller-catalog.component';
+import { SharedModule } from '../../../app/common/shared/shared.module';
+import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule, MatAutocompleteModule} from '@angular/material';
+import { MatIconModule } from '@angular/material/icon';
+import { SelectTemplateComponent } from './select-template/select-template.component';
+import { TemplateOptionsComponent } from './select-template/template-options/template-options.component';
+import { SearchCatalogComponent } from './search-catalog/search-catalog.component';
+import { CreateCatalogComponent } from './create-catalog/create-catalog.component';
+import { CreateCatalogModule } from './create-catalog/create-catalog.module';
+import { SearchCatalogModule } from './search-catalog/search-catalog.module';
+import { FormsModule,ReactiveFormsModule } from '@angular/forms';
+import { NgJsonEditorModule } from 'ang-jsoneditor';
+
+@NgModule({
+ declarations: [ ControllerCatalogComponent, SelectTemplateComponent, TemplateOptionsComponent, SearchCatalogComponent, CreateCatalogComponent ],
+ imports: [
+ CommonModule,
+ ControllerCatalogRoutingModule,
+ CreateCatalogModule,
+ SearchCatalogModule,
+ SharedModule,
+ MatToolbarModule,
+ MatButtonModule,
+ MatSidenavModule,
+ MatIconModule,
+ MatListModule,
+ MatGridListModule,
+ MatCardModule,
+ MatMenuModule,
+ MatTableModule,
+ MatPaginatorModule,
+ MatSortModule,
+ MatInputModule,
+ MatSelectModule,
+ MatRadioModule,
+ MatFormFieldModule,
+ MatStepperModule,
+ MatAutocompleteModule,
+ FormsModule,
+ ReactiveFormsModule,
+ NgJsonEditorModule
+ ]
+})
+export class ControllerCatalogModule { }
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { RouterModule, Routes } from '@angular/router';
+import { CreateCatalogComponent } from './create-catalog.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: CreateCatalogComponent
+ }
+];
+@NgModule({
+imports: [RouterModule.forChild(routes)],
+exports: [RouterModule]
+})
+export class CreateCatalogRoutingModule { }
--- /dev/null
+<!--/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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=========================================================
+*/-->
+<mat-card class="ver-card">
+ <mat-card-header><div class="mat-card-header">Create Catalog</div>
+ </mat-card-header>
+ <mat-card-content>
+<form [formGroup]="CatalogFormData" (ngSubmit)="CreateCatalog()">
+ <mat-form-field class="form-field">
+ <input matInput placeholder="Model Name" formControlName="Model_Name">
+ </mat-form-field>
+ <mat-form-field class="form-field" >
+ <input matInput placeholder="User Id" formControlName="User_id">
+</mat-form-field>
+ <mat-form-field class="form-field">
+ <input matInput placeholder="Tags" formControlName="_tags">
+ </mat-form-field>
+ <mat-form-field class="form-field">
+ <mat-select matInput placeholder="Definition Type" formControlName="_type">
+ <mat-option [value]="item" *ngFor="let item of definitionType">{{item.definitionType}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ <mat-form-field class="form-field" >
+ <mat-select matInput placeholder="Derived From" formControlName="Derived_From">
+ <mat-option [value]="item" *ngFor="let item of derivedFrom">{{item.derivedFrom}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ <mat-form-field class="form-field" >
+ <textarea matInput placeholder="Description" formControlName="_description"></textarea>
+ </mat-form-field>
+ <br>
+ <div >
+ <json-editor placeholder="Definition" class="jsoneditor" [options]="options" [data]="resources" on-change="onChange($event)"></json-editor>
+ </div>
+ <div>
+ <button mat-button class="matStepNextBtn" type="submit">Save</button>
+ </div>
+</form>
+</mat-card-content>
+</mat-card>
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+.matStepNextBtn{\r
+ color:white;\r
+ background:#3f51b5;\r
+ margin-top: 10px;\r
+ position: absolute;\r
+ margin-bottom: 5px;\r
+ border-radius: 4px;\r
+}\r
+.meta-form {\r
+ width: 100%;\r
+}\r
+\r
+.form-field {\r
+ width: 40%;\r
+ padding:20px;\r
+}\r
+\r
+.form-table {\r
+ width: 100%;\r
+}\r
+.ver-card {\r
+ width: 100%; \r
+ background-color: #f1f1f1;\r
+ padding: 0.01em 16px;\r
+ margin: 20px 0;\r
+ box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;\r
+ height: 800px;\r
+ }\r
+ .mat-card-header{\r
+ height:35px; \r
+ padding-top: 4px;\r
+ }\r
+ .mat-card-content{\r
+ width: auto;\r
+ background-color: #fff;\r
+ padding: 8px 8px;\r
+ // border-left: 4px solid #4CAF50;\r
+ word-wrap: break-word;\r
+ min-height:350px;\r
+ height: auto;\r
+ }
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { CreateCatalogComponent } from './create-catalog.component';
+
+describe('CreateCatalogComponent', () => {
+ let component: CreateCatalogComponent;
+ let fixture: ComponentFixture<CreateCatalogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateCatalogComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateCatalogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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, ViewChild, ɵConsole } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { JsonEditorComponent, JsonEditorOptions } from 'ang-jsoneditor';
+import { Observable } from 'rxjs';
+import { ICatalogState } from 'src/app/common/core/store/models/catalogState.model';
+import { ICatalog } from 'src/app/common/core/store/models/catalog.model';
+import { Store } from '@ngrx/store';
+import { IAppState } from 'src/app/common/core/store/state/app.state';
+import { SetCatalogState } from 'src/app/common/core/store/actions/catalog.action';
+import { CreateCatalogService } from './create-catalog.service';
+import { NotificationHandlerService } from 'src/app/common/core/services/notification-handler.service';
+
+@Component({
+ selector: 'app-create-catalog',
+ templateUrl: './create-catalog.component.html',
+ styleUrls: ['./create-catalog.component.scss']
+})
+export class CreateCatalogComponent implements OnInit {
+
+ CatalogFormData: FormGroup;
+ @ViewChild(JsonEditorComponent) editor: JsonEditorComponent;
+ options = new JsonEditorOptions();
+ data:any;
+ derivedFrom: any[] = [{derivedFrom: 'tosca.nodes.Component'},{derivedFrom:'tosca.nodes.VNF'},{derivedFrom:'tosca.nodes.Artifact'},{derivedFrom:'tosca.nodes.ResourceSource'}, {derivedFrom:'tosca.nodes.Workflow'},{derivedFrom:'tosca.nodes.Root'}];
+ definitionType: any[] = [{definitionType: 'node_type'}];
+ ccState: Observable<ICatalogState>;
+ catalog: ICatalog;
+
+ constructor(private formBuilder: FormBuilder, private store: Store<IAppState>, private catalogCreateService: CreateCatalogService, private alertService: NotificationHandlerService) {
+ this.ccState = this.store.select('catalog');
+ this.CatalogFormData = this.formBuilder.group({
+ Model_Name: ['', Validators.required],
+ User_id: ['', Validators.required],
+ _tags: ['', Validators.required],
+ _type: ['', Validators.required],
+ Derived_From: ['', Validators.required],
+ _description : ['', Validators.required]
+ });
+ }
+ ngOnInit() {
+ this.options.mode = 'text';
+ this.options.modes = [ 'text', 'tree', 'view'];
+ this.options.statusBar = false;
+
+ this.ccState.subscribe(
+ catalogdata => {
+ var catalogState: ICatalogState = { catalog: catalogdata.catalog, isLoadSuccess: catalogdata.isLoadSuccess, isSaveSuccess: catalogdata.isSaveSuccess, isUpdateSuccess: catalogdata.isUpdateSuccess };
+ this.catalog = catalogState.catalog;
+ console.log( this.catalog );
+ });
+
+// this.catalogCreateService.getDefinition()
+// .subscribe(data=>{
+// console.log(data);
+// data.forEach(element => {
+// this.definitionType.push(element)
+// });
+// }, error=>{
+// window.alert('error' + error);
+// })
+//
+// this.catalogCreateService.getDerivedFrom()
+// .subscribe(data=>{
+// console.log(data);
+// data.forEach(element => {
+// this.derivedFrom.push(element)
+// });
+// }, error=>{
+// window.alert('error' + error);
+// })
+ }
+ CreateCatalog(){
+ this.catalog = Object.assign({}, this.CatalogFormData.value);
+ this.catalog.definition=this.data;
+ let catalogState = {
+ catalog: this.catalog
+ }
+ this.store.dispatch(new SetCatalogState(catalogState));
+
+ this.catalogCreateService.saveCatalog(this.catalog)
+ .subscribe(response=>{
+ this.alertService.success("save success")
+ },
+ error=>{
+ this.alertService.error('Error saving resources');
+ })
+
+ }
+
+ onChange($event) {
+ this.data=JSON.parse($event.srcElement.value);
+ console.log(this.data);
+ };
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { CreateCatalogRoutingModule } from './create-catalog-routing.module';
+import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material';
+import { MatIconModule } from '@angular/material/icon';
+import { SharedModule } from 'src/app/common/shared/shared.module';
+import { NgJsonEditorModule } from 'ang-jsoneditor';
+import { CreateCatalogService } from './create-catalog.service';
+
+@NgModule({
+ declarations: [],
+ imports: [
+ CommonModule,
+ CreateCatalogRoutingModule,
+ SharedModule,
+ MatToolbarModule,
+ MatButtonModule,
+ MatSidenavModule,
+ MatIconModule,
+ MatListModule,
+ MatGridListModule,
+ MatCardModule,
+ MatMenuModule,
+ MatTableModule,
+ MatPaginatorModule,
+ MatSortModule,
+ MatInputModule,
+ MatSelectModule,
+ MatRadioModule,
+ MatFormFieldModule,
+ MatStepperModule,
+ NgJsonEditorModule
+ ],
+ providers: [ CreateCatalogService ]
+})
+
+export class CreateCatalogModule { }
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { ApiService } from 'src/app/common/core/services/api.service';
+import { ControllerCatalogURLs } from 'src/app/common/constants/app-constants';
+
+@Injectable()
+export class CreateCatalogService {
+
+
+ constructor(private _http: HttpClient, private api: ApiService) {
+ }
+
+ saveCatalog(catalog) {
+ return this.api.post(ControllerCatalogURLs.saveControllerCatalog, catalog);
+ }
+
+ getDefinition() {
+ return this.api.get(ControllerCatalogURLs.getDefinition);
+ }
+ getDerivedFrom() {
+ return this.api.get(ControllerCatalogURLs.getDerivedFrom);
+ }
+}
+
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { RouterModule, Routes } from '@angular/router';
+import { SearchCatalogComponent } from './search-catalog.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: SearchCatalogComponent
+ }
+];
+@NgModule({
+imports: [RouterModule.forChild(routes)],
+exports: [RouterModule]
+})
+export class SearchCatalogRoutingModule { }
--- /dev/null
+<!-- /*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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=========================================================
+*/-->
+<form class="search-form" [formGroup]="myControl">
+ <mat-form-field class="search-full-width">
+ <input matInput type="text" [(ngModel)]="searchText" placeholder="Search Resources" formControlName="search_input">
+ <button matSuffix mat-icon-button (click)="fetchCatalogByName()">
+ <mat-icon>search</mat-icon>
+ </button>
+ </mat-form-field>
+</form>
+<div class="searchcontainer">
+ <div class="flexBox">
+ <div *ngFor="let option of options" style="position: relative !important;width:20% !important">
+ <mat-card class="example-card">
+ <mat-card-content class="card-content">
+ {{option.modelName}}
+ </mat-card-content>
+ <mat-card-actions class="flexBox">
+ <button matStepperNext mat-menu-item (click)="editInfo(option.blueprintModel.artifactName,option.blueprintModel.artifactVersion,3)">Info</button>
+ </mat-card-actions>
+ </mat-card>
+ </div>
+ </div>
+</div>
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+\r
+.example-card {\r
+ // min-width: 300px;\r
+ max-height: 200px;\r
+ background-color: #ebebeb;\r
+ position: relative;\r
+ width: 250px;\r
+ margin: 5px;\r
+}\r
+\r
+.mat-grid-tile {\r
+ position: absolute;\r
+ width: 240px !important;\r
+}\r
+\r
+.mat-grid-list div {\r
+ position: relative;\r
+}\r
+\r
+button.mat-menu-item {\r
+ width: auto;\r
+ float: left;\r
+ border-radius: 4px;\r
+ background-color: #3f51b5;\r
+ margin: 5px;\r
+ cursor: pointer;\r
+ color: white;\r
+}\r
+\r
+.flexBox {\r
+ display: flex;\r
+ flex-flow: row;\r
+ flex-wrap: wrap;\r
+}\r
+\r
+.card-deck-container {\r
+ position: relative;\r
+ border-radius: 1px;\r
+ padding: 2px;\r
+ margin: 2px;\r
+ // background-color: #f5f5f5;\r
+}\r
+\r
+.searchcontainer {\r
+ // min-height: 300px;\r
+ overflow-x: hidden;\r
+ overflow-y: scroll;\r
+}\r
+\r
+.card-content {\r
+ text-align: center;\r
+ margin: 5px;\r
+}\r
+\r
+.mat-card-actions {\r
+ margin-left: 0px !important;\r
+ margin-right: 0px !important;\r
+ padding: 0px 0 !important;\r
+}
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { SearchCatalogComponent } from './search-catalog.component';
+
+describe('SearchCatalogComponent', () => {
+ let component: SearchCatalogComponent;
+ let fixture: ComponentFixture<SearchCatalogComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SearchCatalogComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SearchCatalogComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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, ViewChild } from '@angular/core';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { SearchCatalogService } from './search-catalog.service';
+import { MatAutocompleteTrigger } from '@angular/material';
+
+@Component({
+ selector: 'app-search-catalog',
+ templateUrl: './search-catalog.component.html',
+ styleUrls: ['./search-catalog.component.scss']
+})
+export class SearchCatalogComponent implements OnInit {
+ myControl: FormGroup;
+ searchText: string = '';
+ options: any[] = [];
+ @ViewChild('catalogSelect', { read: MatAutocompleteTrigger }) catalogSelect: MatAutocompleteTrigger;
+ constructor(private _formBuilder: FormBuilder, private searchCatalogService: SearchCatalogService) { }
+
+ ngOnInit() {
+ this.myControl = this._formBuilder.group({
+ search_input: ['', Validators.required]
+ });
+ }
+ fetchCatalogByName() {
+ this.searchCatalogService.searchByTags(this.searchText)
+ .subscribe(data=>{
+ console.log(data);
+ data.forEach(element => {
+ this.options.push(element)
+ });
+ this.catalogSelect.openPanel();
+ }, error=>{
+ window.alert('Catalog not matching the search tag' + error);
+ })
+ }
+
+ editInfo(artifactName: string, artifactVersion: string, option: string) {
+ }
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { SearchCatalogRoutingModule } from './search-catalog-routing.module';
+import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule, MatAutocompleteModule} from '@angular/material';
+import { MatIconModule } from '@angular/material/icon';
+import { SharedModule } from 'src/app/common/shared/shared.module';
+import { FormsModule,ReactiveFormsModule } from '@angular/forms';
+import { SearchCatalogService } from './search-catalog.service';
+
+@NgModule({
+ declarations: [],
+ imports: [
+ CommonModule,
+ SearchCatalogRoutingModule,
+ FormsModule,
+ ReactiveFormsModule,
+ SharedModule,
+ MatToolbarModule,
+ MatButtonModule,
+ MatSidenavModule,
+ MatIconModule,
+ MatListModule,
+ MatGridListModule,
+ MatCardModule,
+ MatMenuModule,
+ MatTableModule,
+ MatPaginatorModule,
+ MatSortModule,
+ MatInputModule,
+ MatSelectModule,
+ MatRadioModule,
+ MatFormFieldModule,
+ MatStepperModule,
+ MatAutocompleteModule
+ ],
+ providers: [ SearchCatalogService ]
+})
+export class SearchCatalogModule { }
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { Observable, observable } from 'rxjs';
+import { ControllerCatalogURLs } from 'src/app/common/constants/app-constants';
+import { ApiService } from 'src/app/common/core/services/api.service';
+
+@Injectable()
+export class SearchCatalogService {
+
+ constructor(private _http: HttpClient, private api: ApiService) {
+ }
+
+ searchByTags(tag) {
+ return this.api.get(ControllerCatalogURLs.searchControllerCatalogByTags + '/' + tag);
+ }
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { SelectTemplateComponent } from './select-template.component';
+import { TemplateOptionsComponent } from './template-options/template-options.component';
+
+const routes: Routes = [
+ {
+ path: '',
+ component: SelectTemplateComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+
+export class SelectTemplateRoutingModule { }
--- /dev/null
+<!--/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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=========================================================
+*/-->
+
+<mat-card class="ver-card">
+<mat-card-header>
+</mat-card-header>
+<mat-card-content>
+<mat-vertical-stepper linear>
+ <mat-step [stepControl]="step1FormGroup">
+ <ng-template matStepLabel>Choose Option</ng-template>
+ <br>
+ <app-template-options (option)="selectedOption($event)"></app-template-options>
+ </mat-step>
+ </mat-vertical-stepper>
+ </mat-card-content>
+</mat-card>
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/\r
+.matStepNextBtn{\r
+ color:white;\r
+ background:#3f51b5; \r
+ margin-top: 10px; \r
+ position: absolute;\r
+ border-radius: 4px;\r
+}\r
+.ver-card {\r
+ width: 100%; \r
+ background-color: #f1f1f1;\r
+ padding: 0.01em 16px;\r
+ margin: 20px 0;\r
+ box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;\r
+ height: auto;\r
+}\r
+.mat-card-header{\r
+ height:35px;\r
+}\r
+.mat-card-content{\r
+ width: auto;\r
+ background-color: #fff;\r
+ padding: 8px 8px;\r
+ // border-left: 4px solid #4CAF50;\r
+ word-wrap: break-word;\r
+ min-height:350px;\r
+ height: auto;\r
+}\r
+.success{\r
+color:green;\r
+}\r
+.comp-disabled {\r
+ display: none;\r
+}
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { SelectTemplateComponent } from './select-template.component';
+
+describe('SelectTemplateComponent', () => {
+ let component: SelectTemplateComponent;
+ let fixture: ComponentFixture<SelectTemplateComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ SelectTemplateComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(SelectTemplateComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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, Output, EventEmitter } from '@angular/core';
+
+@Component({
+ selector: 'app-select-template',
+ templateUrl: './select-template.component.html',
+ styleUrls: ['./select-template.component.scss']
+})
+export class SelectTemplateComponent implements OnInit {
+
+ selectedValue: any;
+ @Output() option = new EventEmitter();
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+ selectedOption(value){
+ this.selectedValue=value;
+ this.option.emit(value);
+ }
+
+}
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { TemplateOptionsComponent } from './template-options/template-options.component';
+import { SelectTemplateComponent } from './select-template.component';
+import { SelectTemplateRoutingModule } from './select-template-routing.module';
+import { AppMaterialModule } from 'src/app/common/modules/app-material.module';
+import { MatAutocompleteModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule, MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material';
+import { SharedModule } from '../../../../app/common/shared/shared.module';
+import { FormsModule,ReactiveFormsModule } from '@angular/forms';
+
+@NgModule({
+ declarations: [
+ TemplateOptionsComponent,
+ SelectTemplateComponent
+ ],
+ exports: [
+ TemplateOptionsComponent,
+ SelectTemplateComponent
+ ],
+ imports: [
+ CommonModule,
+ SelectTemplateRoutingModule,
+ ReactiveFormsModule,
+ AppMaterialModule,
+ FormsModule,
+ ReactiveFormsModule,
+ MatToolbarModule,
+ MatIconModule,
+ MatButtonModule,
+ MatSidenavModule,
+ MatCheckboxModule,
+ MatListModule,
+ MatGridListModule,
+ MatCardModule,
+ MatMenuModule,
+ MatTableModule,
+ MatPaginatorModule,
+ MatSortModule,
+ MatInputModule,
+ MatSelectModule,
+ MatRadioModule,
+ MatFormFieldModule,
+ MatStepperModule,
+ MatAutocompleteModule
+ ],
+ providers: [
+ ]
+})
+export class SelectTemplateModule { }
--- /dev/null
+<!--/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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=========================================================
+*/-->
+
+<mat-radio-group>
+ <mat-radio-button value="1" (click)="selected(1)">Create New Catalog</mat-radio-button><br><br>
+ <mat-radio-button value="2" (click)="selected(2)">Search existing catalog</mat-radio-button><br><br>
+</mat-radio-group>
\ No newline at end of file
--- /dev/null
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright (C) 2019 TechMahindra\r
+*=================================================================================\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ============LICENSE_END=========================================================\r
+*/
\ No newline at end of file
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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 { TemplateOptionsComponent } from './template-options.component';
+
+describe('TemplateOptionsComponent', () => {
+ let component: TemplateOptionsComponent;
+ let fixture: ComponentFixture<TemplateOptionsComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TemplateOptionsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TemplateOptionsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+/*
+* ============LICENSE_START=======================================================
+* ONAP : CDS
+* ================================================================================
+* Copyright (C) 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, Output, EventEmitter } from '@angular/core';
+
+@Component({
+ selector: 'app-template-options',
+ templateUrl: './template-options.component.html',
+ styleUrls: ['./template-options.component.scss']
+})
+export class TemplateOptionsComponent implements OnInit {
+
+ @Output() option = new EventEmitter();
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+ selected(value){
+ this.option.emit(value);
+ }
+}