Migrate "components" from ccsdk/apps
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Fri, 22 Mar 2019 17:35:38 +0000 (10:35 -0700)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Fri, 22 Mar 2019 17:36:17 +0000 (10:36 -0700)
Migrate code from ccsdk/apps components
subfolder into ccsdk/cds

Issue-ID: CIMAN-245
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
236 files changed:
.gitignore [new file with mode: 0644]
.gitreview [new file with mode: 0644]
INFO.yaml [new file with mode: 0644]
TagVersion.groovy [new file with mode: 0644]
cds-ui/.dockerignore [new file with mode: 0644]
cds-ui/Dockerfile [new file with mode: 0644]
cds-ui/client/.editorconfig [new file with mode: 0644]
cds-ui/client/LICENSE.txt [new file with mode: 0644]
cds-ui/client/README.md [new file with mode: 0644]
cds-ui/client/angular.json [new file with mode: 0644]
cds-ui/client/package.json [new file with mode: 0644]
cds-ui/client/pom.xml [new file with mode: 0644]
cds-ui/client/src/app/app-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/app.component.html [new file with mode: 0644]
cds-ui/client/src/app/app.component.scss [new file with mode: 0644]
cds-ui/client/src/app/app.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/app.component.ts [new file with mode: 0644]
cds-ui/client/src/app/app.module.ts [new file with mode: 0644]
cds-ui/client/src/app/common/constants/app-constants.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/core/core.module.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/services/api.service.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/actions/resources.action.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/effects/blueprint.effects.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/effects/resources.effects.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/blueprint-http.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/blueprint.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/entrySchema.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/imports.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/itopologytemplate.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/metadata.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/propertyData.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/resources-http.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/resources.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/models/sourcesData.model.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/reducers/app.reducer.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/selectors/blueprint.selectors.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/selectors/resources.selectors.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/state/app.state.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/state/blueprint.state.ts [new file with mode: 0644]
cds-ui/client/src/app/common/core/store/state/resources.state.ts [new file with mode: 0644]
cds-ui/client/src/app/common/modules/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/modules/app-material.module.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.html [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.scss [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/header/header.component.html [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/header/header.component.scss [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/header/header.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/header/header.component.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/home/home.component.html [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/home/home.component.scss [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/home/home.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/components/home/home.component.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/directives/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/shared/pipes/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/shared/pipes/search.pipe.ts [new file with mode: 0644]
cds-ui/client/src/app/common/shared/shared.module.ts [new file with mode: 0644]
cds-ui/client/src/app/common/utility/README.md [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/blueprint.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/README.md [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit-routing.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.module.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.scss [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.spec.ts [new file with mode: 0644]
cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.ts [new file with mode: 0644]
cds-ui/client/src/assets/.gitkeep [new file with mode: 0644]
cds-ui/client/src/assets/activation-blueprint.json [new file with mode: 0644]
cds-ui/client/src/assets/sample-licenses.json [new file with mode: 0644]
cds-ui/client/src/browserslist [new file with mode: 0644]
cds-ui/client/src/environments/environment.dev.ts [new file with mode: 0644]
cds-ui/client/src/environments/environment.prod.ts [new file with mode: 0644]
cds-ui/client/src/environments/environment.ts [new file with mode: 0644]
cds-ui/client/src/index.html [new file with mode: 0644]
cds-ui/client/src/karma.conf.js [new file with mode: 0644]
cds-ui/client/src/main.ts [new file with mode: 0644]
cds-ui/client/src/polyfills.ts [new file with mode: 0644]
cds-ui/client/src/styles.scss [new file with mode: 0644]
cds-ui/client/src/tsconfig.app.json [new file with mode: 0644]
cds-ui/client/src/tsconfig.spec.json [new file with mode: 0644]
cds-ui/client/src/tslint.json [new file with mode: 0644]
cds-ui/client/tsconfig.json [new file with mode: 0644]
cds-ui/common/README.md [new file with mode: 0644]
cds-ui/server/.npmrc [new file with mode: 0644]
cds-ui/server/.prettierignore [new file with mode: 0644]
cds-ui/server/.prettierrc [new file with mode: 0644]
cds-ui/server/.yo-rc.json [new file with mode: 0644]
cds-ui/server/README.md [new file with mode: 0644]
cds-ui/server/index.js [new file with mode: 0644]
cds-ui/server/index.ts [new file with mode: 0644]
cds-ui/server/package.json [new file with mode: 0644]
cds-ui/server/pom.xml [new file with mode: 0644]
cds-ui/server/public/index.html [new file with mode: 0644]
cds-ui/server/src/application.ts [new file with mode: 0644]
cds-ui/server/src/controllers/README.md [new file with mode: 0644]
cds-ui/server/src/controllers/blueprint-rest.controller.ts [new file with mode: 0644]
cds-ui/server/src/controllers/index.ts [new file with mode: 0644]
cds-ui/server/src/controllers/ping.controller.ts [new file with mode: 0644]
cds-ui/server/src/datasources/README.md [new file with mode: 0644]
cds-ui/server/src/datasources/db.datasource.json [new file with mode: 0644]
cds-ui/server/src/datasources/db.datasource.ts [new file with mode: 0644]
cds-ui/server/src/datasources/index.ts [new file with mode: 0644]
cds-ui/server/src/datasources/rest.config.json [new file with mode: 0644]
cds-ui/server/src/datasources/rest.datasource.ts [new file with mode: 0644]
cds-ui/server/src/index.ts [new file with mode: 0644]
cds-ui/server/src/migrate.ts [new file with mode: 0644]
cds-ui/server/src/models/README.md [new file with mode: 0644]
cds-ui/server/src/models/blueprint.model.ts [new file with mode: 0644]
cds-ui/server/src/models/index.ts [new file with mode: 0644]
cds-ui/server/src/repositories/README.md [new file with mode: 0644]
cds-ui/server/src/repositories/blueprint.repository.ts [new file with mode: 0644]
cds-ui/server/src/repositories/index.ts [new file with mode: 0644]
cds-ui/server/src/sequence.ts [new file with mode: 0644]
cds-ui/server/src/services/rest.service.ts [new file with mode: 0644]
cds-ui/server/tsconfig.json [new file with mode: 0644]
cds-ui/server/tslint.build.json [new file with mode: 0644]
cds-ui/server/tslint.json [new file with mode: 0644]
docs/CBA/CDS_Architecture_Design.pptx [new file with mode: 0644]
docs/CBA/index.rst [new file with mode: 0644]
docs/CBA/media/CDS_architecture.jpg [new file with mode: 0644]
docs/CBA/media/image0.PNG [new file with mode: 0644]
docs/CBA/media/image0.jpg [new file with mode: 0644]
docs/CBA/media/image1.PNG [new file with mode: 0644]
docs/CBA/media/image1.jpg [new file with mode: 0644]
docs/CBA/media/image2.PNG [new file with mode: 0644]
docs/CBA/media/image2.jpg [new file with mode: 0644]
docs/CBA/resourceassignment.rst [new file with mode: 0644]
docs/datadictionary/index.rst [new file with mode: 0644]
docs/index.rst [new file with mode: 0644]
docs/logging.rst [new file with mode: 0644]
docs/release-notes.rst [new file with mode: 0644]
pom.xml [new file with mode: 0644]
version.properties [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..398da37
--- /dev/null
@@ -0,0 +1,82 @@
+# Node.js
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+dist/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+.env.test
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
diff --git a/.gitreview b/.gitreview
new file mode 100644 (file)
index 0000000..70f5665
--- /dev/null
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.onap.org
+port=29418
+project=ccsdk/cds.git
diff --git a/INFO.yaml b/INFO.yaml
new file mode 100644 (file)
index 0000000..080086d
--- /dev/null
+++ b/INFO.yaml
@@ -0,0 +1,71 @@
+---
+project: 'ccsdk-cds'
+project_creation_date: '2018-07-16'
+lifecycle_state: 'Incubation'
+project_category: ''
+project_lead: &onap_releng_ptl
+    name: 'Dan Timoney'
+    email: 'dtimoney@att.com'
+    id: 'djtimoney'
+    company: 'ATT'
+    timezone: 'America/New York'
+primary_contact: *onap_releng_ptl
+issue_tracking:
+    type: 'jira'
+    url: 'https://jira.onap.org/projects/CCSDK'
+    key: 'CCDSK'
+mailing_list:
+    type: 'groups.io'
+    url: 'lists.onap.org'
+    tag: '<[sub-project_name]>'
+realtime_discussion: ''
+meetings:
+    - type: 'zoom'
+      agenda: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project'
+      url: 'https://wiki.onap.org/display/DW/Common+Controller+SDK+Project#CommonControllerSDKProject-MeetingMinutes'
+      server: 'n/a'
+      channel: 'n/a'
+      repeats: 'weekly'
+      time: '13:00 UTC'
+committers:
+    - <<: *onap_releng_ptl
+    - name: 'Jack Lucas'
+      email: 'jflucas@research.att.com'
+      company: 'ATT'
+      id: 'jackl'
+      timezone: 'America/New York'
+    - name: 'Jun (Nicolas) Hu'
+      email: 'jh245g@att.com'
+      company: 'ATT'
+      id: 'jh245g'
+      timezone: 'America/New York'
+    - name: 'Gaurav Agrawal'
+      email: 'gaurav.agrawal@huawei.com'
+      company: 'Huawei'
+      id: 'agrawalgaurav'
+      timezone: 'Asia/Kolkata'
+repositories:
+    - ccsdk-apps
+    - ccsdk-cds
+    - ccsdk-distribution
+    - ccsdk-features
+    - ccsdk-parent
+    - ccsdk-platform-blueprints
+    - ccsdk-platform-plugins
+    - ccsdk-sli-adaptors
+    - ccsdk-sli-core
+    - ccsdk-sli-northbound
+    - ccsdk-sli-plugins
+    - ccsdk-storage-esaas
+    - ccsdk-utils
+tsc:
+    approval: 'https://lists.onap.org/pipermail/onap-tsc'
+    changes:
+        - type: 'Deletion'
+          name: 'Ryan Goulding'
+          link: 'https://lists.onap.org/g/onap-tsc/message/4261'
+    changes:
+        - type: 'Addition'
+          name: 'Gaurav Agrawal'
+          link: 'https://lists.onap.org/g/onap-tsc/message/4324'
+
diff --git a/TagVersion.groovy b/TagVersion.groovy
new file mode 100644 (file)
index 0000000..68a8b78
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CCSDK
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ *                             reserved.
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ *
+ */
+
+package org.onap.ccsdk.distribution
+
+
+def versionArray;
+if ( project.properties['ccsdk.project.version'] != null ) {
+       versionArray = project.properties['ccsdk.project.version'].split('\\.');
+}
+
+if ( project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT") ) {
+       patchArray = versionArray[2].split('-');
+       project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest";
+       project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-latest";
+       project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-"+project.properties['ccsdk.build.timestamp'];
+} else {
+       project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest";
+       project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-latest";
+       project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-"+project.properties['ccsdk.build.timestamp'];
+}
diff --git a/cds-ui/.dockerignore b/cds-ui/.dockerignore
new file mode 100644 (file)
index 0000000..00137e3
--- /dev/null
@@ -0,0 +1,85 @@
+# editor config
+.editorconfig
+
+# Node.js
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+client/node_modules/
+client/jspm_packages/
+client/dist/
+
+# TypeScript v1 declaration files
+typings/
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+.env.test
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# next.js build output
+.next
+
+# nuxt.js build output
+.nuxt
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
diff --git a/cds-ui/Dockerfile b/cds-ui/Dockerfile
new file mode 100644 (file)
index 0000000..5bf65f4
--- /dev/null
@@ -0,0 +1,35 @@
+# 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" ]
diff --git a/cds-ui/client/.editorconfig b/cds-ui/client/.editorconfig
new file mode 100644 (file)
index 0000000..e89330a
--- /dev/null
@@ -0,0 +1,13 @@
+# Editor configuration, see https://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = off
+trim_trailing_whitespace = false
diff --git a/cds-ui/client/LICENSE.txt b/cds-ui/client/LICENSE.txt
new file mode 100644 (file)
index 0000000..b498ede
--- /dev/null
@@ -0,0 +1,20 @@
+============LICENSE_START==========================================
+ONAP : CCSDK-CDS
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
diff --git a/cds-ui/client/README.md b/cds-ui/client/README.md
new file mode 100644 (file)
index 0000000..8af8748
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# CdsUi
+
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.1.0.
+
+## Development server
+
+Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
+
+## Code scaffolding
+
+Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
+
+## Build
+
+Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
+
+## Running unit tests
+
+Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
+
+## Running end-to-end tests
+
+Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
+
+## Further help
+
+To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
diff --git a/cds-ui/client/angular.json b/cds-ui/client/angular.json
new file mode 100644 (file)
index 0000000..96b4df0
--- /dev/null
@@ -0,0 +1,149 @@
+{
+    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
+    "version": 1,
+    "newProjectRoot": "projects",
+    "projects": {
+        "cds-ui": {
+            "root": "",
+            "sourceRoot": "src",
+            "projectType": "application",
+            "prefix": "app",
+            "schematics": {
+                "@schematics/angular:component": {
+                    "styleext": "scss"
+                }
+            },
+            "architect": {
+                "build": {
+                    "builder": "@angular-devkit/build-angular:browser",
+                    "options": {
+                        "outputPath": "../server/public",
+                        "index": "src/index.html",
+                        "main": "src/main.ts",
+                        "polyfills": "src/polyfills.ts",
+                        "tsConfig": "src/tsconfig.app.json",
+                        "assets": [
+                            "src/favicon.ico",
+                            "src/assets"
+                        ],
+                        "styles": [
+                            "src/styles.scss",
+                            "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
+                            "./node_modules/material-design-icons/iconfont/material-icons.css",
+                            "./node_modules/font-awesome/css/font-awesome.css"
+                        ],
+                        "scripts": [
+                            "./node_modules/ace-builds/src-min/ace.js",
+                            "./node_modules/ace-builds/src-min/theme-eclipse.js",
+                            "./node_modules/ace-builds/src-min/mode-json.js",
+                            "./node_modules/ace-builds/src-min/mode-javascript.js",
+                            "./node_modules/ace-builds/src-min/mode-python.js",
+                            "./node_modules/ace-builds/src-min/mode-xml.js",
+                            "./node_modules/ace-builds/src-min/mode-kotlin.js",
+                            "./node_modules/ace-builds/src-min/mode-text.js",
+                            "./node_modules/ace-builds/src-min/mode-velocity.js",
+                            "./node_modules/ace-builds/src-min/mode-yaml.js"
+                        ]
+                    },
+                    "configurations": {
+                        "production": {
+                            "fileReplacements": [{
+                                "replace": "src/environments/environment.ts",
+                                "with": "src/environments/environment.prod.ts"
+                            }],
+                            "optimization": true,
+                            "outputHashing": "all",
+                            "sourceMap": false,
+                            "extractCss": true,
+                            "namedChunks": false,
+                            "aot": true,
+                            "extractLicenses": true,
+                            "vendorChunk": false,
+                            "buildOptimizer": true,
+                            "budgets": [{
+                                "type": "initial",
+                                "maximumWarning": "2mb",
+                                "maximumError": "5mb"
+                            }]
+                        }
+                    }
+                },
+                "serve": {
+                    "builder": "@angular-devkit/build-angular:dev-server",
+                    "options": {
+                        "browserTarget": "cds-ui:build"
+                    },
+                    "configurations": {
+                        "production": {
+                            "browserTarget": "cds-ui:build:production"
+                        }
+                    }
+                },
+                "extract-i18n": {
+                    "builder": "@angular-devkit/build-angular:extract-i18n",
+                    "options": {
+                        "browserTarget": "cds-ui:build"
+                    }
+                },
+                "test": {
+                    "builder": "@angular-devkit/build-angular:karma",
+                    "options": {
+                        "main": "src/test.ts",
+                        "polyfills": "src/polyfills.ts",
+                        "tsConfig": "src/tsconfig.spec.json",
+                        "karmaConfig": "src/karma.conf.js",
+                        "styles": [
+                            "src/styles.scss"
+                        ],
+                        "scripts": [],
+                        "assets": [
+                            "src/favicon.ico",
+                            "src/assets"
+                        ]
+                    }
+                },
+                "lint": {
+                    "builder": "@angular-devkit/build-angular:tslint",
+                    "options": {
+                        "tsConfig": [
+                            "src/tsconfig.app.json",
+                            "src/tsconfig.spec.json"
+                        ],
+                        "exclude": [
+                            "**/node_modules/**"
+                        ]
+                    }
+                }
+            }
+        },
+        "cds-ui-e2e": {
+            "root": "e2e/",
+            "projectType": "application",
+            "prefix": "",
+            "architect": {
+                "e2e": {
+                    "builder": "@angular-devkit/build-angular:protractor",
+                    "options": {
+                        "protractorConfig": "e2e/protractor.conf.js",
+                        "devServerTarget": "cds-ui:serve"
+                    },
+                    "configurations": {
+                        "production": {
+                            "devServerTarget": "cds-ui:serve:production"
+                        }
+                    }
+                },
+                "lint": {
+                    "builder": "@angular-devkit/build-angular:tslint",
+                    "options": {
+                        "tsConfig": "e2e/tsconfig.e2e.json",
+                        "exclude": [
+                            "**/node_modules/**"
+                        ]
+                    }
+                }
+            }
+        }
+    },
+    "defaultProject": "cds-ui"
+}
\ No newline at end of file
diff --git a/cds-ui/client/package.json b/cds-ui/client/package.json
new file mode 100644 (file)
index 0000000..04dd308
--- /dev/null
@@ -0,0 +1,67 @@
+{
+    "name": "cds-ui",
+    "version": "0.0.0",
+    "scripts": {
+        "ng": "ng",
+        "start": "ng serve",
+        "build": "ng build",
+        "test": "ng test",
+        "lint": "ng lint",
+        "e2e": "ng e2e"
+    },
+    "private": true,
+    "dependencies": {
+        "@angular/animations": "7.1.0",
+        "@angular/cdk": "^7.1.1",
+        "@angular/common": "7.1.0",
+        "@angular/compiler": "7.1.0",
+        "@angular/core": "7.1.0",
+        "@angular/forms": "7.1.0",
+        "@angular/material": "^7.1.1",
+        "@angular/platform-browser": "7.1.0",
+        "@angular/platform-browser-dynamic": "7.1.0",
+        "@angular/router": "7.1.0",
+        "@material/chips": "^0.43.0",
+        "@ngrx/core": "^1.2.0",
+        "@ngrx/effects": "^6.1.2",
+        "@ngrx/router-store": "^6.1.2",
+        "@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",
+        "rxjs": "6.3.3",
+        "stream": "0.0.2",
+        "tslib": "^1.9.0",
+        "zone.js": "0.8.26"
+    },
+    "devDependencies": {
+        "@angular-devkit/build-angular": "0.11.0",
+        "@angular/cli": "7.1.0",
+        "@angular/compiler-cli": "7.1.0",
+        "@angular/language-service": "7.1.0",
+        "@types/node": "8.9.4",
+        "@types/jasmine": "2.8.8",
+        "@types/jasminewd2": "2.0.3",
+        "codelyzer": "4.5.0",
+        "jasmine-core": "2.99.1",
+        "jasmine-spec-reporter": "4.2.1",
+        "karma": "3.1.1",
+        "karma-chrome-launcher": "2.2.0",
+        "karma-coverage-istanbul-reporter": "2.0.1",
+        "karma-jasmine": "1.1.2",
+        "karma-jasmine-html-reporter": "^0.2.2",
+        "protractor": "5.4.0",
+        "ts-node": "7.0.0",
+        "tslint": "5.11.0",
+        "typescript": "3.1.6"
+    }
+}
diff --git a/cds-ui/client/pom.xml b/cds-ui/client/pom.xml
new file mode 100644 (file)
index 0000000..573ab1f
--- /dev/null
@@ -0,0 +1,99 @@
+<!-- 
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.onap.ccsdk.cds</groupId>
+        <artifactId>controller-design-studio</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+    
+    <groupId>org.onap.ccsdk.cds</groupId>
+    <artifactId>controller-design-studio-client</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>cds-ui</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <npm.executable>npm</npm.executable>
+        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+    </properties>
+
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.eirslett</groupId>
+                <artifactId>frontend-maven-plugin</artifactId>
+                <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
+                <version>1.3</version>
+                <configuration>
+                    <nodeVersion>v8.12.0</nodeVersion>
+                    <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
+                    <npmDownloadRoot>https://nodejs.org/dist/npm/</npmDownloadRoot>
+                    <installDirectory>./</installDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>install node and npm</id>
+                        <goals>
+                            <goal>install-node-and-npm</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                    </execution>
+
+                    <execution>
+                        <id>npm install</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+
+                        <phase>generate-resources</phase>
+
+                        <configuration>
+                            <arguments>install</arguments>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>npm build</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+
+                        <phase>generate-resources</phase>
+
+                        <configuration>
+                            <arguments>run build</arguments>
+                        </configuration>
+                    </execution>
+
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/cds-ui/client/src/app/app-routing.module.ts b/cds-ui/client/src/app/app-routing.module.ts
new file mode 100644 (file)
index 0000000..96dfce1
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { HomeComponent } from './common/shared/components/home/home.component';
+
+
+const routes: Routes = [
+{
+  path: '',
+  component: HomeComponent,
+   children: [
+    {
+      path: 'blueprint',
+      loadChildren: './feature-modules/blueprint/blueprint.module#BlueprintModule'
+    },
+    {
+      path: 'resource-definition',
+      loadChildren: './feature-modules/resource-definition/resource-definition.module#ResourceDefinitionModule'
+    }
+  ]
+}
+];
+
+@NgModule({
+  imports: [RouterModule.forRoot(routes)],
+  exports: [RouterModule]
+})
+export class AppRoutingModule { }
diff --git a/cds-ui/client/src/app/app.component.html b/cds-ui/client/src/app/app.component.html
new file mode 100644 (file)
index 0000000..88446ca
--- /dev/null
@@ -0,0 +1,23 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+
+
+<router-outlet></router-outlet>
diff --git a/cds-ui/client/src/app/app.component.scss b/cds-ui/client/src/app/app.component.scss
new file mode 100644 (file)
index 0000000..bf7a36c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.example-container {
+    // position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+  }
+  
+  .example-events {
+    width: 300px;
+    height: 200px;
+    overflow: auto;
+    border: 1px solid #555;
+  }
\ No newline at end of file
diff --git a/cds-ui/client/src/app/app.component.spec.ts b/cds-ui/client/src/app/app.component.spec.ts
new file mode 100644 (file)
index 0000000..f59f48b
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { TestBed, async } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
+import { AppComponent } from './app.component';
+
+describe('AppComponent', () => {
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      imports: [
+        RouterTestingModule
+      ],
+      declarations: [
+        AppComponent
+      ],
+    }).compileComponents();
+  }));
+
+  it('should create the app', () => {
+    const fixture = TestBed.createComponent(AppComponent);
+    const app = fixture.debugElement.componentInstance;
+    expect(app).toBeTruthy();
+  });
+
+  it(`should have as title 'cds-ui'`, () => {
+    const fixture = TestBed.createComponent(AppComponent);
+    const app = fixture.debugElement.componentInstance;
+    expect(app.title).toEqual('cds-ui');
+  });
+
+  it('should render title in a h1 tag', () => {
+    const fixture = TestBed.createComponent(AppComponent);
+    fixture.detectChanges();
+    const compiled = fixture.debugElement.nativeElement;
+    expect(compiled.querySelector('h1').textContent).toContain('Welcome to cds-ui!');
+  });
+});
diff --git a/cds-ui/client/src/app/app.component.ts b/cds-ui/client/src/app/app.component.ts
new file mode 100644 (file)
index 0000000..1064179
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 } from '@angular/core';
+import { Router } from '@angular/router';
+import { Observable} from 'rxjs';
+import { Store } from '@ngrx/store';
+
+@Component({
+  selector: 'app-root',
+  templateUrl: './app.component.html',
+  styleUrls: ['./app.component.scss']
+})
+export class AppComponent {
+
+  constructor(private router: Router) {
+   }
+}
diff --git a/cds-ui/client/src/app/app.module.ts b/cds-ui/client/src/app/app.module.ts
new file mode 100644 (file)
index 0000000..e4cc4a1
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { BrowserModule } from '@angular/platform-browser';
+import { NgModule } from '@angular/core';
+import { StoreModule } from '@ngrx/store';
+import { CommonModule } from '@angular/common';
+import { ReactiveFormsModule } from '@angular/forms';
+import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { MatIconModule } from '@angular/material/icon';
+import { HttpClientModule } from '@angular/common/http';
+
+import { AppRoutingModule } from './app-routing.module';
+import { AppComponent } from './app.component';
+import { SharedModule } from './common/shared/shared.module';
+import { CoreModule } from './common/core/core.module';
+import { AppMaterialModule } from './common/modules/app-material.module';
+import { ResourceDefinitionModule } from './feature-modules/resource-definition/resource-definition.module';
+
+@NgModule({ 
+  declarations: [
+    AppComponent
+  ],
+  imports: [
+    BrowserModule,
+    CommonModule,
+    AppRoutingModule,
+    ReactiveFormsModule,
+    BrowserAnimationsModule,
+    HttpClientModule,
+    AppMaterialModule,
+    SharedModule,
+    CoreModule,
+    ResourceDefinitionModule
+  ],
+  providers: [],
+  bootstrap: [AppComponent]
+})
+export class AppModule { }
diff --git a/cds-ui/client/src/app/common/constants/app-constants.ts b/cds-ui/client/src/app/common/constants/app-constants.ts
new file mode 100644 (file)
index 0000000..0efabeb
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+export const GlobalContants = {
+    endpoints: {
+
+    },
+    // cbawizard: {
+    //     stepsRequired: {stepCount: 3, 
+    //                     steps: [{name:'CBA Metadata', componentURL:'/controllerBlueprint/selectTemplate'}, 
+    //                             {name:'Controller Blueprint Designer', componentURL:'/controllerBlueprint/modifyTemplate'}, 
+    //                             {name:'Test', componentURL:'/controllerBlueprint/testTemplate'},
+    //                             {name:'Deploy', componentURL:'/controllerBlueprint/deployTemplate'}]
+    //                     }
+    // }
+    cbawizard: {
+        stepsRequired: 
+        {
+            stepCount: 4,
+            steps: [{
+                name: 'CBA Metadata',
+                componentURL: '/controllerBlueprint/selectTemplate',
+                label: 'CBA Metadata',
+                link: '/blueprint/selectTemplate',
+                index: 0,
+                component: 'SelectTemplateComponent'
+            },
+            {
+                name: 'Controller Blueprint Designer',
+                componentURL: '/controllerBlueprint/modifyTemplate',
+                label: 'Controller Blueprint Designer',
+                link: '/blueprint/modifyTemplate',
+                index: 1,
+                component: 'ModifyTemplateComponent'
+            },
+            {
+                name: 'Test',
+                componentURL: '/controllerBlueprint/testTemplate',
+                label: 'Test',
+                link: '/blueprint/testTemplate',
+                index: 2,
+                component: 'TestTemplateComponent'
+            },
+            {
+                name: 'Deploy',
+                componentURL: '/controllerBlueprint/deployTemplate',
+                label: 'Deploy',
+                link: '/blueprint/deployTemplate',
+                index: 3,
+                component: 'DeployTemplateComponent'
+            }]
+        }
+    },
+    datadictionary: {
+        stepsRequired: 
+        {
+            stepCount: 3,
+            steps: [{
+                      name: 'Resource Creation', componentURL: '/dataDictionary/selectTemplate',
+                      label: 'Resource Creation',
+                      component: 'ResourceCreationComponent'
+
+                    },
+                   {
+                      name: 'Edit/Validate', componentURL: '/dataDictionary/modifyTemplate',
+                      label: 'Edit/Validate',
+                      component: 'ResourceEditComponent'
+                   },
+                   {
+                      name: 'Save', componentURL: '/dataDictionary/saveTemplate',
+                      label: 'Save Resource',
+                      component: 'SaveResourceComponent'
+                   }]
+       }
+
+    }
+};
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/README.md b/cds-ui/client/src/app/common/core/README.md
new file mode 100644 (file)
index 0000000..6b30b8a
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains Core services. Services which should have single instance across the application.
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/core.module.ts b/cds-ui/client/src/app/common/core/core.module.ts
new file mode 100644 (file)
index 0000000..807065e
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { StoreModule, Store } from '@ngrx/store';
+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 { BlueprintService } from './services/blueprint.service';
+
+@NgModule({
+  declarations: [
+  ],
+  imports: [
+    CommonModule,
+    StoreModule.forRoot(appReducers),
+    EffectsModule.forRoot([BlueprintEffects,ResourcesEffects]),
+    StoreRouterConnectingModule.forRoot({stateKey: 'router'}),
+    HttpClientModule
+  ],
+  providers : [ ApiService ]
+})
+export class CoreModule { }
diff --git a/cds-ui/client/src/app/common/core/services/api.service.ts b/cds-ui/client/src/app/common/core/services/api.service.ts
new file mode 100644 (file)
index 0000000..0ee3c6a
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 } from 'rxjs';
+
+//import { IBlueprintHttp } from '../store/models/blueprint-http.model';
+
+@Injectable()
+export class ApiService {
+  // blueprintUrl = '../../constants/blueprint.json';
+
+  constructor(private _http: HttpClient) {
+  }
+
+  get(url: string, params?: any): Observable<any> {
+            return this._http.get(url);
+  }
+
+  post() {
+    // to do
+  }
+
+  put() {
+      // to do
+  }
+
+  delete() {
+      // to do
+  }
+
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/README.md b/cds-ui/client/src/app/common/core/store/README.md
new file mode 100644 (file)
index 0000000..c9584c8
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains the code related to ngrx/store, for application state management.
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts b/cds-ui/client/src/app/common/core/store/actions/blueprint.action.ts
new file mode 100644 (file)
index 0000000..8dc5067
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IBlueprint } from '../models/blueprint.model';
+import { IBlueprintState } from '../models/blueprintState.model';
+
+export const LOAD_BLUEPRINT = 'LOAD_BLUEPRINT';
+export const LOAD_BLUEPRINT_SUCCESS = 'LOAD_BLUEPRINT_SUCCESS';
+export const LOAD_BLUEPRINT_FAILURE = 'LOAD_BLUEPRINT_FAILURE';
+export const UPDATE_BLUEPRINT ='UPDATE_BLUEPRINT';
+export const UPDATE_BLUEPRINT_SUCCESS = 'UPDATE_BLUEPRINT_SUCCESS';
+export const UPDATE_BLUEPRINT_FAILURE = 'UPDATE_BLUEPRINT_FAILURE';
+export const SAVE_BLUEPRINT = 'SAVE_BLUEPRINT';
+export const SAVE_BLUEPRINT_SUCCESS = 'SAVE_BLUEPRINT_SUCCESS';
+export const SAVE_BLUEPRINT_FAILURE = 'SAVE_BLUEPRINT_FAILURE';
+
+export const SET_BLUEPRINT = 'SET Blueprint';
+export const REMOVE_BLUEPRINT = 'Remove Blueprint';
+
+export const SET_BLUEPRINT_STATE = 'SET Blueprint state';
+
+
+export class LoadBlueprint implements Action {
+    readonly type = LOAD_BLUEPRINT;
+    constructor(public startLoadSuccess?: boolean) {}
+}
+
+export class LoadBlueprintSuccess implements Action {
+    readonly type = LOAD_BLUEPRINT_SUCCESS;
+    constructor(public payload: IBlueprint) {}
+}
+
+export class LoadBlueprintFailure implements Action {
+    readonly type = LOAD_BLUEPRINT_FAILURE;
+    constructor(public error: any) {}
+}
+
+export class SetBlueprintState implements Action {
+    readonly type = SET_BLUEPRINT_STATE;
+    constructor(public payload: IBlueprintState) {}
+}
+
+// export class SetBlueprint implements Action {
+//     readonly type = SET_BLUEPRINT;
+//     constructor(public payload: Blueprint) {}
+// }
+
+// export class RemoveBlueprint implements Action {
+//     readonly type = REMOVE_BLUEPRINT;
+//     constructor(public payload: Blueprint) {}
+// }
+
+export class UpdateBlueprint implements Action {
+    readonly type = UPDATE_BLUEPRINT;
+    constructor(public payload: IBlueprint) {}
+}
+
+export type Actions = LoadBlueprint | LoadBlueprintSuccess | LoadBlueprintFailure | SetBlueprintState;
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/actions/resources.action.ts b/cds-ui/client/src/app/common/core/store/actions/resources.action.ts
new file mode 100644 (file)
index 0000000..d5a723b
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+* ============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 { IResources } from '../models/resources.model';
+import { IResourcesState } from '../models/resourcesState.model';
+
+export const LOAD_RESOURCES = 'LOAD_RESOURCES';
+export const LOAD_RESOURCES_SUCCESS = 'LOAD_RESOURCES_SUCCESS';
+export const LOAD_RESOURCES_FAILURE = 'LOAD_RESOURCES_FAILURE';
+export const UPDATE_RESOURCES ='UPDATE_RESOURCES';
+export const SET_RESOURCES_STATE = 'SET Resources state';
+
+
+export class LoadResources implements Action {
+    readonly type = LOAD_RESOURCES;
+    constructor(public startLoadSuccess?: boolean) {}
+}
+
+export class LoadResourcesSuccess implements Action {
+    readonly type = LOAD_RESOURCES_SUCCESS;
+    constructor(public payload: IResources) {}
+}
+
+export class LoadResourcesFailure implements Action {
+    readonly type = LOAD_RESOURCES_FAILURE;
+    constructor(public error: any) {}
+}
+
+export class SetResourcesState implements Action {
+    readonly type = SET_RESOURCES_STATE;
+    constructor(public payload: IResourcesState) {}
+}
+
+export class UpdateResources implements Action {
+    readonly type = UPDATE_RESOURCES;
+    constructor(public payload: IResources) {}
+}
+
+export type Actions = LoadResources | LoadResourcesSuccess | LoadResourcesFailure | SetResourcesState;
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/effects/blueprint.effects.ts b/cds-ui/client/src/app/common/core/store/effects/blueprint.effects.ts
new file mode 100644 (file)
index 0000000..e1b1c2f
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { Effect, ofType, Actions } from '@ngrx/effects';
+import { Store, select } from '@ngrx/store';
+import { of } from 'rxjs';
+import { switchMap, map, withLatestFrom, catchError } from 'rxjs/operators';
+
+import { IAppState } from '../state/app.state';
+import * as BlueprintActions from '../actions/blueprint.action';
+// import { IBlueprintHttp } from '../models/blueprint-http.model';
+// import { BlueprintService } from '../../services/blueprint.service';
+// import { BlueprintService } from '../../../feature-modules/blueprint/blueprint.service';
+
+@Injectable()
+export class BlueprintEffects {
+
+  
+  constructor(
+   // private blueprintService: BlueprintService,
+    private _actions$: Actions,
+    private _store: Store<IAppState>
+  ) {}
+    
+  // @Effect()
+  // getBlueprint$ = this._actions$.pipe(
+  //   ofType<BlueprintActions.LoadBlueprint>(BlueprintActions.LOAD_BLUEPRINT),
+  //   switchMap(() => 
+  //     this.blueprintService.loadBlueprint().pipe(
+  //     map((blueprintResponse: any) => new  BlueprintActions.LoadBlueprintSuccess(blueprintResponse)),
+  //     catchError((error : any) => of(new BlueprintActions.LoadBlueprintSuccess(error)))
+  //   ),
+   // ,
+    // switchMap((blueprintResponse: any) => of(new BlueprintActions.LoadBlueprintSuccess(blueprintResponse)))
+//   ),
+// )
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/effects/resources.effects.ts b/cds-ui/client/src/app/common/core/store/effects/resources.effects.ts
new file mode 100644 (file)
index 0000000..f48f284
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* ============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 { Effect, ofType, Actions } from '@ngrx/effects';
+import { Store, select } from '@ngrx/store';
+import { of } from 'rxjs';
+import { switchMap, map, withLatestFrom, catchError } from 'rxjs/operators';
+
+import { IAppState } from '../state/app.state';
+import * as ResourcesActions from '../actions/resources.action';
+
+@Injectable()
+export class ResourcesEffects {
+
+  constructor(
+    private _actions$: Actions,
+    private _store: Store<IAppState>
+  ) {}
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/blueprint-http.model.ts b/cds-ui/client/src/app/common/core/store/models/blueprint-http.model.ts
new file mode 100644 (file)
index 0000000..e0e98d5
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IBlueprint } from '../models/blueprint.model';
+
+export interface IBlueprintHttp {
+  blueprint: IBlueprint;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/blueprint.model.ts b/cds-ui/client/src/app/common/core/store/models/blueprint.model.ts
new file mode 100644 (file)
index 0000000..f4989fb
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IMetaData } from './metadata.model';
+import { IImportModel } from './imports.model';
+import { ITopologyTemplate } from './itopologytemplate.model';
+
+export interface IBlueprint {
+        metadata: IMetaData;
+        fileImports: Array<IImportModel>
+        toplogyTemplates: ITopologyTemplate;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts b/cds-ui/client/src/app/common/core/store/models/blueprintState.model.ts
new file mode 100644 (file)
index 0000000..6d26592
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IMetaData } from './metadata.model';
+import { IImportModel } from './imports.model';
+import { IBlueprint } from './blueprint.model';
+
+
+export interface IBlueprintState {
+    blueprint: IBlueprint,
+    name?: string;
+    files?: any;
+    filesData?: any;
+    isLoadSuccess?: boolean;
+    isUpdateSuccess?: boolean;
+    isSaveSuccess?: boolean;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/entrySchema.model.ts b/cds-ui/client/src/app/common/core/store/models/entrySchema.model.ts
new file mode 100644 (file)
index 0000000..8e96590
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* ============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=========================================================
+*/
+
+export interface IEntrySchema{
+  Type:string;  
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/imports.model.ts b/cds-ui/client/src/app/common/core/store/models/imports.model.ts
new file mode 100644 (file)
index 0000000..9510ed3
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export interface IImportModel {
+    file: string;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/itopologytemplate.model.ts b/cds-ui/client/src/app/common/core/store/models/itopologytemplate.model.ts
new file mode 100644 (file)
index 0000000..7457f2f
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export interface ITopologyTemplate {
+    inputs: object[];
+       node_template: object[];
+       workflow: object[];
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/metadata.model.ts b/cds-ui/client/src/app/common/core/store/models/metadata.model.ts
new file mode 100644 (file)
index 0000000..6ee4275
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+export interface IMetaData {
+    template_author: string;
+    author_email: String;
+    user_groups: string;
+    template_name: string;
+    template_version: string;
+    template_tags: string;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/propertyData.model.ts b/cds-ui/client/src/app/common/core/store/models/propertyData.model.ts
new file mode 100644 (file)
index 0000000..94cff89
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+* ============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 {IEntrySchema} from './entrySchema.model';
+
+export interface IPropertyData{  
+    discription:string;
+    _type:string;
+    required:boolean;
+    entry_schema:IEntrySchema;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/resources-http.model.ts b/cds-ui/client/src/app/common/core/store/models/resources-http.model.ts
new file mode 100644 (file)
index 0000000..3f2556a
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+* ============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 { IResources } from '../models/resources.model';
+
+export interface IResourcesHttp {
+  resources: IResources;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/resources.model.ts b/cds-ui/client/src/app/common/core/store/models/resources.model.ts
new file mode 100644 (file)
index 0000000..019c268
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* ============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 { ISourcesData } from './sourcesData.model';
+import { IPropertyData } from './propertyData.model';
+
+export interface IResources { 
+    name:string ;
+    tags:string;
+    updated_bt:string;
+    property: IPropertyData;
+    sources: ISourcesData;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts b/cds-ui/client/src/app/common/core/store/models/resourcesState.model.ts
new file mode 100644 (file)
index 0000000..7dacf32
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* ============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 { IResources } from './resources.model';
+
+export interface IResourcesState {
+    resources: IResources,
+    isLoadSuccess: boolean;
+    isUpdateSuccess: boolean;
+    isSaveSuccess: boolean;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/models/sourcesData.model.ts b/cds-ui/client/src/app/common/core/store/models/sourcesData.model.ts
new file mode 100644 (file)
index 0000000..ed43fc9
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* ============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=========================================================
+*/
+
+export interface ISourcesData{
+sources: object[];  
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/reducers/app.reducer.ts b/cds-ui/client/src/app/common/core/store/reducers/app.reducer.ts
new file mode 100644 (file)
index 0000000..6f58320
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { 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';
+
+export const appReducers: ActionReducerMap<IAppState, any> = {
+    router: routerReducer,
+    blueprint: blueprintReducer,
+    resources:resourcesReducer
+};
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts b/cds-ui/client/src/app/common/core/store/reducers/blueprint.reducer.ts
new file mode 100644 (file)
index 0000000..37a659d
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IBlueprint } from '../models/blueprint.model';
+import { IBlueprintState } from '../models/blueprintState.model';
+import { initialBlueprintState } from '../state/blueprint.state';
+import * as BlueprintActions from '../actions/blueprint.action';
+
+// const initialState: BlueprintState = {
+//     blueprint: {
+//         metadata: {
+//             template_author: '',
+//             author_email: '',
+//             user_groups: '',
+//             template_name: '',
+//             template_version: '',
+//             template_tags: ''
+//         },
+//         fileImports: [{file:''}],
+//         toplogyTemplates: 'temp'        
+//     },
+//     isLoadSuccess: false,
+//     isUpdateSuccess: false,
+//     isSaveSuccess: false
+// }
+
+
+export function blueprintReducer(state: IBlueprintState = initialBlueprintState, action: BlueprintActions.Actions) : IBlueprintState {
+    switch(action.type) {
+        case BlueprintActions.LOAD_BLUEPRINT_SUCCESS:
+            return {...state,
+                    blueprint: action.payload
+                    }
+        case BlueprintActions.SET_BLUEPRINT_STATE :
+            return {...state,
+                    blueprint: action.payload.blueprint,
+                    name: action.payload.name,
+                    files: action.payload.files,
+                    filesData: action.payload.filesData
+                    }
+        default:
+            return state;
+    }
+}
diff --git a/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts b/cds-ui/client/src/app/common/core/store/reducers/resources.reducer.ts
new file mode 100644 (file)
index 0000000..c9d587d
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* ============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 { IResources } from '../models/resources.model';
+import { IResourcesState } from '../models/resourcesState.model';
+import { initialResourcesState } from '../state/resources.state';
+import * as ResourcesActions from '../actions/resources.action';
+
+export function resourcesReducer(state: IResourcesState = initialResourcesState, action: ResourcesActions.Actions) : IResourcesState {
+    switch(action.type) {
+        case ResourcesActions.LOAD_RESOURCES_SUCCESS:
+            return {...state,
+                    resources: action.payload
+                    }
+        default:
+            return state;
+    }
+}
diff --git a/cds-ui/client/src/app/common/core/store/selectors/blueprint.selectors.ts b/cds-ui/client/src/app/common/core/store/selectors/blueprint.selectors.ts
new file mode 100644 (file)
index 0000000..d23221c
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IBlueprintState } from '../models/blueprintState.model';
+
+const selectBlueprintFromAppState = (state: IAppState) => state.blueprint;
+
+export const selectBlueprint = createSelector(
+    selectBlueprintFromAppState,
+  (state: IBlueprintState) => state.blueprint
+);
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/selectors/resources.selectors.ts b/cds-ui/client/src/app/common/core/store/selectors/resources.selectors.ts
new file mode 100644 (file)
index 0000000..96ec4d3
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* ============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 { IResourcesState } from '../models/resourcesState.model';
+
+const selectResourcesFromAppState = (state: IAppState) => state.resources;
+
+export const selectResources = createSelector(
+    selectResourcesFromAppState,
+  (state: IResourcesState) => state.resources
+);
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/state/app.state.ts b/cds-ui/client/src/app/common/core/store/state/app.state.ts
new file mode 100644 (file)
index 0000000..052eb2c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { RouterReducerState     } from '@ngrx/router-store';
+import { IBlueprintState } from '../models/blueprintState.model';
+import { initialBlueprintState } from './blueprint.state';
+import { IResourcesState } from '../models/resourcesState.model';
+import { initialResourcesState } from './resources.state';
+
+export interface IAppState {
+    router? : RouterReducerState,
+    blueprint: IBlueprintState,
+    resources: IResourcesState
+}
+
+export const initialAppState: IAppState = {
+    blueprint: initialBlueprintState,
+    resources: initialResourcesState
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts b/cds-ui/client/src/app/common/core/store/state/blueprint.state.ts
new file mode 100644 (file)
index 0000000..19a8376
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { IBlueprintState } from '../models/blueprintState.model';
+import { IBlueprint } from '../models/blueprint.model';
+
+
+export const initialBlueprintState : IBlueprintState = {
+    blueprint : {} as IBlueprint,
+    name: '',
+    files: [],
+    filesData: [],
+    isLoadSuccess: false,
+    isUpdateSuccess: false,
+    isSaveSuccess: false,
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/core/store/state/resources.state.ts b/cds-ui/client/src/app/common/core/store/state/resources.state.ts
new file mode 100644 (file)
index 0000000..046667a
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* ============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 { IResourcesState } from '../models/resourcesState.model';
+import { IResources } from '../models/resources.model';
+
+export const initialResourcesState : IResourcesState = {
+    resources : {} as IResources,
+    isLoadSuccess: false,
+    isUpdateSuccess: false,
+    isSaveSuccess: false,
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/modules/README.md b/cds-ui/client/src/app/common/modules/README.md
new file mode 100644 (file)
index 0000000..196842e
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains common module. All the third party imports/libraries, that could be used at many components, should be imported here into a single module and that module can be used across.
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/modules/app-material.module.ts b/cds-ui/client/src/app/common/modules/app-material.module.ts
new file mode 100644 (file)
index 0000000..9ad2063
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { MatAutocompleteModule,
+  MatBottomSheetModule,
+  MatButtonModule,
+  MatButtonToggleModule,
+  MatCardModule,
+  MatCheckboxModule,
+  MatChipsModule,
+  MatDatepickerModule,
+  MatDialogModule,
+  MatDividerModule,
+  MatExpansionModule,
+  MatGridListModule,
+  MatIconModule,
+  MatInputModule,
+  MatListModule,
+  MatMenuModule,
+  MatNativeDateModule,
+  MatPaginatorModule,
+  MatProgressBarModule,
+  MatProgressSpinnerModule,
+  MatRadioModule,
+  MatRippleModule,
+  MatSelectModule,
+  MatSidenavModule,
+  MatSliderModule,
+  MatSlideToggleModule,
+  MatSnackBarModule,
+  MatSortModule,
+  MatStepperModule,
+  MatTableModule,
+  MatTabsModule,
+  MatToolbarModule,
+  MatTooltipModule,
+  MatTreeModule,
+  MatFormFieldModule } from '@angular/material';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    MatAutocompleteModule,
+  MatBottomSheetModule,
+  MatButtonModule,
+  MatButtonToggleModule,
+  MatCardModule,
+  MatCheckboxModule,
+  MatChipsModule,
+  MatDatepickerModule,
+  MatDialogModule,
+  MatDividerModule,
+  MatExpansionModule,
+  MatGridListModule,
+  MatIconModule,
+  MatInputModule,
+  MatMenuModule,
+  MatNativeDateModule,
+  MatPaginatorModule,
+  MatProgressBarModule,
+  MatProgressSpinnerModule,
+  MatRadioModule,
+  MatRippleModule,
+  MatSelectModule,
+  MatSidenavModule,
+  MatSliderModule,
+  MatSlideToggleModule,
+  MatSnackBarModule,
+  MatSortModule,
+  MatStepperModule,
+  MatTableModule,
+  MatTabsModule,
+  MatToolbarModule,
+  MatTooltipModule,
+  MatTreeModule,
+  MatListModule,
+  MatFormFieldModule
+  ],
+  exports: [
+    MatAutocompleteModule,
+  MatBottomSheetModule,
+  MatButtonModule,
+  MatButtonToggleModule,
+  MatCardModule,
+  MatCheckboxModule,
+  MatChipsModule,
+  MatDatepickerModule,
+  MatDialogModule,
+  MatDividerModule,
+  MatExpansionModule,
+  MatGridListModule,
+  MatIconModule,
+  MatInputModule,
+  MatListModule,
+  MatMenuModule,
+  MatNativeDateModule,
+  MatPaginatorModule,
+  MatProgressBarModule,
+  MatProgressSpinnerModule,
+  MatRadioModule,
+  MatRippleModule,
+  MatSelectModule,
+  MatSidenavModule,
+  MatSliderModule,
+  MatSlideToggleModule,
+  MatSnackBarModule,
+  MatSortModule,
+  MatStepperModule,
+  MatTableModule,
+  MatTabsModule,
+  MatToolbarModule,
+  MatTooltipModule,
+  MatTreeModule,
+  MatFormFieldModule
+  ]
+})
+export class AppMaterialModule { }
diff --git a/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.html b/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.html
new file mode 100644 (file)
index 0000000..b7c59b2
--- /dev/null
@@ -0,0 +1,62 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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="CBAform">
+  <mat-card-content>
+    <mat-horizontal-stepper [linear]=true #stepper (selectionChange)="changeRoute($event)">
+      <div *ngFor="let step of stepDetails">
+          <mat-step>
+              <ng-template matStepLabel>{{step.name}}
+              </ng-template>
+            </mat-step>
+      </div>
+    </mat-horizontal-stepper>
+  </mat-card-content>
+</mat-card> -->
+
+<!-- <mat-card class="CBAform">
+  <mat-card-content>
+    <mat-horizontal-stepper [linear]=true #stepper (selectionChange)="changeRoute($event)">
+      <a *ngFor="let routeLink of stepsRequired; let i = index;">
+          <mat-step style="display: none;">
+              <ng-template matStepLabel>{{routeLink.label}}
+              </ng-template>
+            </mat-step>
+          </a>
+    </mat-horizontal-stepper>
+  </mat-card-content>
+</mat-card> -->
+
+<mat-card class="CBAform">
+  <!-- <label>{{appName}}</label> -->
+  <mat-card-content>
+    <mat-horizontal-stepper [linear]=true #stepper >
+      <!-- <mat-step style="display: none;" *ngFor="let routeLink of stepsRequired; let i = index;"> -->
+        <mat-step style="display: none;" *ngFor="let routeLink of steps">
+        <ng-template matStepLabel>{{routeLink.label}}</ng-template>
+        <!-- {{appToLoad.component}} -->
+        <template #steppercontainer> </template>
+      </mat-step>
+      <div style="position:relative">
+        <button mat-button matStepperNext style="color:white;background:gray; right: 20px; position: absolute;bottom:5px; ">Next</button>
+      </div>
+    </mat-horizontal-stepper>
+  </mat-card-content>
+</mat-card>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.scss b/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.scss
new file mode 100644 (file)
index 0000000..119a7d7
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-horizontal-content-container {
+//     display: none !important;
+// }
+
+.mat-card {
+    padding: 0px !important;
+}
+
+mat-horizontal-stepper .mat-horizontal-content-container {
+    display: none !important;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.spec.ts b/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.spec.ts
new file mode 100644 (file)
index 0000000..62aca17
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { CBAWizardComponent } from './cbawizard.component';
+
+describe('CBAWizardComponent', () => {
+  let component: CBAWizardComponent;
+  let fixture: ComponentFixture<CBAWizardComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ CBAWizardComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(CBAWizardComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.ts b/cds-ui/client/src/app/common/shared/components/cbawizard/cbawizard.component.ts
new file mode 100644 (file)
index 0000000..fc284b3
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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, Input, Output, EventEmitter, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+import { MatStepper } from '@angular/material';
+
+import { GlobalContants } from '../../../constants/app-constants';
+
+@Component({
+  selector: 'app-cbawizard',
+  templateUrl: './cbawizard.component.html',
+  styleUrls: ['./cbawizard.component.scss']
+})
+export class CBAWizardComponent implements OnInit {
+  // @Input() stepsRequired: any[];
+  @Input() appName: any;
+  @ViewChild('stepper') stepper: MatStepper;
+  @Output() stepChanged = new EventEmitter();
+  public stepDetails = GlobalContants.cbawizard.stepsRequired.steps;
+  private routeLinks : any[];
+  activeLinkIndex = -1;
+  stepsRequired: any;
+  steps: any[];
+  
+  constructor(private router: Router) {
+  //   this.routeLinks = [
+  //     {
+  //         label: 'CBA Metadata',
+  //         link: '/blueprint/selectTemplate',
+  //         index: 0
+  //     }, {
+  //         label: 'Controller Blueprint Designer',
+  //         link: '/blueprint/modifyTemplate',
+  //         index: 1
+  //     }, {
+  //         label: 'Test',
+  //         link: '/blueprint/testTemplate',
+  //         index: 2
+  //     }, {
+  //         label: 'Deploy',
+  //         link: '/blueprint/deployTemplate',
+  //         index: 3
+  //     }
+  // ];
+
+  }
+
+  ngOnInit() {
+  //   this.router.events.subscribe((res) => {
+  //     this.activeLinkIndex = this.routeLinks.indexOf(this.routeLinks.find(tab => tab.link === this.router.url));
+  //     this.stepper.selectedIndex = this.activeLinkIndex; 
+  // });
+  //  this.stepsRequired.forEach((step, index)=>{
+  //   if(step.link == this.router.url) {
+  //     this.stepper.selectedIndex = step.index
+  //   }
+  //  });
+   if (this.appName == "cba") {
+    this.stepsRequired = GlobalContants.cbawizard.stepsRequired.stepCount;
+    this.steps = GlobalContants.cbawizard.stepsRequired.steps;
+    // this.createComponent();
+  }
+  if (this.appName == "datadict") {
+    this.stepsRequired = GlobalContants.datadictionary.stepsRequired.stepCount;
+    this.steps = GlobalContants.datadictionary.stepsRequired.steps;
+    // this.createComponent();
+  }
+  }
+
+  changeRoute(event){
+    this.stepsRequired.forEach((step, index)=>{
+      if(index == event.selectedIndex) {
+        this.router.navigate([step.link]);
+      }
+    });
+  }
+
+}
diff --git a/cds-ui/client/src/app/common/shared/components/header/header.component.html b/cds-ui/client/src/app/common/shared/components/header/header.component.html
new file mode 100644 (file)
index 0000000..e1ed842
--- /dev/null
@@ -0,0 +1,23 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-toolbar color="primary">
+  <span>Controller Blueprint Design Studio</span>
+</mat-toolbar>
diff --git a/cds-ui/client/src/app/common/shared/components/header/header.component.scss b/cds-ui/client/src/app/common/shared/components/header/header.component.scss
new file mode 100644 (file)
index 0000000..22941b5
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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/common/shared/components/header/header.component.spec.ts b/cds-ui/client/src/app/common/shared/components/header/header.component.spec.ts
new file mode 100644 (file)
index 0000000..99bb63b
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { HeaderComponent } from './header.component';
+
+describe('HeaderComponent', () => {
+  let component: HeaderComponent;
+  let fixture: ComponentFixture<HeaderComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ HeaderComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(HeaderComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/common/shared/components/header/header.component.ts b/cds-ui/client/src/app/common/shared/components/header/header.component.ts
new file mode 100644 (file)
index 0000000..40a3375
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-header',
+  templateUrl: './header.component.html',
+  styleUrls: ['./header.component.scss']
+})
+export class HeaderComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/cds-ui/client/src/app/common/shared/components/home/home.component.html b/cds-ui/client/src/app/common/shared/components/home/home.component.html
new file mode 100644 (file)
index 0000000..f8cfc88
--- /dev/null
@@ -0,0 +1,48 @@
+<!-- ============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-toolbar color="warn">
+  <mat-toolbar-row>
+    <button type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()" color="primary">
+      <mat-icon aria-label="Side nav toggle icon">menu</mat-icon>
+    </button>
+    <span>MY Image</span>
+  </mat-toolbar-row>
+</mat-toolbar> -->
+<mat-toolbar color="primary">
+    <mat-toolbar-row>
+        <!-- <button type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()" color="primary"> -->
+        <a class="menuBar" (click)="drawer.toggle()">&#9776;</a>
+        <!-- </button> -->
+        <span class="title">Controller Blueprint Design Studio</span>
+    </mat-toolbar-row>
+</mat-toolbar>
+<mat-sidenav-container class="example-container">
+    <mat-sidenav #drawer mode="side" [(opened)]="opened" (opened)="events.push('open!')" (closed)="events.push('close!')">
+        <mat-toolbar color="" primary>Menu</mat-toolbar>
+        <mat-nav-list>
+            <a mat-list-item [routerLink]="['/blueprint']">Controller Blueprint</a>
+            <a mat-list-item [routerLink]="['/resource-definition']">Resource Definition</a>
+        </mat-nav-list>
+    </mat-sidenav>
+
+    <mat-sidenav-content (click)="drawer.close()">
+        <router-outlet></router-outlet>
+    </mat-sidenav-content>
+</mat-sidenav-container>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/shared/components/home/home.component.scss b/cds-ui/client/src/app/common/shared/components/home/home.component.scss
new file mode 100644 (file)
index 0000000..df9a48d
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+// .example-container {
+//     // position: absolute;
+//     top: 0;
+//     bottom: 0;
+//     left: 0;
+//     right: 0;
+//   }
+  
+//   .example-events {
+//     width: 300px;
+//     height: 200px;
+//     overflow: auto;
+//     border: 1px solid #555;
+//   }
+.mat-sidenav-container{
+    height: 652px;
+}
+.mat-button.mat-primary, .mat-icon-button.mat-primary, .mat-stroked-button.mat-primary {
+    color: white !important;
+}
+.menuBar{
+    cursor: pointer;
+}
+.title{
+    margin: 1em;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/common/shared/components/home/home.component.spec.ts b/cds-ui/client/src/app/common/shared/components/home/home.component.spec.ts
new file mode 100644 (file)
index 0000000..5bfec03
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { HomeComponent } from './home.component';
+
+describe('HomeComponent', () => {
+  let component: HomeComponent;
+  let fixture: ComponentFixture<HomeComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ HomeComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(HomeComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/common/shared/components/home/home.component.ts b/cds-ui/client/src/app/common/shared/components/home/home.component.ts
new file mode 100644 (file)
index 0000000..d5ea7f6
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-home',
+  templateUrl: './home.component.html',
+  styleUrls: ['./home.component.scss']
+})
+export class HomeComponent implements OnInit {
+  events: string[] = [];
+  opened: boolean = true;
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/cds-ui/client/src/app/common/shared/directives/README.md b/cds-ui/client/src/app/common/shared/directives/README.md
new file mode 100644 (file)
index 0000000..d82b915
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains common directives used across the application.
diff --git a/cds-ui/client/src/app/common/shared/pipes/README.md b/cds-ui/client/src/app/common/shared/pipes/README.md
new file mode 100644 (file)
index 0000000..8470fee
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains common pipes used across the application
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..b0d37c3
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* ============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 { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+  name: 'search'
+})
+
+export class SearchPipe implements PipeTransform{
+   
+    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/common/shared/shared.module.ts b/cds-ui/client/src/app/common/shared/shared.module.ts
new file mode 100644 (file)
index 0000000..8db020d
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { HomeComponent } from './components/home/home.component';
+import { CBAWizardComponent } from './components/cbawizard/cbawizard.component';
+import { MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule,  MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material';
+import { RouterModule } from "@angular/router";
+import { SearchPipe } from './pipes/search.pipe';
+
+@NgModule({
+  declarations: [
+    HomeComponent,
+    CBAWizardComponent,
+    SearchPipe
+    
+  ],
+  exports: [
+    HomeComponent,
+    CBAWizardComponent,
+    SearchPipe
+  ],
+  imports: [
+    CommonModule,
+    MatToolbarModule,
+    MatButtonModule,
+    MatSidenavModule,
+    MatIconModule,
+    MatListModule,
+    MatGridListModule,
+    MatCardModule,
+    MatMenuModule,
+    MatTableModule,
+    MatPaginatorModule,
+    MatSortModule,
+    MatInputModule,
+    MatSelectModule, 
+    MatRadioModule, 
+    MatFormFieldModule, 
+    MatStepperModule,
+    RouterModule
+  ]
+})
+export class SharedModule { }
diff --git a/cds-ui/client/src/app/common/utility/README.md b/cds-ui/client/src/app/common/utility/README.md
new file mode 100644 (file)
index 0000000..e4b0cce
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains utility files
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint-routing.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/blueprint-routing.module.ts
new file mode 100644 (file)
index 0000000..d0ce0c6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { BlueprintComponent } from './blueprint.component';
+
+
+const routes: Routes = [
+    {
+        path: '',
+        component: BlueprintComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class BlueprintRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.html b/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.html
new file mode 100644 (file)
index 0000000..b38c75b
--- /dev/null
@@ -0,0 +1,43 @@
+<!-- ============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+
+<!-- <app-cbawizard [appName]="appName"></app-cbawizard>
+<router-outlet></router-outlet> -->
+<mat-card class="CBAform">
+    <mat-card-content>
+        <mat-horizontal-stepper [linear]="isLinear" #stepper>
+            <mat-step [stepControl]="firstFormGroup">
+                <ng-template matStepLabel>CBA Metadata</ng-template>
+                <app-select-template></app-select-template>
+            </mat-step>
+            <mat-step [stepControl]="secondFormGroup">
+                <ng-template matStepLabel>Controller Blueprint Designer</ng-template>
+                <app-modify-template></app-modify-template>
+            </mat-step>
+            <!-- <mat-step [stepControl]="thirdFormGroup">
+                <ng-template matStepLabel>Deploy</ng-template>
+                <app-deploy-template></app-deploy-template>
+            </mat-step>             -->
+            <mat-step [stepControl]="thirdFormGroup">
+                <ng-template matStepLabel>Test</ng-template>
+                <app-test-template></app-test-template>
+            </mat-step>
+        </mat-horizontal-stepper>
+    </mat-card-content>
+</mat-card>
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.scss
new file mode 100644 (file)
index 0000000..63e4565
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {
+    padding: 0px !important;
+}
+
+.matStepNextBtn {
+    color: white;
+    background-color: #3f51b5;
+    margin-right: 2em;
+    border-radius: 2em;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.spec.ts
new file mode 100644 (file)
index 0000000..74ae9b0
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { BlueprintComponent } from './blueprint.component';
+
+describe('BlueprintComponent', () => {
+  let component: BlueprintComponent;
+  let fixture: ComponentFixture<BlueprintComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ BlueprintComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(BlueprintComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/blueprint.component.ts
new file mode 100644 (file)
index 0000000..4612499
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-blueprint',
+  templateUrl: './blueprint.component.html',
+  styleUrls: ['./blueprint.component.scss']
+})
+export class BlueprintComponent implements OnInit {
+  appName: String;
+
+  constructor() {
+    this.appName="cba";
+   }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/blueprint.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/blueprint.module.ts
new file mode 100644 (file)
index 0000000..3a25e92
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { BlueprintComponent } from './blueprint.component';
+import { BlueprintRoutingModule } from './blueprint-routing.module';
+
+import { SharedModule } from '../../../app/common/shared/shared.module';
+import { SelectTemplateModule } from './select-template/select-template.module';
+import { ModifyTemplateModule } from './modify-template/modify-template.module';
+import { DeployTemplateModule } from './deploy-template/deploy-template.module';
+import { TestTemplateModule } from './test-template/test-template.module';
+
+import { AppMaterialModule } from '../../../app/common/modules/app-material.module';
+
+@NgModule({
+  declarations: [
+    BlueprintComponent 
+  ],
+  imports: [
+    CommonModule,
+    BlueprintRoutingModule,
+    SharedModule,
+    AppMaterialModule,
+    SelectTemplateModule,
+    ModifyTemplateModule,
+    DeployTemplateModule,
+    TestTemplateModule
+  ]
+})
+export class BlueprintModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template-routing.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template-routing.module.ts
new file mode 100644 (file)
index 0000000..65a98a9
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { DeployTemplateComponent } from './deploy-template.component';
+
+const routes: Routes = [
+    {
+        path: '',
+        component: DeployTemplateComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class DeployTemplateRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.html
new file mode 100644 (file)
index 0000000..739ef04
--- /dev/null
@@ -0,0 +1,56 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+<div style="height: 556px;">
+<div style="height: 90%;overflow-y: scroll;border: 1px solid grey">
+  <mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
+    <!-- This is the tree node template for leaf nodes -->
+    <mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
+      <!-- use a disabled button to provide padding for tree leaf -->
+      <button mat-icon-button disabled></button>
+      <span (click)="fileClicked(node.name)">{{node.name}}</span>
+    </mat-tree-node>
+    <!-- This is the tree node template for expandable nodes -->
+    <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding>
+      <button mat-icon-button matTreeNodeToggle
+              [attr.aria-label]="'toggle ' + node.name">
+        <mat-icon class="mat-icon-rtl-mirror">
+          {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
+        </mat-icon>
+      </button>
+      <span (click)="fileClicked(node.name)">{{node.name}}</span>
+    </mat-tree-node>
+  </mat-tree>
+</div>
+
+<div style="height: 10%">
+  <button style="margin: 1em;
+  background-color: #3f51b5;
+  color: white;
+  border-radius: 2em;
+  padding: 0.5em;">Deploy/Save</button>
+  <button style="margin: 1em;
+  background-color: #3f51b5;
+  color: white;
+  border-radius: 2em;
+  padding: 0.5em;">Download</button>
+</div>
+
+</div>
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.scss
new file mode 100644 (file)
index 0000000..22941b5
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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/blueprint/deploy-template/deploy-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.spec.ts
new file mode 100644 (file)
index 0000000..c9be19d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { DeployTemplateComponent } from './deploy-template.component';
+
+describe('DeployTemplateComponent', () => {
+  let component: DeployTemplateComponent;
+  let fixture: ComponentFixture<DeployTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ DeployTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(DeployTemplateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.component.ts
new file mode 100644 (file)
index 0000000..ab636b9
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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';
+import {FlatTreeControl} from '@angular/cdk/tree';
+import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
+
+interface FoodNode {
+  name: string;
+  children?: FoodNode[];
+}
+
+const TREE_DATA: FoodNode[] = [
+  {
+    name: 'Definitions',
+    children: [
+      {name: 'activation-blueprint.json'},
+      {name: 'artifacts_types.json'},
+      {name: 'data_types.json'},
+    ]
+  }, 
+  {
+    name: 'Scripts',
+    children: [
+      {
+        name: 'kotlin',
+        children: [
+          {name: 'ScriptComponent.cba.kts'},
+          {name: 'ResourceAssignmentProcessor.cba.kts'},
+        ]
+      }
+    ]
+  },
+  {
+    name: 'Templates',
+    children: [
+      {
+        name: 'baseconfig-template'
+      }
+    ]
+  },
+  {
+    name: 'TOSCA-Metada',
+    children: [
+      {
+        name: 'TOSCA.meta'
+      }
+    ]
+  },
+];
+
+/** Flat node with expandable and level information */
+interface ExampleFlatNode {
+  expandable: boolean;
+  name: string;
+  level: number;
+}
+
+@Component({
+  selector: 'app-deploy-template',
+  templateUrl: './deploy-template.component.html',
+  styleUrls: ['./deploy-template.component.scss']
+})
+export class DeployTemplateComponent implements OnInit {
+
+  private transformer = (node: FoodNode, level: number) => {
+    return {
+      expandable: !!node.children && node.children.length > 0,
+      name: node.name,
+      level: level,
+    };
+  }
+
+  treeControl = new FlatTreeControl<ExampleFlatNode>(
+      node => node.level, node => node.expandable);
+
+  treeFlattener = new MatTreeFlattener(
+      this.transformer, node => node.level, node => node.expandable, node => node.children);
+
+  dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
+
+  constructor() { 
+    this.dataSource.data = TREE_DATA;
+  }
+
+  hasChild = (_: number, node: ExampleFlatNode) => node.expandable;
+
+  ngOnInit() {
+  }
+
+  fileClicked(file) {
+    console.log('selected file:' + file);
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/deploy-template/deploy-template.module.ts
new file mode 100644 (file)
index 0000000..5d5a600
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { DeployTemplateComponent } from './deploy-template.component';
+import { DeployTemplateRoutingModule } from './deploy-template-routing.module';
+import { AppMaterialModule } from '../../../common/modules/app-material.module';
+
+@NgModule({
+  declarations: [
+    DeployTemplateComponent
+  ],
+  exports: [
+    DeployTemplateComponent
+  ],
+  imports: [
+    CommonModule,
+    DeployTemplateRoutingModule,
+    AppMaterialModule
+  ]
+})
+export class DeployTemplateModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.html b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.html
new file mode 100644 (file)
index 0000000..3ab8f24
--- /dev/null
@@ -0,0 +1,139 @@
+<!-- 
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+<div class="designerTmp">
+    <div class="outerDiv divone">
+        <mat-accordion>
+            <mat-expansion-panel>
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Node types
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+                <div class="flex-container">
+                    <div class="item-box" *ngFor="let item of todo" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel>
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Policy
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+                <div class="flex-container">
+                    <div class="item-box">Policy 1</div>
+                    <div class="item-box">Policy 1</div>
+                    <div class="item-box">Policy 1</div>
+                </div>
+            </mat-expansion-panel>
+        </mat-accordion>
+    </div>
+    <div class="outerDiv divtwo">
+        <svg id="svgArea" width="1000px" height="100%" style="background-color:white">
+        </svg>
+    </div>
+    <div id="overlay" class="outerDiv divThree">
+        <mat-accordion style="width: 100%">
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Type
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box">vnf-netconf-device</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel>
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Properties
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Interface
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box" *ngFor="let item of review" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Interface
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box" *ngFor="let item of review" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Artifacts
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box" *ngFor="let item of review" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Inputs
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box" *ngFor="let item of review" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+            <mat-expansion-panel (opened)="panelOpenState = true" (closed)="panelOpenState = false">
+                <mat-expansion-panel-header style="background-color: #f1f1f1">
+                    <mat-panel-title>
+                        Capabilities
+                    </mat-panel-title>
+                </mat-expansion-panel-header>
+
+                <div class="item-list">
+                    <div class="item-box" *ngFor="let item of review" cdkDrag>{{item}}</div>
+                </div>
+            </mat-expansion-panel>
+
+
+
+        </mat-accordion>
+    </div>
+</div>
\ 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
new file mode 100644 (file)
index 0000000..4af1072
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.outerDiv {
+    display: flex;
+    // align-items: center;
+    // justify-content: center;
+    margin: 1px;
+    padding: 16px;
+    border-radius: 8px;
+  }
+
+  .divone {
+    height: 100%;
+    width: 18%;
+    background-color: #D7D1D1;
+  }
+.divtwo {
+  height: 100%;
+    width: 100%;
+    background-color: #D7D1D1;
+}
+.divThree{
+  width: 30%;
+  height: 100%;
+  background-color: #D7D1D1;
+}
+
+.flex-container {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.flex-container > div {
+  background-color: #f1f1f1;
+  width: 53px;
+  margin: 2px;
+  text-align: center;
+  line-height: 53px;
+  font-size: 13px;
+}
+.cnv
+{
+  background-image: url('http://i.imgur.com/M3PFd.png');
+  background-position: 39px 32px;
+  background-repeat: repeat;
+  width: 100%
+}
+.designerTmp {
+  display: flex; 
+  flex-direction: row; 
+  height: 490px;
+  width: 100%
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.spec.ts
new file mode 100644 (file)
index 0000000..41d5792
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { DesignerComponent } from './designer.component';
+
+describe('DesignerComponent', () => {
+  let component: DesignerComponent;
+  let fixture: ComponentFixture<DesignerComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ DesignerComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(DesignerComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/designer/designer.component.ts
new file mode 100644 (file)
index 0000000..b8f88d9
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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, ElementRef, Output, EventEmitter } from '@angular/core';
+import * as d3 from 'd3';
+import { text } from 'd3';
+
+@Component({
+  selector: 'app-designer',
+  templateUrl: './designer.component.html',
+  styleUrls: ['./designer.component.scss']
+})
+export class DesignerComponent implements OnInit {
+  @Output() onNodeSelect = new EventEmitter();
+  @ViewChild('svgArea') graphContainer: ElementRef;
+  dataForsimulation;
+  svg;
+  svgWidth;
+  svgHeight;
+
+
+  simulation;
+
+  constructor() {    
+    this.dataForsimulation = {"nodes" :[],
+                              "links": []
+                            }
+    
+   
+    d3.json("../../../../../assets/activation-blueprint.json")
+    .then((data)=>{
+      console.log(data);
+      this.buildD3DataNodes(data);
+      //this.buildD3DataLinks(data);
+      this.drawNode();
+    });
+   }
+
+  ngOnInit() {
+  }
+
+  ngAfterContentInit()  {
+    
+  }
+
+  drawNode() {
+    this.svg = d3.select('#svgArea')
+              .style('back-ground-color', 'white');
+    
+    this.svgWidth = this.svg._groups[0][0].width.baseVal.value;
+    this.svgHeight = this.svg._groups[0][0].height.baseVal.value;
+
+    console.log('width', this.svgWidth);
+
+    let xbyMath;
+    let ybyMath;
+    let X= 10;
+    let Y=10;
+
+    let transformString = "translate(" + X + "," + Y + ")";
+    this.dataForsimulation.nodes.forEach((d, i)=> {
+      let id= 'g'+i;
+
+      // xbyMath =  Math.random() * ( this.svgWidth - 50 -  105  ) + ( 105/2 + 10 );
+      // ybyMath =  Math.random() * ( this.svgWidth - 20 -  100  ) + ( 100/2 + 10 );
+
+      xbyMath = Math.floor(Math.random() * ((this.svgWidth-110) - 100 + 1)) + 100;
+      ybyMath = Math.floor(Math.random() * ((this.svgHeight-110) - 100 + 1)) + 100;
+
+      transformString =  "translate(" + xbyMath + "," + ybyMath + ")"; 
+      
+      let gEleId = 'g'+i;
+      let nodeTemprectId = gEleId+name
+      let requirement = gEleId+name+'requirement';
+        this.svg.append('g')
+          .attr('id', gEleId);
+        
+        let firstg = d3.select('#g'+i)
+                    .attr('transform', transformString);
+
+        firstg.append('rect')
+              .attr('id', d.name)
+              .attr("x", 0)
+               .attr("y", 0)
+               .attr("rx", 20)
+                .attr("ry", 20)
+                .attr('width', 100)
+                .attr('height', 100)
+                .attr('fill', 'white')
+                 .attr('stroke', 'black')
+                 .attr('opacity', 0.6)
+                 .on('mouseover', () => this.handleMouseOver());
+
+          d.x = xbyMath;
+          d.y = ybyMath;
+                
+        firstg.append('circle')
+                    .attr('cx', 97)
+                    .attr('cy', 20)
+                    .attr('r', 5)
+                    .attr('fill', 'orange')
+
+        if(d.requirementsArray) {
+          d.requirementsArray.forEach(requirement =>{
+            firstg.append('circle')
+                      .attr('id', d.name+requirement.name)
+                      .attr('cx', 97)
+                      .attr('cy', 60)
+                      .attr('r', 5)
+                      .attr('fill', 'blue')
+            requirement.x = xbyMath + 95;
+            requirement.y = ybyMath + 60;
+          });
+        }
+
+        if(d.capabilitiesArray) {
+          d.capabilitiesArray.forEach(capability =>{
+            firstg.append('circle')
+                        .attr('id', d.name+capability.name)
+                        .attr('cx', 97)
+                        .attr('cy', 40)
+                        .attr('r', 5)
+                        .attr('fill', 'green');
+            capability.x = xbyMath + 97;
+            capability.y = ybyMath + 40;
+          }); 
+        }
+          
+        
+        firstg.append('text')
+                    .attr('x', 0)
+                    .attr('y', 115)
+                    .text(d.name);
+          
+       // X = X +120;
+       // Y = 10;
+    });
+    this.buildD3DataLinks();
+  }
+
+  buildD3DataNodes(data) {
+    let d3data;
+    d3data = data.topology_template.node_templates;
+    console.log('d3data:', d3data);
+    let finalData = [];
+    for (var property1 in d3data) {
+      d3data[property1].name = property1;
+      this.dataForsimulation.nodes.push(d3data[property1]);
+      finalData.push(d3data[property1]);
+    }
+
+    this.dataForsimulation.nodes.forEach(node => {
+      for( var nodeProperty in node) {
+        if(nodeProperty == 'requirements' || nodeProperty == 'capabilities') {
+            let arrayName = nodeProperty + 'Array';
+            node[arrayName] = [];
+            for(var reqProperty in node[nodeProperty]) {
+              node[nodeProperty][reqProperty].name = reqProperty;
+              node[arrayName].push(node[nodeProperty][reqProperty])
+            }
+            
+        console.log('node array:', + node[arrayName]);
+        }
+      }
+    });
+    console.log( this.dataForsimulation);
+  
+  
+  }
+
+ buildD3DataLinks() {
+  this.dataForsimulation.nodes.forEach((node) => {
+    if(node.requirementsArray && node.requirementsArray.length > 0) {
+      node.requirementsArray.forEach(requirement => {
+        let linkObject = {};
+        linkObject['sourceName'] = node.name + requirement.name;
+        linkObject['sourceid'] = node.name + requirement.name;
+        linkObject['sourceX'] = requirement.x;
+        linkObject['sourceY'] = requirement.y;
+        linkObject['targetNode'] = requirement.node;
+        linkObject['targetCapabilility'] = requirement.capability;
+        linkObject['ele'] = d3.select('#'+ linkObject['sourceid']);
+        this.dataForsimulation.links.push(linkObject);
+      });      
+    }
+  });
+
+  this.capabilityTargets();
+ }
+
+ capabilityTargets() {
+   this.dataForsimulation.links.forEach(link=>{
+    this.dataForsimulation.nodes.forEach(node=>{
+          if(node.name == link.targetNode && node.capabilitiesArray) {
+            node.capabilitiesArray.forEach(capability=>{
+              if(capability.name == link.targetCapabilility) {
+                link['targetX'] = capability.x;
+                link['targetY'] = capability.y;
+              }
+            })
+          }
+      });
+   });
+
+   this.drawlink();
+ }
+
+ drawlink() {
+   this.dataForsimulation.links.forEach(link=>{
+      this.svg.append('line')
+      .attr('x1', link.sourceX)
+      .attr('y1', link.sourceY)
+      .attr('x2', link.targetX)
+      .attr('y2', link.targetY)
+      .attr('stroke','gray')
+      .attr('stroke-width', 2);
+   });
+ }
+
+ handleMouseOver() {
+  console.log('mouse over');
+ }
+
+ trigerNodeSelectEvent(d) {
+  this.onNodeSelect.emit(d);
+}
+
+}
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
new file mode 100644 (file)
index 0000000..308f9cc
--- /dev/null
@@ -0,0 +1,42 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+
+<div class="container">
+    <div class="fileViewContainer">
+        <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>
+            <mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding>
+                <button mat-icon-button matTreeNodeToggle [attr.aria-label]="'toggle ' + node.name">
+                <mat-icon class="mat-icon-rtl-mirror">
+                  {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
+                </mat-icon>
+              </button>
+                <button mat-icon-button>{{node.name}}</button>
+            </mat-tree-node>
+        </mat-tree>
+    </div>
+    <div class="editorConatiner">
+        <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>
\ 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
new file mode 100644 (file)
index 0000000..2f16af7
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.container {
+    display: flex;
+    flex-direction: row;
+    margin-top: 8px;
+    .fileViewContainer {
+        width: 20%;
+        margin: 2px;
+        height: 490px !important;
+        overflow-x: scroll;
+        overflow-y: scroll;
+        background-color: #ebebeb;
+    }
+    .editorConatiner {
+        width: 80%;
+        background-color: gainsboro;
+        height: 490px !important;
+    }
+}
+
+.aceEditor {
+    overflow: hidden;
+    height: 100% !important;
+    background-color: white !important;
+    border: 1px solid #3f51b5;
+    // border-left: 5px solid #3f51b5;
+}
+.savebtn {
+    color: white;
+    background-color: #3f51b5;
+    position: absolute;
+    bottom: 5px;
+}
+.save-icon{
+    position: absolute;
+    left: 59em;
+    color: #3f51b5;
+    font-size: 24px;
+    cursor: pointer;
+    z-index: 1;
+}
+
+.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.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/editor/editor.component.spec.ts
new file mode 100644 (file)
index 0000000..64dcd11
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { EditorComponent } from './editor.component';
+
+describe('EditorComponent', () => {
+  let component: EditorComponent;
+  let fixture: ComponentFixture<EditorComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ EditorComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(EditorComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
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
new file mode 100644 (file)
index 0000000..e48177d
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { FlatTreeControl } from '@angular/cdk/tree';
+import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
+import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model';
+import "ace-builds/webpack-resolver";
+import 'brace';
+import 'brace/ext/language_tools';
+import 'ace-builds/src-min-noconflict/snippets/html';
+import * as JSZip from 'jszip';
+import { saveAs } from 'file-saver';
+
+import { IAppState } from '../../../../common/core/store/state/app.state';
+import { Store } from '@ngrx/store';
+import { Observable } from 'rxjs';
+import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model';
+import { LoadBlueprintSuccess, SetBlueprintState } from '../../../../common/core/store/actions/blueprint.action'
+
+
+interface Node {
+  name: string;
+  children?: Node[];
+  data?: any
+}
+
+const TREE_DATA: Node[] = [
+  {
+    name: 'Definitions',
+    children: [
+      { name: 'activation-blueprint.json' },
+      { name: 'artifacts_types.json' },
+      { name: 'data_types.json' },
+    ]
+  }
+];
+
+/** Flat node with expandable and level information */
+interface ExampleFlatNode {
+  expandable: boolean;
+  name: string;
+  level: number;
+}
+
+
+@Component({
+  selector: 'app-editor',
+  templateUrl: './editor.component.html',
+  styleUrls: ['./editor.component.scss']
+})
+export class EditorComponent implements OnInit {
+
+  @ViewChild('editor') editor;
+  blueprintdata: IBlueprint;
+  blueprint: IBlueprint;
+  bpState: Observable<IBlueprintState>;
+  text: string;
+  filesTree: any = [];
+  filesData: any = [];
+  selectedFile: string;
+  zipFolder: any;
+  blueprintName: string;
+  fileExtension: string;
+  mode: string;
+  private zipFile: JSZip = new JSZip();
+  activeNode: any;
+
+  private transformer = (node: Node, level: number) => {
+    return {
+      expandable: !!node.children && node.children.length > 0,
+      name: node.name,
+      level: level,
+    };
+  }
+
+  treeControl = new FlatTreeControl<ExampleFlatNode>(
+    node => node.level, node => node.expandable);
+
+  treeFlattener = new MatTreeFlattener(
+    this.transformer, node => node.level, node => node.expandable, node => node.children);
+
+  dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
+
+  constructor(private store: Store<IAppState>) {
+    this.dataSource.data = TREE_DATA;
+    this.bpState = this.store.select('blueprint');
+    // this.dataSource.data = TREE_DATA;
+  }
+
+  hasChild = (_: number, node: ExampleFlatNode) => node.expandable;
+
+  ngOnInit() {
+    this.editorContent();
+    this.dataSource.data = this.filesTree;
+  }
+
+  fileClicked(file) {
+    console.log('selected file:' + file);
+  }
+  editorContent() {
+    this.editor.setTheme("eclipse");
+    this.editor.getEditor().setOptions({
+      // enableBasicAutocompletion: true,
+      fontSize: "100%",
+      printMargin: false,
+    });
+    this.editor.getEditor().commands.addCommand({
+      name: "showOtherCompletions",
+      bindKey: "Ctrl-.",
+      exec: function (editor) {
+
+      }
+    })
+    this.bpState.subscribe(
+      blueprintdata => {
+        var blueprintState: IBlueprintState = { blueprint: blueprintdata.blueprint, isLoadSuccess: blueprintdata.isLoadSuccess, isSaveSuccess: blueprintdata.isSaveSuccess, isUpdateSuccess: blueprintdata.isUpdateSuccess };
+        this.blueprintdata = blueprintState.blueprint;
+        this.filesTree = blueprintdata.files;
+        this.filesData = blueprintdata.filesData;
+        this.dataSource.data = this.filesTree;
+        this.blueprintName = blueprintdata.name;
+        let blueprint = [];
+        for (let key in this.blueprintdata) {
+          if (this.blueprintdata.hasOwnProperty(key)) {
+            blueprint.push(this.blueprintdata[key]);
+          }
+        }
+        // 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);
+        this.setEditorMode();
+      })
+  }
+
+  updateBlueprint() {
+    console.log(this.blueprint);
+    this.filesData.forEach(fileNode => {
+      if (fileNode.name.includes(this.blueprintName.trim()) && fileNode.name.includes(this.selectedFile.trim())) {
+        fileNode.data = this.text;
+      } else if (fileNode.name.includes(this.selectedFile.trim())) {
+        fileNode.data = this.text;
+      }
+    });
+
+    if (this.selectedFile == this.blueprintName.trim()) {
+      this.blueprint = JSON.parse(this.text);
+    } else {
+      this.blueprint = this.blueprintdata;
+    }
+
+    let blueprintState = {
+      blueprint: this.blueprint,
+      name: this.blueprintName,
+      files: this.filesTree,
+      filesData: this.filesData
+    }
+    this.store.dispatch(new SetBlueprintState(blueprintState));
+    // console.log(this.text);
+  }
+
+  selectFileToView(file) {
+    this.selectedFile = file.name;
+    this.filesData.forEach((fileNode) => {
+      if (fileNode.name.includes(file.name)) {
+        this.text = fileNode.data;
+      }
+    })
+    this.fileExtension = this.selectedFile.substr(this.selectedFile.lastIndexOf('.') + 1);
+    // console.log(this.fileExtension);
+    this.setEditorMode();
+  }
+
+  SaveToBackend() {
+    this.zipFile.generateAsync({ type: "blob" })
+      .then(blob => {
+
+      });
+  }
+
+  deploy() {
+    // to do
+  }
+
+  create() {
+    this.filesData.forEach((path) => {
+      this.zipFile.file(path.name, path.data);
+    });
+  }
+
+  download() {
+    this.create();
+    var zipFilename = "baseconfiguration.zip";
+    this.zipFile.generateAsync({ type: "blob" })
+      .then(blob => {
+        saveAs(blob, zipFilename);
+      });
+  }
+  setEditorMode() {
+    switch (this.fileExtension) {
+      case "xml":
+        this.mode = 'xml';
+        break;
+      case "py":
+        this.mode = 'python';
+        break;
+      case "kts":
+        this.mode = 'kotlin';
+        break;
+      case "txt":
+        this.mode = 'text';
+        break;
+      case "meta":
+        this.mode = 'text';
+        break;
+      case "vtl":
+        this.mode = 'velocity';
+        break;
+      default:
+        this.mode = 'json';
+    }
+  }
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template-routing.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template-routing.module.ts
new file mode 100644 (file)
index 0000000..d1d140f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { ModifyTemplateComponent } from './modify-template.component';
+
+
+const routes: Routes = [
+    {
+        path: '',
+        component: ModifyTemplateComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class ModifyTemplateRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.html
new file mode 100644 (file)
index 0000000..a77be5b
--- /dev/null
@@ -0,0 +1,47 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+
+<div class="modifyTemp">
+  <app-designer *ngIf="designerMode" (onNodeSelect)="on = !on; viewNodeDetails($event)"></app-designer>
+  <app-editor class="editor-selector" *ngIf="editorMode"></app-editor>
+</div>
+
+<div style="display: flex;flex-direction: row">
+    <div style="width: 30em;">
+    <button class="btn-active" (click) ="changeView()">{{viewText}}</button>
+    </div>
+    <div style="width: 16em">        
+    </div>
+    <div style="width: 100%;height: 3em;">
+        <div style="display: flex;flex-direction: row-reverse">        
+        <button class="btn-active" (click)="downloadCBA()">Download</button>
+        <button [disabled]="!isEnriched" [ngClass]="{ 'mat-button-active': isEnriched, 'mat-button-disablled': !isEnriched}" mat-button [matMenuTriggerFor]="menu">Deploy</button>
+         <mat-menu #menu="matMenu">
+                  <button mat-menu-item>Deploy</button>
+                  <button mat-menu-item>Test</button>
+          </mat-menu>
+        <button [disabled]="!isEnriched" [ngClass]="{ 'btn-active': isEnriched, 'btn-disablled': !isEnriched}" class="btn-active">Publish</button>        
+        <button class="btn-active">Save</button>
+        <button class="btn-active">Enrich</button>
+  
+        </div>
+    </div>
+  </div>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.scss
new file mode 100644 (file)
index 0000000..609d6fa
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+
+.modifyTemp {
+    display: flex; 
+    flex-direction: row; 
+    height: 524px;
+    width: 100%
+}
+
+.enrich-btn {
+  cursor: pointer;
+  position: absolute;
+  top: 3.6em;
+  right: 10em;
+  padding: 6px;
+  color: white;
+  background-color:#3f51b5;
+  margin-right: 2em;
+  border-radius: 2em;
+  z-index: 1;
+}
+
+.toggle-view-btn {
+  cursor: pointer;
+  position: absolute;
+  top: 3.6em;
+  right: 3em;
+  padding: 6px;
+  color: white;
+  background-color:#3f51b5;
+  border-radius: 2em;
+  z-index: 1;
+}
+
+.editor-selector {
+  width: 100%;
+}
+
+.mat-button-active{
+  margin: 0.5em;
+    background-color: #3f51b5 !important;
+    color: white !important;
+    border-radius: 4px;
+    border: none;
+    line-height: none !important;
+    // padding: 0.5em;
+    min-width: 6em;
+    cursor: pointer;
+}
+
+.mat-button-disablled {
+    background-color: #c5cae8 !important;
+    border-radius: 4px;
+    color: darkgray !important;
+    line-height: none !important;
+    margin: 0.5em;
+    // padding: 0.5em;
+    min-width: 6em;
+    cursor: initial;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.spec.ts
new file mode 100644 (file)
index 0000000..a2bd046
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { ModifyTemplateComponent } from './modify-template.component';
+
+describe('ModifyTemplateComponent', () => {
+  let component: ModifyTemplateComponent;
+  let fixture: ComponentFixture<ModifyTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ModifyTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ModifyTemplateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.component.ts
new file mode 100644 (file)
index 0000000..e39ce01
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { EditorComponent } from './editor/editor.component';
+
+@Component({
+  selector: 'app-modify-template',
+  templateUrl: './modify-template.component.html',
+  styleUrls: ['./modify-template.component.scss']
+})
+export class ModifyTemplateComponent implements OnInit {
+
+  isEnriched: boolean = false;
+  designerMode: boolean = false;
+  editorMode: boolean = true;
+  viewText: string = "Designer View";
+
+  @ViewChild(EditorComponent) editorComp: EditorComponent;
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+  viewNodeDetails(nodeTemplate) {
+    console.log(nodeTemplate);
+  }
+
+  changeView() {
+    if(this.viewText == 'Editor View') {
+      this.editorMode =  true;
+      this.designerMode = false;
+      this.viewText = 'Designer View'
+    } else {
+      this.editorMode =  false;
+      this.designerMode = true;
+      this.viewText = 'Editor View'
+    }
+  }
+
+  downloadCBA() {
+    this.editorComp.download();
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/modify-template/modify-template.module.ts
new file mode 100644 (file)
index 0000000..3aef2a7
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { CdkTableModule } from '@angular/cdk/table';
+
+import { ModifyTemplateComponent } from './modify-template.component';
+import { ModifyTemplateRoutingModule } from './modify-template-routing.module';
+import { AppMaterialModule } from '../../../common/modules/app-material.module';
+import { DesignerComponent } from './designer/designer.component';
+import { EditorComponent } from './editor/editor.component';
+import { AceEditorModule } from 'ng2-ace-editor';
+
+@NgModule({
+  declarations: [
+    ModifyTemplateComponent,
+    DesignerComponent,
+    EditorComponent
+  ],
+  exports: [
+    ModifyTemplateComponent,
+    DesignerComponent,
+    AceEditorModule
+  ],
+  imports: [
+    CommonModule,
+    CdkTableModule,
+    AppMaterialModule,
+    ModifyTemplateRoutingModule,
+    AceEditorModule
+  ]
+})
+export class ModifyTemplateModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.html
new file mode 100644 (file)
index 0000000..cdfea25
--- /dev/null
@@ -0,0 +1,46 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 [formGroup]="CBAMetadataForm" (ngSubmit)="UploadMetadata()">
+    <div class="formDisplay">
+        <mat-form-field class="form-field">
+            <input matInput placeholder="Template Author" id="CBA_File_Name" formControlName="template_author">
+        </mat-form-field>
+        <mat-form-field class="form-field">
+            <input matInput placeholder="Author Email" id="author_email" formControlName="author_email">
+        </mat-form-field>
+        <mat-form-field class="form-field">
+            <input matInput placeholder="User Groups" id="user_groups" formControlName="user_groups">
+        </mat-form-field>
+    </div>
+    <div class="formDisplay">
+        <mat-form-field class="form-field">
+            <input matInput placeholder="Template Name" id="template_name" formControlName="template_name">
+        </mat-form-field>
+        <mat-form-field class="form-field">
+            <input matInput placeholder="Template Version" id="template_version" formControlName="template_version">
+        </mat-form-field>
+        <mat-form-field class="form-field">
+            <input matInput placeholder="Template Tags" id="template_tags" formControlName="template_tags">
+        </mat-form-field>
+    </div>
+    <button mat-button class="matBtn" type="submit" [disabled]="!CBAMetadataForm.valid">Save Metadata</button>
+</form>
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..1e49773
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-field {
+    width: 50%;
+    margin: 10px;
+}
+
+.formDisplay {
+    display: flex;
+    flex-direction: row;
+}
+
+.matBtn {
+    color: white;
+    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/metadata/metadata.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.spec.ts
new file mode 100644 (file)
index 0000000..a903ae0
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { MetadataComponent } from './metadata.component';
+
+describe('MetadataComponent', () => {
+  let component: MetadataComponent;
+  let fixture: ComponentFixture<MetadataComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ MetadataComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(MetadataComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/metadata/metadata.component.ts
new file mode 100644 (file)
index 0000000..2327a58
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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';
+import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+import { A11yModule } from '@angular/cdk/a11y';
+
+import { IAppState } from '../../../../common/core/store/state/app.state';
+import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model';
+import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model';
+import { IMetaData } from '../../../../common/core/store/models/metadata.model';
+import { LoadBlueprintSuccess } from 'src/app/common/core/store/actions/blueprint.action';
+
+@Component({
+  selector: 'app-metadata',
+  templateUrl: './metadata.component.html',
+  styleUrls: ['./metadata.component.scss']
+})
+export class MetadataComponent implements OnInit {
+  CBAMetadataForm: FormGroup;
+  metadata: IMetaData;
+  bpState: Observable<IBlueprintState>;
+  blueprint: IBlueprint;
+  
+  constructor(private formBuilder: FormBuilder, private store: Store<IAppState>) {
+    this.bpState = this.store.select('blueprint');
+    this.CBAMetadataForm = this.formBuilder.group({
+      template_author: ['', Validators.required],
+      author_email: ['', Validators.required],
+      user_groups: ['', Validators.required],
+      template_name: ['', Validators.required],
+      template_version: ['', Validators.required],
+      template_tags: ['', Validators.required]
+    });
+  }
+
+  ngOnInit() {
+    this.bpState.subscribe(
+      blueprintdata => {
+        var blueprintState: IBlueprintState = { blueprint: blueprintdata.blueprint, isLoadSuccess: blueprintdata.isLoadSuccess, isSaveSuccess: blueprintdata.isSaveSuccess, isUpdateSuccess: blueprintdata.isUpdateSuccess };
+        this.metadata = blueprintState.blueprint.metadata;
+        this.blueprint = blueprintState.blueprint;
+        let metadatavalues = [];
+        for (let key in this.metadata) {
+          if (this.metadata.hasOwnProperty(key)) {
+            metadatavalues.push(this.metadata[key]);
+          }
+        }
+        let temp_author = metadatavalues[0];
+        console.log(temp_author);
+        this.CBAMetadataForm = this.formBuilder.group({
+          template_author: [metadatavalues[0], Validators.required],
+          author_email: [metadatavalues[1], Validators.required],
+          user_groups: [metadatavalues[2], Validators.required],
+          template_name: [metadatavalues[3], Validators.required],
+          template_version: [metadatavalues[4], Validators.required],
+          template_tags: [metadatavalues[5], Validators.required]
+        });
+      })
+  }
+
+  UploadMetadata() {
+    this.metadata = Object.assign({}, this.CBAMetadataForm.value);
+    this.blueprint.metadata = this.metadata;
+    this.store.dispatch(new LoadBlueprintSuccess(this.blueprint));
+  }
+
+}
\ 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
new file mode 100644 (file)
index 0000000..b58be9f
--- /dev/null
@@ -0,0 +1,26 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+<div>
+    <input type="file" accept=".zip" (change)="fileChanged($event)">
+</div>
+<div>
+    <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
new file mode 100644 (file)
index 0000000..beb05e2
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.matStepNextBtn {
+    color: white;
+    background-color: #3f51b5;
+    margin-top: 10px;
+    position: absolute;
+    margin-bottom: 5px;
+    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/search-template/search-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.spec.ts
new file mode 100644 (file)
index 0000000..5bf914c
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { SearchTemplateComponent } from './search-template.component';
+
+describe('SearchTemplateComponent', () => {
+  let component: SearchTemplateComponent;
+  let fixture: ComponentFixture<SearchTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ SearchTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(SearchTemplateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/search-template/search-template.component.ts
new file mode 100644 (file)
index 0000000..777faee
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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, EventEmitter, Output, ViewChild } from '@angular/core';
+import { Store } from '@ngrx/store';
+import * as JSZip from 'jszip';
+import { Observable } from 'rxjs';
+
+import { IBlueprint } from '../../../../common/core/store/models/blueprint.model';
+import { IBlueprintState } from '../../../../common/core/store/models/blueprintState.model';
+import { IAppState } from '../../../../common/core/store/state/app.state';
+import { LoadBlueprintSuccess, SET_BLUEPRINT_STATE, SetBlueprintState } from '../../../../common/core/store/actions/blueprint.action';
+import { json } from 'd3';
+
+@Component({
+  selector: 'app-search-template',
+  templateUrl: './search-template.component.html',
+  styleUrls: ['./search-template.component.scss']
+})
+export class SearchTemplateComponent implements OnInit {
+  file: File;
+  localBluePrintData: IBlueprint;
+  fileText: object[];
+  blueprintState: IBlueprintState;
+  bpState: Observable<IBlueprintState>;
+  validfile: boolean = false;
+
+  @ViewChild('fileInput') fileInput;
+  result: string = '';
+
+  private paths = [];
+  private tree;
+  private zipFile: JSZip = new JSZip();
+  private fileObject: any;
+  private activationBlueprint: any;
+  private tocsaMetadaData: any;
+  private blueprintName: string;
+
+  constructor(private store: Store<IAppState>) { }
+
+  ngOnInit() {
+  }
+
+  fileChanged(e: any) {
+    this.file = e.target.files[0];
+    this.zipFile.files = {};
+    this.zipFile.loadAsync(this.file)
+      .then((zip) => {
+        if(zip) {            
+          this.buildFileViewData(zip);
+        }
+      });
+  }
+
+  updateBlueprintState() {
+    let data: IBlueprint = this.activationBlueprint ? JSON.parse(this.activationBlueprint.toString()) : this.activationBlueprint;
+    let blueprintState = {
+      blueprint: data,
+      name: this.blueprintName,
+      files: this.tree,
+      filesData: this.paths
+    }
+    this.store.dispatch(new SetBlueprintState(blueprintState))
+    // this.store.dispatch(new LoadBlueprintSuccess(data));
+  }
+
+  async buildFileViewData(zip) {
+    this.validfile = false;
+    this.paths = [];
+    for (var file in zip.files) {
+      this.fileObject = {
+        name: zip.files[file].name,
+        data: ''
+      };
+      const value = <any>await  zip.files[file].async('string');
+      this.fileObject.data = value;
+      this.paths.push(this.fileObject); 
+    }
+
+    if(this.paths) {
+      this.paths.forEach(path =>{
+        if(path.name.includes("TOSCA.meta")) {
+          this.validfile = true
+        }
+      });
+    } else {
+      alert('Please update proper file');
+    }
+
+    if(this.validfile) {      
+      this.fetchTOSACAMetadata();
+      this.tree = this.arrangeTreeData(this.paths);
+    } else {
+      alert('Please update proper file with TOSCA metadata');
+    }
+  }
+
+  arrangeTreeData(paths) {
+    const tree = [];
+
+    paths.forEach((path) => {
+
+      const pathParts = path.name.split('/');
+      pathParts.shift();
+      let currentLevel = tree;
+
+      pathParts.forEach((part) => {
+        const existingPath = currentLevel.filter(level => level.name === part);
+
+        if (existingPath.length > 0) {
+          currentLevel = existingPath[0].children;
+        } else {
+          const newPart = {
+            name: part,
+            children: [],
+            data: path.data
+          };
+          if(part.trim() == this.blueprintName.trim()) { 
+            this.activationBlueprint = path.data; 
+            newPart.data = JSON.parse(this.activationBlueprint.toString());            
+            console.log('newpart', newPart);
+          }
+          if(newPart.name !== '') {            
+              currentLevel.push(newPart);
+              currentLevel = newPart.children;
+          }
+        }
+      });
+    });
+    console.log('tree', tree);
+    return tree;
+  }
+
+  fetchTOSACAMetadata() {
+    let toscaData = {};
+    this.paths.forEach(file =>{
+      if(file.name.includes('TOSCA.meta')) {
+        let keys = file.data.split("\n");
+        keys.forEach((key)=>{
+          let propertyData = key.split(':');
+          toscaData[propertyData[0]] = propertyData[1];
+        });
+      }
+    });
+    this.blueprintName = (((toscaData['Entry-Definitions']).split('/'))[1]).toString();;
+    console.log(toscaData);
+  }
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template-routing.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template-routing.module.ts
new file mode 100644 (file)
index 0000000..ab310bd
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.html
new file mode 100644 (file)
index 0000000..d11b371
--- /dev/null
@@ -0,0 +1,49 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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-vertical-stepper linear>
+    <mat-step [stepControl]="step1FormGroup">
+        <ng-template matStepLabel>Choose CBA Template file</ng-template>
+        <div class="matStepContent">
+            <app-template-options></app-template-options>
+            <br>
+            <div>
+                <button mat-button matStepperNext class="matStepNextBtn">Proceed</button>
+            </div>
+        </div>
+    </mat-step>
+
+    <mat-step [stepControl]="step2FormGroup">
+        <ng-template matStepLabel>Browse CBA Template file</ng-template>
+        <div class="matStepContent">
+            <app-search-template (cbaFile)="fileChange($event)"></app-search-template>
+            <!-- <div>
+                <button mat-button matStepperNext class="matStepNextBtn">Upload</button>
+            </div>-->
+        </div>
+    </mat-step>
+    <mat-step [stepControl]="step3FormGroup">
+        <ng-template matStepLabel>Enter Metadata details</ng-template>
+        <div class="matStepContent">
+            <app-metadata (metadataform)="metaDataDetail($event)"></app-metadata>
+        </div>
+    </mat-step>
+</mat-vertical-stepper>
+<button mat-button matStepperNext class="matStepNextBtn">Next</button>
\ 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
new file mode 100644 (file)
index 0000000..37d1feb
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.matStepNextBtn {
+    color: white;
+    background-color: #3f51b5;
+    margin-top: 10px;
+    position: absolute;
+    margin-bottom: 5px;
+    border-radius: 4px;    
+    min-width: 6em;
+    cursor: pointer;
+}
+
+.matStepContent {
+    margin-top: 15px !important;
+    margin-bottom: 20px !important;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.spec.ts
new file mode 100644 (file)
index 0000000..92ce13e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.component.ts
new file mode 100644 (file)
index 0000000..d9591dd
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model';
+import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model';
+import { IMetaData } from 'src/app/common/core/store/models/metadata.model';
+import { IImportModel } from 'src/app/common/core/store/models/imports.model';
+import { ITopologyTemplate } from 'src/app/common/core/store/models/itopologytemplate.model';
+
+@Component({
+  selector: 'app-select-template',
+  templateUrl: './select-template.component.html',
+  styleUrls: ['./select-template.component.scss']
+})
+export class SelectTemplateComponent implements OnInit {
+  blueprint: IBlueprint;
+  topologyTemplate: ITopologyTemplate;
+  metaData: IMetaData;
+  blueprintState: IBlueprintState;
+  importModel: IImportModel;
+
+  constructor(private store: Store<IBlueprintState>) {
+    // this.importModel.file = '';
+  }
+
+  ngOnInit() {
+  }
+  fileChange(topologyTemp: ITopologyTemplate) {
+    this.topologyTemplate = topologyTemp;
+    console.log(topologyTemp);
+  }
+  metaDataDetail(data: IMetaData) {
+    
+    this.metaData = data;
+    console.log("parent" + this.metaData.author_email);
+  }
+  upload() {
+
+  }
+  // saveBlueprintModel(){
+  //   this.blueprint.toplogyTemplates=this.topologyTemplate;
+  //   this.blueprint.metadata= this.metaData;
+  //  // this.store.dispatch(new CreateBlueprint(this.blueprint));
+  // }
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/select-template.module.ts
new file mode 100644 (file)
index 0000000..16947d4
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { ReactiveFormsModule } from '@angular/forms';
+import { TemplateOptionsComponent } from './template-options/template-options.component';
+import { SearchTemplateComponent } from './search-template/search-template.component';
+import { MetadataComponent } from './metadata/metadata.component';
+import { SelectTemplateComponent } from './select-template.component';
+import { SelectTemplateRoutingModule } from './select-template-routing.module';
+import { AppMaterialModule } from 'src/app/common/modules/app-material.module';
+
+@NgModule({
+  declarations: [
+    TemplateOptionsComponent,
+    SearchTemplateComponent,
+    MetadataComponent,
+    SelectTemplateComponent
+  ],
+   exports: [
+    TemplateOptionsComponent,
+    SearchTemplateComponent,
+    MetadataComponent,
+    SelectTemplateComponent
+  ],
+  imports: [
+    CommonModule,
+    SelectTemplateRoutingModule,
+    ReactiveFormsModule,
+    AppMaterialModule
+  ]
+})
+export class SelectTemplateModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.html b/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.html
new file mode 100644 (file)
index 0000000..9c2d721
--- /dev/null
@@ -0,0 +1,25 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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)">Upload Template file</mat-radio-button><br><br>
+  <mat-radio-button value="2" (click)="selected(2)">Starter Template</mat-radio-button><br><br>
+  <mat-radio-button value="3" (click)="selected(3)">Existing Model File</mat-radio-button>
+</mat-radio-group>
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.scss
new file mode 100644 (file)
index 0000000..22941b5
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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/blueprint/select-template/template-options/template-options.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.spec.ts
new file mode 100644 (file)
index 0000000..dcbdd7d
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/select-template/template-options/template-options.component.ts
new file mode 100644 (file)
index 0000000..3b598b2
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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';
+import { HttpClient } from '@angular/common/http';
+@Component({
+  selector: 'app-template-options',
+  templateUrl: './template-options.component.html',
+  styleUrls: ['./template-options.component.scss']
+})
+export class TemplateOptionsComponent implements OnInit {
+  selectedOption: string;
+  @Output() option = new EventEmitter();
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+  selected(value){
+    console.log(value);
+    this.option.emit(value);
+  }
+  // loadTemplateData() {
+  //  // to do
+  // }
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template-routing.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template-routing.module.ts
new file mode 100644 (file)
index 0000000..321f80c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { TestTemplateComponent } from './test-template.component';
+
+const routes: Routes = [
+    {
+        path: '',
+        component: TestTemplateComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class TestTemplateRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.html
new file mode 100644 (file)
index 0000000..da3580c
--- /dev/null
@@ -0,0 +1,39 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+<div class="testTemplateContainer">
+
+    <div class="editorContainer">
+        <div class="editorDiv">
+            <p>Request</p>
+            <ace-editor [(text)]="text" mode="json" [theme]="eclipse" [options]="options" #editor class="aceEditor"></ace-editor>
+            <div class="btnContainer">
+                <button class="button">Submit</button>
+                <button class="button">Clear</button>
+            </div>
+        </div>
+
+        <div class="editorDiv">
+            <p>Response</p>
+            <ace-editor [(text)]="text" mode="json" [theme]="eclipse" [options]="options" #editor class="aceEditor"></ace-editor>
+        </div>
+    </div>
+
+</div>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.scss b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.scss
new file mode 100644 (file)
index 0000000..49d5599
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+.aceEditor {
+    overflow: hidden;
+    // height: 100% !important;
+    min-height: 27rem;
+    background-color: white !important;
+    border: 1px solid #3f87a6;
+    border-left: 3px solid #3f87a6;
+    line-height: 1.2;
+    width: 99%;
+}
+
+.button {
+    margin: 1em;
+    background-color: #3f51b5;
+    color: white;
+    border-radius: 2em;
+    padding: 0.5em;
+    min-width: 6em;
+}
+
+.testTemplateContainer {
+    display: flex;
+    flex-direction: row
+}
+.editorContainer {
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    margin-left: 1em
+}
+
+.editorDiv {
+    width: 50%; 
+    margin: 2px;
+}
+
+.btnContainer {
+    height: 10%
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.spec.ts
new file mode 100644 (file)
index 0000000..e4adb2e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { TestTemplateComponent } from './test-template.component';
+
+describe('TestTemplateComponent', () => {
+  let component: TestTemplateComponent;
+  let fixture: ComponentFixture<TestTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ TestTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(TestTemplateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.component.ts
new file mode 100644 (file)
index 0000000..9a7a570
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { FlatTreeControl } from '@angular/cdk/tree';
+import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
+import { Observable, Subscription } from 'rxjs';
+import { Store } from '@ngrx/store';
+
+import { IAppState } from '../../../common/core/store/state/app.state';
+import { IBlueprintState } from 'src/app/common/core/store/models/blueprintState.model';
+import { IBlueprint } from 'src/app/common/core/store/models/blueprint.model';
+import { IMetaData } from '../../../common/core/store/models/metadata.model';
+import { LoadBlueprintSuccess } from 'src/app/common/core/store/actions/blueprint.action';
+
+import "ace-builds/webpack-resolver";
+import 'brace';
+import 'brace/ext/language_tools';
+import 'ace-builds/src-min-noconflict/snippets/html';
+
+@Component({
+  selector: 'app-test-template',
+  templateUrl: './test-template.component.html',
+  styleUrls: ['./test-template.component.scss']
+})
+export class TestTemplateComponent implements OnInit {
+  private blueprintpState: Subscription;
+  private request;
+  private workflows = [];
+  @ViewChild('editor') editor;
+  options: any = { fontSize: "100%", printMargin: false, tabSize: 2 };
+
+  constructor(private store: Store<IAppState>) {
+    this.blueprintpState = this.store.select('blueprint')
+      .subscribe((data: any) => {
+        console.log(data);
+        if (data && data.blueprint && data.blueprint.topology_template && data.blueprint.topology_template.workflows) {
+          this.buildWorkflowData(data.blueprint.topology_template.workflows);
+          // this.request = JSON.stringify(data.blueprint.topology_template.workflows[0], undefined, 4);
+        }
+      });
+
+  }
+
+  ngOnInit() {
+  }
+
+  fileClicked(file) {
+    console.log('selected file:' + file);
+  }
+
+  buildWorkflowData(data) {
+    this.workflows = [];
+    for (var property1 in data) {
+      data[property1].name = property1;
+      this.workflows.push(data[property1])
+    }
+    this.request = this.workflows[0];
+  }
+
+  createRequest(workflow) {
+    this.request = JSON.stringify(workflow, undefined, 4);
+
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.module.ts b/cds-ui/client/src/app/feature-modules/blueprint/test-template/test-template.module.ts
new file mode 100644 (file)
index 0000000..ea5b5ff
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { TestTemplateComponent } from './test-template.component';
+import { TestTemplateRoutingModule } from './test-template-routing.module';
+import { AppMaterialModule } from '../../../common/modules/app-material.module';
+import { AceEditorModule } from 'ng2-ace-editor';
+
+@NgModule({
+  declarations: [
+    TestTemplateComponent
+  ],
+  exports: [
+    TestTemplateComponent
+  ],
+  imports: [
+    CommonModule,
+    AppMaterialModule,
+    TestTemplateRoutingModule,
+    AceEditorModule
+  ]
+})
+export class TestTemplateModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/README.md b/cds-ui/client/src/app/feature-modules/resource-definition/README.md
new file mode 100644 (file)
index 0000000..c50b363
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+This folder contains the code related to data dictionary.
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model-routing.module.ts
new file mode 100644 (file)
index 0000000..3935b65
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* ============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';
+
+const routes: Routes = [];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class ExistingModelRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.html
new file mode 100644 (file)
index 0000000..4910663
--- /dev/null
@@ -0,0 +1,22 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+
+<app-search-resource></app-search-resource>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.scss
new file mode 100644 (file)
index 0000000..cafd2bf
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+* ============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/existing-model/existing-model.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.spec.ts
new file mode 100644 (file)
index 0000000..97b3d73
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { ExistingModelComponent } from './existing-model.component';
+
+describe('ExistingModelComponent', () => {
+  let component: ExistingModelComponent;
+  let fixture: ComponentFixture<ExistingModelComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ExistingModelComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ExistingModelComponent);
+    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/existing-model/existing-model.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.component.ts
new file mode 100644 (file)
index 0000000..f780ef8
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* ============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-existing-model',
+  templateUrl: './existing-model.component.html',
+  styleUrls: ['./existing-model.component.scss']
+})
+export class ExistingModelComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/existing-model.module.ts
new file mode 100644 (file)
index 0000000..2963cfc
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* ============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 { SearchResourceComponent } from './search-resource/search-resource.component';
+import { ExistingModelRoutingModule } from './existing-model-routing.module';
+import { ExistingModelComponent } from './existing-model.component';
+
+@NgModule({
+  declarations: [ExistingModelComponent,SearchResourceComponent],
+  imports: [
+    CommonModule,
+    ExistingModelRoutingModule,
+    SearchResourceComponent,
+  ],
+  exports:[ExistingModelComponent,
+    SearchResourceComponent]
+})
+export class ExistingModelModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html
new file mode 100644 (file)
index 0000000..ab69628
--- /dev/null
@@ -0,0 +1,31 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+<form class="example-form" [formGroup]="myControl">
+  <mat-form-field class="example-full-width">
+    <input type="text" [(ngModel)]="searchText" placeholder="Search Resources" matInput [matAutocomplete]="auto" formControlName="search_input">
+    <button matSuffix mat-icon-button><mat-icon>search</mat-icon></button>
+    <mat-autocomplete #auto="matAutocomplete">
+      <mat-option *ngFor="let option of options | search : searchText" [value]="option">
+        {{option}}
+      </mat-option>
+    </mat-autocomplete>
+  </mat-form-field>
+</form>
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.scss
new file mode 100644 (file)
index 0000000..cafd2bf
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+* ============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/existing-model/search-resource/search-resource.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.spec.ts
new file mode 100644 (file)
index 0000000..9051a86
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { SearchResourceComponent } from './search-resource.component';
+
+describe('SearchResourceComponent', () => {
+  let component: SearchResourceComponent;
+  let fixture: ComponentFixture<SearchResourceComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ SearchResourceComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(SearchResourceComponent);
+    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/existing-model/search-resource/search-resource.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts
new file mode 100644 (file)
index 0000000..16129b7
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+* ============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';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+@Component({
+  selector: 'app-search-resource',
+  templateUrl: './search-resource.component.html',
+  styleUrls: ['./search-resource.component.scss']
+})
+export class SearchResourceComponent implements OnInit  {
+
+   myControl: FormGroup;
+
+  constructor(private _formBuilder: FormBuilder)  { }
+  
+  options: string[] = ['One','One1', 'Two', 'Three'];
+    
+    ngOnInit() {
+    this.myControl = this._formBuilder.group({
+      search_input: ['', Validators.required]
+    });
+  }
+    
+}
+
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template-routing.module.ts
new file mode 100644 (file)
index 0000000..896d5aa
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* ============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';
+
+const routes: Routes = [];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class NewTemplateRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.html
new file mode 100644 (file)
index 0000000..944c7c6
--- /dev/null
@@ -0,0 +1,24 @@
+<!--/*
+* ============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>
+  new-template works!
+</p>
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.scss
new file mode 100644 (file)
index 0000000..cafd2bf
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+* ============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/new-template/new-template.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.spec.ts
new file mode 100644 (file)
index 0000000..b0b701e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { NewTemplateComponent } from './new-template.component';
+
+describe('NewTemplateComponent', () => {
+  let component: NewTemplateComponent;
+  let fixture: ComponentFixture<NewTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ NewTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(NewTemplateComponent);
+    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/new-template/new-template.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.component.ts
new file mode 100644 (file)
index 0000000..3d1412a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* ============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-new-template',
+  templateUrl: './new-template.component.html',
+  styleUrls: ['./new-template.component.scss']
+})
+export class NewTemplateComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/new-template/new-template.module.ts
new file mode 100644 (file)
index 0000000..666ac34
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+* ============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 { NewTemplateRoutingModule } from './new-template-routing.module';
+
+@NgModule({
+  declarations: [],
+  imports: [
+    CommonModule,
+    NewTemplateRoutingModule
+  ]
+})
+export class NewTemplateModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation-routing.module.ts
new file mode 100644 (file)
index 0000000..6b7a238
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* ============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 { ResourceCreationComponent } from './resource-creation.component' ;
+const routes: Routes = [
+    {
+        path: '',
+        component: ResourceCreationComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class ResourceCreationRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.html
new file mode 100644 (file)
index 0000000..8ace910
--- /dev/null
@@ -0,0 +1,45 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+<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 Resource file</ng-template>
+    <br>
+    <app-resource-template-options (options)="selectedOption($event)"></app-resource-template-options>
+    <br>
+    <div>
+      <button mat-button matStepperNext class="matStepNextBtn">Proceed</button>
+    </div>
+  </mat-step>
+  <mat-step [stepControl]="step2FormGroup">
+    <ng-template matStepLabel>Browse or Search Resources</ng-template>
+  <app-upload-resource (fileData)=upload($event)></app-upload-resource><br><br>
+  <app-existing-model></app-existing-model>
+    <div>
+      <button mat-button matStepperNext (click)="updateResourcesState()" class="matStepNextBtn">Upload</button>
+    </div>
+  </mat-step>
+ </mat-vertical-stepper>
+ </mat-card-content>
+</mat-card>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.scss
new file mode 100644 (file)
index 0000000..b3b7fe7
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+* ============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=========================================================
+*/
+.matStepNextBtn{
+    color:white;
+    background:#3f51b5; 
+    margin-top: 10px; 
+    position: absolute;
+    border-radius: 1em;
+}
+.ver-card {
+  width: 100%;  
+  background-color: #f1f1f1;
+   padding: 0.01em 16px;
+    margin: 20px 0;
+    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;
+    height: auto;
+}
+.mat-card-header{
+    height:35px;
+}
+.mat-card-content{
+    width: auto;
+    background-color: #fff;
+    padding: 8px 8px;
+    // border-left: 4px solid #4CAF50;
+    word-wrap: break-word;
+    min-height:350px;
+    height: auto;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.spec.ts
new file mode 100644 (file)
index 0000000..77d9c68
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { ResourceCreationComponent } from './resource-creation.component';
+
+describe('ResourceCreationComponent', () => {
+  let component: ResourceCreationComponent;
+  let fixture: ComponentFixture<ResourceCreationComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ResourceCreationComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ResourceCreationComponent);
+    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/resource-creation.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.component.ts
new file mode 100644 (file)
index 0000000..c751e0e
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+* ============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';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+import { IResources } from 'src/app/common/core/store/models/resources.model';
+import { IAppState } from '../../../common/core/store/state/app.state';
+import { LoadResourcesSuccess } from 'src/app/common/core/store/actions/resources.action';
+
+@Component({
+  selector: 'app-resource-creation',
+  templateUrl: './resource-creation.component.html',
+  styleUrls: ['./resource-creation.component.scss']
+})
+export class ResourceCreationComponent implements OnInit {
+
+  myFile: any;
+  selectedValue: any;
+  constructor(private store: Store<IAppState>) {
+  }
+
+  ngOnInit() {  
+  }
+    
+  upload(value){
+    this.myFile=value; 
+ }
+    
+ updateResourcesState() {
+    let fileReader = new FileReader();
+    fileReader.readAsText(this.myFile);
+    var me = this;
+    fileReader.onload = function () {
+    var data: IResources = JSON.parse(fileReader.result.toString());
+    me.store.dispatch(new LoadResourcesSuccess(data));
+    console.log(data);
+    }
+ }
+
+ selectedOption(value){
+    this.selectedValue=value;
+    console.log(this.selectedValue);        
+ }
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-creation.module.ts
new file mode 100644 (file)
index 0000000..7003f4c
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+* ============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 { ResourceCreationRoutingModule } from './resource-creation-routing.module';
+import { ResourceCreationComponent } from './resource-creation.component';
+import { ResourceTemplateOptionsComponent } from './resource-template-options/resource-template-options.component';
+import { MatAutocompleteModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule,  MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material';
+import { UploadResourceComponent } from './upload-resource/upload-resource.component';
+import { NewTemplateComponent } from './new-template/new-template.component';
+import { ExistingModelComponent } from './existing-model/existing-model.component';
+import { SearchResourceComponent } from './existing-model/search-resource/search-resource.component';
+import { SharedModule } from '../../../../app/common/shared/shared.module';
+import { FormsModule,ReactiveFormsModule } from '@angular/forms';
+
+@NgModule({
+    
+ declarations: [
+    ResourceCreationComponent,
+    ResourceTemplateOptionsComponent,
+    UploadResourceComponent,
+    NewTemplateComponent,
+    ExistingModelComponent,
+    SearchResourceComponent,
+    
+  ],
+  exports: [
+    ResourceCreationComponent,
+    ResourceTemplateOptionsComponent,
+    UploadResourceComponent,
+    NewTemplateComponent,
+    ExistingModelComponent,
+    SearchResourceComponent,
+    SharedModule
+  ],
+  imports: [
+    CommonModule,
+    SharedModule,
+    FormsModule,
+    ReactiveFormsModule,
+    ResourceCreationRoutingModule,
+    MatToolbarModule,
+    MatIconModule, 
+    MatButtonModule, 
+    MatSidenavModule,  
+    MatCheckboxModule, 
+    MatListModule, 
+    MatGridListModule, 
+    MatCardModule, 
+    MatMenuModule, 
+    MatTableModule, 
+    MatPaginatorModule, 
+    MatSortModule, 
+    MatInputModule, 
+    MatSelectModule, 
+    MatRadioModule, 
+    MatFormFieldModule, 
+    MatStepperModule,
+    MatAutocompleteModule
+    ]
+})
+export class ResourceCreationModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.html
new file mode 100644 (file)
index 0000000..a0e6b15
--- /dev/null
@@ -0,0 +1,24 @@
+<!--\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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
+<mat-radio-group>\r
+  <mat-radio-button value="1" (click)="selected(1)">Upload Resource File</mat-radio-button><br><br>\r
+  <mat-radio-button value="2" (click)="selected(2)">New Resource</mat-radio-button><br><br>\r
+  <mat-radio-button value="3" (click)="selected(3)">Existing Model Resource</mat-radio-button>\r
+</mat-radio-group>\r
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.scss
new file mode 100644 (file)
index 0000000..2205ac8
--- /dev/null
@@ -0,0 +1,19 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.spec.ts
new file mode 100644 (file)
index 0000000..2061ed2
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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 { async, ComponentFixture, TestBed } from '@angular/core/testing';\r
+\r
+import { ResourceTemplateOptionsComponent } from './resource-template-options.component';\r
+\r
+describe('ResourceTemplateOptionsComponent', () => {\r
+  let component: ResourceTemplateOptionsComponent;\r
+  let fixture: ComponentFixture<TemplateOptionsComponent>;\r
+\r
+  beforeEach(async(() => {\r
+    TestBed.configureTestingModule({\r
+      declarations: [ ResourceTemplateOptionsComponent ]\r
+    })\r
+    .compileComponents();\r
+  }));\r
+\r
+  beforeEach(() => {\r
+    fixture = TestBed.createComponent(ResourceTemplateOptionsComponent);\r
+    component = fixture.componentInstance;\r
+    fixture.detectChanges();\r
+  });\r
+\r
+  it('should create', () => {\r
+    expect(component).toBeTruthy();\r
+  });\r
+});\r
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/resource-template-options/resource-template-options.component.ts
new file mode 100644 (file)
index 0000000..1c6efc9
--- /dev/null
@@ -0,0 +1,44 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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 { Component, OnInit, Output, EventEmitter} from '@angular/core';\r
+import { HttpClient } from '@angular/common/http';\r
+@Component({\r
+  selector: 'app-resource-template-options',\r
+  templateUrl: './resource-template-options.component.html',\r
+  styleUrls: ['./resource-template-options.component.scss']\r
+})\r
+export class ResourceTemplateOptionsComponent implements OnInit {\r
+  selectedOption: string;\r
+  @Output() option = new EventEmitter();\r
+\r
+  constructor() { }\r
+\r
+  ngOnInit() {\r
+  }\r
+\r
+  selected(value){\r
+    console.log(value);\r
+    this.option.emit(value);\r
+  }\r
+  // loadTemplateData() {\r
+  //  // to do\r
+  // }\r
+}\r
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource-routing.module.ts
new file mode 100644 (file)
index 0000000..73e6459
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+* ============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';
+
+const routes: Routes = [];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class UploadResourceRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.html
new file mode 100644 (file)
index 0000000..3d60dab
--- /dev/null
@@ -0,0 +1,24 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+
+<div>
+    <input #myInput type="file" accept=".json" (change)="fileChanged($event)">
+</div>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.scss
new file mode 100644 (file)
index 0000000..cafd2bf
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+* ============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/upload-resource.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.spec.ts
new file mode 100644 (file)
index 0000000..9893230
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { UploadResourceComponent } from './upload-resource.component';
+
+describe('UploadResourceComponent', () => {
+  let component: UploadResourceComponent;
+  let fixture: ComponentFixture<UploadResourceComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ UploadResourceComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(UploadResourceComponent);
+    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/upload-resource.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.component.ts
new file mode 100644 (file)
index 0000000..ac3561a
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+* ============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, EventEmitter, Output } from '@angular/core';
+import { IResources } from 'src/app/common/core/store/models/resources.model';
+import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model';
+import { LoadResourcesSuccess } from 'src/app/common/core/store/actions/resources.action';
+import { IAppState } from '../../../../common/core/store/state/app.state';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+
+@Component({
+  selector: 'app-upload-resource',
+  templateUrl: './upload-resource.component.html',
+  styleUrls: ['./upload-resource.component.scss']
+})
+export class UploadResourceComponent implements OnInit {
+
+  @Output() fileData = new EventEmitter();
+  file: File;
+  localResourcesData: IResources;
+  fileText: object[];
+  blueprintState: IResourcesState;
+  bpState: Observable<IResourcesState>;
+
+  constructor(private store: Store<IAppState>) { }
+
+  ngOnInit() {
+  }
+
+  fileChanged(e: any) {
+    this.file = e.target.files[0];
+    this.fileData.emit(this.file);  
+  }
+  
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/upload-resource/upload-resource.module.ts
new file mode 100644 (file)
index 0000000..3f27c2d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+* ============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 { UploadResourceRoutingModule } from './upload-resource-routing.module';
+
+
+@NgModule({
+  declarations: [],
+  imports: [
+    CommonModule,
+    UploadResourceRoutingModule
+  ]
+})
+export class UploadResourceModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition-routing.module.ts
new file mode 100644 (file)
index 0000000..2f0b3fe
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* ============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 { ResourceDefinitionComponent } from './resource-definition.component';
+
+const routes: Routes = [
+    {
+        path: '',
+        component: ResourceDefinitionComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class ResourceDefinitionRoutingModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.html
new file mode 100644 (file)
index 0000000..60a8b94
--- /dev/null
@@ -0,0 +1,39 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+<!-- <app-cbawizard [appName]="appName"></app-cbawizard>
+<router-outlet></router-outlet> -->
+<mat-card class="RDform">
+  <mat-card-content>
+    <mat-horizontal-stepper [linear]="isLinear" #stepper>
+      <mat-step [stepControl]="firstFormGroup">
+        <ng-template matStepLabel>Resource creation Method</ng-template>
+        <app-resource-creation></app-resource-creation><br><br>
+        <div>
+          <button mat-button matStepperNext class="matStepNextBtn">Proceed</button>
+        </div>
+      </mat-step>
+      <mat-step [stepControl]="secondFormGroup">
+        <ng-template matStepLabel>Resource Edit</ng-template>
+        <app-resource-edit></app-resource-edit><br>
+      </mat-step>
+    </mat-horizontal-stepper>
+  </mat-card-content>
+</mat-card>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.scss
new file mode 100644 (file)
index 0000000..c27e7d2
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+* ============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=========================================================
+*/
+
+.mat-card {
+    padding: 0px !important;
+}
+
+.matStepNextBtn{
+    color:white;
+    background:#3f51b5;
+    margin-top: 10px;
+    position: absolute;
+    margin-bottom: 5px;
+    border-radius: 1em;
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.spec.ts
new file mode 100644 (file)
index 0000000..72d72dd
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { ResourceDefinitionComponent } from './resource-definition.component';
+
+describe('ResourceDefinitionComponent', () => {
+  let component: ResourceDefinitionComponent;
+  let fixture: ComponentFixture<ResourceDefinitionComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ResourceDefinitionComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ResourceDefinitionComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-definition.component.ts
new file mode 100644 (file)
index 0000000..c2f3dad
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+* ============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-resource-definition',
+  templateUrl: './resource-definition.component.html',
+  styleUrls: ['./resource-definition.component.scss']
+})
+export class ResourceDefinitionComponent implements OnInit {
+  appName: String;
+
+  constructor() { 
+    this.appName="datadict";
+  }
+
+  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
new file mode 100644 (file)
index 0000000..0e05653
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+* ============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 { ResourceDefinitionRoutingModule } from './resource-definition-routing.module';
+import { ResourceDefinitionComponent } from './resource-definition.component';
+import { SharedModule } from '../../../app/common/shared/shared.module';
+import { ResourceCreationModule } from './resource-creation/resource-creation.module';
+import { ResourceEditModule } from './resource-edit/resource-edit.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';
+
+@NgModule({
+  
+    declarations: [ResourceDefinitionComponent],
+  
+    imports: [
+    CommonModule,
+    ResourceDefinitionRoutingModule,
+    SharedModule,
+    ResourceCreationModule,
+    ResourceEditModule,
+    MatToolbarModule,
+    MatButtonModule,
+    MatSidenavModule,
+    MatIconModule,
+    MatListModule,
+    MatGridListModule,
+    MatCardModule,
+    MatMenuModule,
+    MatTableModule,
+    MatPaginatorModule,
+    MatSortModule,
+    MatInputModule,
+    MatSelectModule, 
+    MatRadioModule, 
+    MatFormFieldModule, 
+    MatStepperModule,
+  ]
+})
+export class ResourceDefinitionModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit-routing.module.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit-routing.module.ts
new file mode 100644 (file)
index 0000000..ae417c4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+* ============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 { ResourceEditComponent } from './resource-edit.component';
+const routes: Routes = [
+    {
+        path: '',
+        component: ResourceEditComponent
+    }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class ResourceEditRoutingModule { }
+
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html
new file mode 100644 (file)
index 0000000..7df5092
--- /dev/null
@@ -0,0 +1,45 @@
+<!--/*
+* ============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="metadata-card">
+        <mat-card-header>
+            <mat-card-title>Resource Metadata</mat-card-title>
+        </mat-card-header>
+        <mat-card-content>
+            <app-resource-metadata></app-resource-metadata>
+        </mat-card-content>
+</mat-card>
+
+<mat-card class="sources-card">
+     <mat-card-header>
+          <mat-card-title>
+                Sources
+          </mat-card-title>
+    </mat-card-header>
+    <mat-card-content>
+          <app-sources-template></app-sources-template>
+    </mat-card-content>
+</mat-card>
+
+<mat-card class="submit">
+   <button mat-raised-button>Save</button>
+</mat-card>
+<!-- <router-outlet></router-outlet> -->
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.scss
new file mode 100644 (file)
index 0000000..7c60cf3
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+* ============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=========================================================
+*/
+
+.metadata-card {
+  width: 100%;  
+  background-color: #f1f1f1;
+  padding: 0.01em 16px;
+  margin: 20px 0;
+  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;
+  height: auto;
+}
+.sources-card {
+  width: 100%;  
+  background-color: #f1f1f1;
+  padding: 0.01em 16px;
+  margin: 20px 0;
+  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important;
+  height: auto;
+}
+.mat-raised-button{
+  border: 1px solid grey;
+  background-color: #3f51b5;
+  padding: 1px;
+  color: white;
+  border-radius: 1em;
+}
+.mat-card-title{
+   padding-top: 7px;
+}
+.mat-card-header{
+   height:35px;
+}
+.mat-card-content{
+   width: auto;
+   background-color: #fff;
+   padding: 8px 8px;
+   word-wrap: break-word;
+}
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.spec.ts
new file mode 100644 (file)
index 0000000..f88452d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { ResourceEditComponent } from './resource-edit.component';
+
+describe('ResourceEditComponent', () => {
+  let component: ResourceEditComponent;
+  let fixture: ComponentFixture<ResourceEditComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ResourceEditComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ResourceEditComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.ts
new file mode 100644 (file)
index 0000000..5b56703
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+* ============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-resource-edit',
+  templateUrl: './resource-edit.component.html',
+  styleUrls: ['./resource-edit.component.scss']
+})
+export class ResourceEditComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
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
new file mode 100644 (file)
index 0000000..2b25ae3
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+* ============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 { ResourceEditComponent } from './resource-edit.component';
+import { ResourceEditRoutingModule } from './resource-edit-routing.module';
+import { MatExpansionModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule,  MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule} from '@angular/material';
+import { FormsModule,ReactiveFormsModule } from '@angular/forms';
+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 ],
+  imports: [
+   CommonModule,
+   ResourceEditRoutingModule,
+   SharedModule,
+   FormsModule,ReactiveFormsModule,
+   DragDropModule,
+   MatExpansionModule,MatToolbarModule,MatIconModule, MatButtonModule, MatSidenavModule,  MatCheckboxModule, MatListModule, MatGridListModule, MatCardModule, MatMenuModule, MatTableModule, MatPaginatorModule, MatSortModule, MatInputModule, MatSelectModule, MatRadioModule, MatFormFieldModule, MatStepperModule,
+   NgJsonEditorModule
+  ],
+  exports: [ ResourceEditComponent,SharedModule ]
+})
+export class ResourceEditModule { }
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.html
new file mode 100644 (file)
index 0000000..0bbc0b7
--- /dev/null
@@ -0,0 +1,45 @@
+<!--/*
+* ============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=========================================================
+*/-->
+
+<form [formGroup]="ResourceMetadata">
+       <mat-form-field class="form-field">
+      <input matInput placeholder="Name" formControlName="Resource_Name">
+    </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="Data Type" formControlName="_type">
+       <mat-option value="string">string</mat-option>
+       <mat-option value="list">list</mat-option>
+      </mat-select>
+    </mat-form-field>
+    <mat-form-field class="form-field" >
+      <input matInput placeholder="entry_schema" formControlName="entry_schema">
+    </mat-form-field>
+    <mat-form-field class="form-field" >
+      <mat-select matInput placeholder="required" formControlName="required">
+       <mat-option value="true">true</mat-option>
+       <mat-option value="false">false</mat-option>
+      </mat-select>
+    </mat-form-field>
+    <mat-form-field class="form-field" >
+      <textarea matInput placeholder="Description" formControlName="_description"></textarea>
+    </mat-form-field>
+</form>
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.scss
new file mode 100644 (file)
index 0000000..d10ad48
--- /dev/null
@@ -0,0 +1,33 @@
+/*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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
+\r
+.meta-form {\r
+  width: 100%;\r
+}\r
+\r
+.form-field {\r
+  width: 40%;\r
+  padding:10px;\r
+}\r
+\r
+.form-table {\r
+  width: 100%;\r
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.spec.ts
new file mode 100644 (file)
index 0000000..f157ca5
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+* ============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 { ResourceMetadataComponent } from './resource-metadata.component';
+
+describe('ResourceMetadataComponent', () => {
+  let component: ResourceMetadataComponent;
+  let fixture: ComponentFixture<ResourceMetadataComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ ResourceMetadataComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ResourceMetadataComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-metadata/resource-metadata.component.ts
new file mode 100644 (file)
index 0000000..536be26
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+* ============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';
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
+import { IResources } from 'src/app/common/core/store/models/resources.model';
+import { IResourcesState } from 'src/app/common/core/store/models/resourcesState.model';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+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 { IPropertyData } from 'src/app/common/core/store/models/propertyData.model';
+import { IEntrySchema } from 'src/app/common/core/store/models/entrySchema.model';
+
+@Component({
+  selector: 'app-resource-metadata',
+  templateUrl: './resource-metadata.component.html',
+  styleUrls: ['./resource-metadata.component.scss']
+})
+export class ResourceMetadataComponent implements OnInit {
+    entry_schema:IEntrySchema;
+    properties: IPropertyData;
+    ResourceMetadata: FormGroup;
+    resource_name: string;
+    tags: string;
+    rdState: Observable<IResourcesState>;
+    resources: IResources;
+    propertyValues = [];
+    property = [];   
+  
+ constructor(private formBuilder: FormBuilder, private store: Store<IAppState>) { 
+    this.rdState = this.store.select('resources');
+    this.ResourceMetadata = this.formBuilder.group({
+        Resource_Name: ['', Validators.required],
+       _tags: ['', Validators.required],
+       _description : ['', Validators.required],
+       _type: ['', Validators.required],
+       required: ['', Validators.required],
+       entry_schema: ['']
+    });   
+ }
+
+ ngOnInit() {
+    this.rdState.subscribe(
+      resourcesdata => {
+        var resourcesState: IResourcesState = { resources: resourcesdata.resources, isLoadSuccess: resourcesdata.isLoadSuccess, isSaveSuccess: resourcesdata.isSaveSuccess, isUpdateSuccess: resourcesdata.isUpdateSuccess };
+        this.resource_name = resourcesState.resources.name;
+        this.tags = resourcesState.resources.tags;
+        this.resources = resourcesState.resources;
+        this.properties= resourcesState.resources.property;
+        this.propertyValues=  this.checkNested(this.properties);
+        this.ResourceMetadata = this.formBuilder.group({
+       Resource_Name: [this.resource_name, Validators.required],
+        _tags: [this.tags, Validators.required],
+        _description : [ this.propertyValues[0], Validators.required],
+        _type: [ this.propertyValues[1], Validators.required],
+        required: [ this.propertyValues[2], Validators.required],
+        entry_schema: [this.propertyValues[3]]
+      });   
+    })
+ }
+    
+ checkNested(obj) {
+  for (let key in obj) {
+    if (obj.hasOwnProperty(key)) {
+      if (typeof obj[key] == "object"){
+         console.log(`Key: ${key}`)
+         this.checkNested(obj[key]);
+      } else {
+         this.property.push(obj[key]);             
+      }   
+     }
+   }
+   return this.property
+ }
+}
\ 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.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.html
new file mode 100644 (file)
index 0000000..903c6d3
--- /dev/null
@@ -0,0 +1,56 @@
+<!--/*
+* ============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=========================================================
+*/-->
+<div cdkDropListGroup>
+  <div class="sources-container">
+       <div
+      cdkDropList
+      [cdkDropListData]="sourcesOptions"
+      class="sources-list"
+      (cdkDropListDropped)="drop($event)">
+       <div class="sources-box" *ngFor="let item of sourcesOptions" cdkDrag>
+               <mat-expansion-panel class="expansion-panel">
+                       <mat-expansion-panel-header>
+                               <mat-panel-title>
+                                       {{item}}
+                               </mat-panel-title>
+                       </mat-expansion-panel-header>
+                       <json-editor [options]="options" [data]="selected(item)" on-change="onChange()"></json-editor>
+                        </mat-expansion-panel>
+       </div>
+    </div>
+  </div>
+
+  <div class="list-container">
+    <h3>Source Options</h3>
+       <mat-form-field>
+       <input [(ngModel)]="searchText" type="input" matInput placeholder="search sources">
+       <button matSuffix mat-icon-button><mat-icon>search</mat-icon></button>
+       <mat-hint>db,mdsal,input,default,..</mat-hint>
+       </mat-form-field>
+       <br><br>
+    <div
+      cdkDropList
+      [cdkDropListData]="option"
+      class="options-list"
+      (cdkDropListDropped)="drop($event)">
+      <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.scss b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.scss
new file mode 100644 (file)
index 0000000..a76b60a
--- /dev/null
@@ -0,0 +1,113 @@
+ /*\r
+* ============LICENSE_START=======================================================\r
+* ONAP : CDS\r
+* ================================================================================\r
+* Copyright 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
+.sources-container {\r
+  width: 900px;\r
+  max-width: 100%;\r
+  margin: 0 25px 25px 0;\r
+  display: inline-block;\r
+  vertical-align: top;\r
+ border-bottom: solid 1px #ccc; \r
+ border-radius: 4px;\r
+}\r
+.list-container {\r
+  min-width: 200px;\r
+  max-width: 100%;\r
+  margin: 0 25px 25px 0;\r
+  display: inline-block;\r
+  vertical-align: top;\r
+}\r
+.sources-list {\r
+  border: solid 1px #ccc;\r
+  width: 900px;\r
+  min-height: 30px;\r
+  background: white;\r
+  border-radius: 4px;\r
+  overflow: hidden;\r
+  display: block;\r
+  border-bottom: solid 1px #ccc;\r
+}\r
+.options-list {  \r
+  min-height: 30px;\r
+  border-radius: 4px;\r
+  overflow: hidden;\r
+  display: block;\r
+  width: 100%; \r
+}\r
+.sources-box {\r
+  //border-bottom: solid 1px #ccc;\r
+  color: rgba(0, 0, 0, 0.87);\r
+  display: flex;\r
+  flex-direction: row;\r
+  align-items: center;\r
+  justify-content: space-between;\r
+  box-sizing: border-box;\r
+  cursor: move;\r
+  background:white;\r
+  font-size: 14px;\r
+  min-height: 30px;\r
+  \r
+}\r
+.options-box {\r
+  border: solid 1px #ccc;\r
+  color: white;\r
+  display: flex;\r
+  flex-direction: row;\r
+  align-items: center;\r
+  justify-content: space-between;\r
+  box-sizing: border-box;\r
+  cursor: move;\r
+  background:gray;\r
+  font-size: 14px;\r
+  min-height: 30px;\r
+  width: 100px;\r
+ padding-left: 15px;\r
+}\r
+\r
+.cdk-drag-preview {\r
+  box-sizing: border-box;\r
+  border-radius: 4px;\r
+  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),\r
+              0 8px 10px 1px rgba(0, 0, 0, 0.14),\r
+              0 3px 14px 2px rgba(0, 0, 0, 0.12);\r
+}\r
+\r
+.cdk-drag-placeholder {\r
+  opacity: 0;\r
+}\r
+\r
+.cdk-drag-animating {\r
+  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\r
+}\r
+\r
+.sources-box:last-child {\r
+  border: none;\r
+}\r
+\r
+.options-list.cdk-drop-list-dragging .options-box:not(.cdk-drag-placeholder) {\r
+  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);\r
+}\r
+.expansion-panel{\r
+  border: solid 0.5px #ededed;\r
+  background: white;\r
+  border-radius: 4px;\r
+  overflow: hidden;\r
+  display: block;\r
+  width: 100%;\r
+  }
\ 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.spec.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/sources-template/sources-template.component.spec.ts
new file mode 100644 (file)
index 0000000..4a94fed
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+* ============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 { SourcesTemplateComponent } from './sources-template.component';
+
+describe('SourcesTemplateComponent', () => {
+  let component: SourcesTemplateComponent;
+  let fixture: ComponentFixture<SourcesTemplateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ SourcesTemplateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(SourcesTemplateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
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
new file mode 100644 (file)
index 0000000..c43d1de
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+* ============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 { 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';
+import { Observable } from 'rxjs';
+import { Store } from '@ngrx/store';
+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',
+  templateUrl: './sources-template.component.html',
+  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;
+    option = ['mdsal','default'];
+    sources:ISourcesData; 
+    sourcesOptions = [];
+    sourcesData = [];
+    
+ constructor(private store: Store<IAppState>) {
+   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() {
+    this.rdState.subscribe(
+      resourcesdata => {
+        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) {
+            this.sourcesOptions.push(key);  
+        }
+        //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);
+    } else {
+      transferArrayItem(event.previousContainer.data,
+                        event.container.data,
+                        event.previousIndex,
+                        event.currentIndex);
+    }
+  }    
+}
diff --git a/cds-ui/client/src/assets/.gitkeep b/cds-ui/client/src/assets/.gitkeep
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/cds-ui/client/src/assets/activation-blueprint.json b/cds-ui/client/src/assets/activation-blueprint.json
new file mode 100644 (file)
index 0000000..822cc68
--- /dev/null
@@ -0,0 +1,336 @@
+{
+  "metadata": {
+    "template_author": "Brinda Santh Muthuramalingam",
+    "author-email": "brindasanth@in.ibm.com",
+    "user-groups": "ADMIN, OPERATION",
+    "template_name": "baseconfiguration",
+    "template_version": "1.0.0",
+    "template_tags": "brinda, tosca"
+  },
+  "imports": [
+    {
+      "file": "Definitions/data_types.json"
+    },
+    {
+      "file": "Definitions/relationship_types.json"
+    },
+    {
+      "file": "Definitions/artifact_types.json"
+    },
+    {
+      "file": "Definitions/node_types.json"
+    },
+    {
+      "file": "Definitions/policy_types.json"
+    }
+  ],
+  "topology_template": {
+    "inputs": {
+      "request-id": {
+        "required": true,
+        "type": "string"
+      },
+      "action-name": {
+        "required": true,
+        "type": "string"
+      },
+      "scope-type": {
+        "required": true,
+        "type": "string"
+      },
+      "hostname": {
+        "required": true,
+        "type": "string"
+      }
+    },
+    "node_templates": {
+      "resource-assignment-process": {
+        "type": "dg-generic",
+        "properties": {
+          "content": {
+            "get_artifact": [
+              "SELF",
+              "dg-resource-assignment-process"
+            ]
+          },
+          "dependency-node-templates": [
+            "resource-assignment"
+          ]
+        },
+        "artifacts": {
+          "dg-resource-assignment-process": {
+            "type": "artifact-directed-graph",
+            "file": "Plans/CONFIG_ResourceAssignment_1.0.0.xml"
+          }
+        }
+      },
+      "activate-process": {
+        "type": "dg-generic",
+        "properties": {
+          "content": {
+            "get_artifact": [
+              "SELF",
+              "dg-activate-process"
+            ]
+          },
+          "dependency-node-templates": [
+            "activate-jython"
+          ]
+        },
+        "artifacts": {
+          "dg-activate-process": {
+            "type": "artifact-directed-graph",
+            "file": "Plans/CONFIG_ActivateNetconf_1.0.0.xml"
+          }
+        }
+      },
+      "assign-activate-process": {
+        "type": "dg-generic",
+        "properties": {
+          "content": {
+            "get_artifact": [
+              "SELF",
+              "dg-assign-activate-process"
+            ]
+          },
+          "dependency-node-templates": [
+            "resource-assignment",
+            "activate-jython"
+          ]
+        },
+        "artifacts": {
+          "dg-assign-activate-process": {
+            "type": "artifact-directed-graph",
+            "file": "Plans/CONFIG_AssignActivateNetconf_1.0.0.xml"
+          }
+        }
+      },
+      "resource-assignment": {
+        "type": "component-resource-assignment",
+        "interfaces": {
+          "ResourceAssignmentComponent": {
+            "operations": {
+              "process": {
+                "inputs": {
+                  "action-name": {
+                    "get_input": "action-name"
+                  },
+                  "resource-type": "vnf-type",
+                  "request-id": {
+                    "get_input": "request-id"
+                  },
+                  "resource-id": {
+                    "get_input": "hostname"
+                  },
+                  "artifact-prefix-names": [
+                    "baseconfig"
+                  ]
+                },
+                "outputs": {
+                  "resource-assignment-params": {
+                    "get_attribute": [
+                      "SELF",
+                      "assignment-params"
+                    ]
+                  },
+                  "status": "success"
+                }
+              }
+            }
+          }
+        },
+        "artifacts": {
+          "baseconfig-template": {
+            "type": "artifact-template-velocity",
+            "file": "Templates/baseconfig-template.vtl"
+          },
+          "baseconfig-mapping": {
+            "type": "artifact-mapping-resource",
+            "file": "Definitions/baseconfig-mapping.json"
+          }
+        }
+      },
+      "resource-assignment-py": {
+        "type": "component-resource-assignment",
+        "interfaces": {
+          "ResourceAssignmentComponent": {
+            "operations": {
+              "process": {
+                "implementation": {
+                  "primary": "component-script"
+                },
+                "inputs": {
+                  "action-name": {
+                    "get_input": "action-name"
+                  }
+                },
+                "outputs": {
+                  "resource-assignment-params": "",
+                  "status": ""
+                }
+              }
+            }
+          }
+        },
+        "artifacts": {
+          "component-script": {
+            "type": "artifact-script-jython",
+            "file": "Scripts/python/SamplePythonComponentNode.py"
+          }
+        }
+      },
+      "activate-jython": {
+        "type": "component-jython-executor",
+        "interfaces": {
+          "JythonExecutorComponent": {
+            "operations": {
+              "process": {
+                "implementation": {
+                  "primary": "component-script"
+                },
+                "inputs": {
+                  "instance-dependencies": [
+                    "json-parser-service",
+                    "netconf-rpc-service"
+                  ]
+                },
+                "outputs": {
+                  "response-data": "",
+                  "status": ""
+                }
+              }
+            }
+          }
+        },
+        "artifacts": {
+          "component-script": {
+            "type": "artifact-script-jython",
+            "file": "Scripts/python/SamplePythonComponentNode.py"
+          }
+        }
+      },
+      "activate-netconf": {
+        "type": "component-netconf-executor",
+        "interfaces": {
+          "NetconfExecutorComponent": {
+            "operations": {
+              "process": {
+                "implementation": {
+                  "primary": "component-script"
+                },
+                "inputs": {
+                  "instance-dependencies": [
+                    "json-parser-service",
+                    "netconf-rpc-service"
+                  ]
+                },
+                "outputs": {
+                  "response-data": "",
+                  "status": ""
+                }
+              }
+            }
+          }
+        },
+        "requirements": {
+          "netconf-connection": {
+            "capability": "netconf",
+            "node": "sample-netconf-device",
+            "relationship": "tosca.relationships.ConnectsTo"
+          }
+        },
+        "artifacts": {
+          "component-script": {
+            "type": "artifact-script-jython",
+            "file": "Scripts/python/DefaultGetNetConfig.py"
+          }
+        }
+      },
+      "sample-netconf-device": {
+        "type": "vnf-netconf-device",
+        "capabilities": {
+          "netconf": {
+            "properties": {
+              "login-key": "sample-key",
+              "login-account": "sample-account",
+              "target-ip-address": "localhost",
+              "port-number": 830,
+              "connection-time-out": 30
+            }
+          }
+        }
+      }
+    },
+    "workflows": {
+      "resource-assignment": {
+        "inputs": {
+          "resource-assignment-properties": {
+            "required": true,
+            "type": "dt-resource-assignment-properties"
+          }
+        },
+        "steps": {
+          "call-resource-assignment": {
+            "description": "Resource Assignment Workflow",
+            "target": "resource-assignment-process",
+            "activities": [
+              {
+                "call_operation": "CONFIG.ResourceAssignment"
+              }
+            ]
+          }
+        }
+      },
+      "activate": {
+        "inputs": {
+          "request-id": {
+            "required": true,
+            "type": "string"
+          },
+          "action-name": {
+            "required": true,
+            "type": "string"
+          },
+          "scope-type": {
+            "required": true,
+            "type": "string"
+          },
+          "hostname": {
+            "required": true,
+            "type": "string"
+          }
+        },
+        "steps": {
+          "activate-process": {
+            "description": "Netconf Activation Workflow",
+            "target": "activate-process",
+            "activities": [
+              {
+                "call_operation": "CONFIG.ActivateProcess"
+              }
+            ]
+          }
+        }
+      },
+      "assign-activate": {
+        "inputs": {
+          "assign-activate-properties": {
+            "required": true,
+            "type": "dt-assign-activate-properties"
+          }
+        },
+        "steps": {
+          "activate-process": {
+            "description": "Resource Assign and Netconf Activation Workflow",
+            "target": "assign-activate-process",
+            "activities": [
+              {
+                "call_operation": "CONFIG.AssignActivateProcess"
+              }
+            ]
+          }
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/assets/sample-licenses.json b/cds-ui/client/src/assets/sample-licenses.json
new file mode 100644 (file)
index 0000000..c0f78ac
--- /dev/null
@@ -0,0 +1,29 @@
+{\r
+  "tags": "sample-licenses",\r
+  "name": "sample-licenses",\r
+  "property": {\r
+    "description" : " Sample Data for licences",\r
+    "required": true,\r
+    "type": "list",\r
+    "entry_schema": {\r
+      "type": "dt-license-key"\r
+    }\r
+  },\r
+  "updated-by": "brindasanth@onap.com",\r
+  "sources": {\r
+    "primary-config-data": {\r
+      "type": "source-rest",\r
+      "properties": {\r
+        "type": "JSON",\r
+        "url-path": "config/L3VNF-API:services/service-list/",\r
+        "path": "/licenses",\r
+        "input-key-mapping": {\r
+        },\r
+        "output-key-mapping": {\r
+          "licenses": "licenses"\r
+        },\r
+        "key-dependencies": []\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/browserslist b/cds-ui/client/src/browserslist
new file mode 100644 (file)
index 0000000..37371cb
--- /dev/null
@@ -0,0 +1,11 @@
+# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
+# For additional information regarding the format and rule options, please see:
+# https://github.com/browserslist/browserslist#queries
+#
+# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
+
+> 0.5%
+last 2 versions
+Firefox ESR
+not dead
+not IE 9-11
\ No newline at end of file
diff --git a/cds-ui/client/src/environments/environment.dev.ts b/cds-ui/client/src/environments/environment.dev.ts
new file mode 100644 (file)
index 0000000..fc398ad
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export const environment = {
+    production: false,
+    apiHost: '',
+};
\ No newline at end of file
diff --git a/cds-ui/client/src/environments/environment.prod.ts b/cds-ui/client/src/environments/environment.prod.ts
new file mode 100644 (file)
index 0000000..3e68b2c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export const environment = {
+  production: true
+};
diff --git a/cds-ui/client/src/environments/environment.ts b/cds-ui/client/src/environments/environment.ts
new file mode 100644 (file)
index 0000000..f891b09
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+// This file can be replaced during build by using the `fileReplacements` array.
+// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
+// The list of file replacements can be found in `angular.json`.
+
+export const environment = {
+  production: false
+};
+
+/*
+ * For easier debugging in development mode, you can import the following file
+ * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
+ *
+ * This import should be commented out in production mode because it will have a negative impact
+ * on performance if an error is thrown.
+ */
+// import 'zone.js/dist/zone-error';  // Included with Angular CLI.
diff --git a/cds-ui/client/src/index.html b/cds-ui/client/src/index.html
new file mode 100644 (file)
index 0000000..32d8175
--- /dev/null
@@ -0,0 +1,34 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+-->
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <title>CdsUi</title>
+  <base href="/">
+
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <link rel="icon" type="image/x-icon" href="favicon.ico">
+</head>
+<body>
+  <app-root></app-root>
+</body>
+</html>
diff --git a/cds-ui/client/src/karma.conf.js b/cds-ui/client/src/karma.conf.js
new file mode 100644 (file)
index 0000000..fa6c990
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+// Karma configuration file, see link for more information
+// https://karma-runner.github.io/1.0/config/configuration-file.html
+
+module.exports = function (config) {
+  config.set({
+    basePath: '',
+    frameworks: ['jasmine', '@angular-devkit/build-angular'],
+    plugins: [
+      require('karma-jasmine'),
+      require('karma-chrome-launcher'),
+      require('karma-jasmine-html-reporter'),
+      require('karma-coverage-istanbul-reporter'),
+      require('@angular-devkit/build-angular/plugins/karma')
+    ],
+    client: {
+      clearContext: false // leave Jasmine Spec Runner output visible in browser
+    },
+    coverageIstanbulReporter: {
+      dir: require('path').join(__dirname, '../coverage'),
+      reports: ['html', 'lcovonly', 'text-summary'],
+      fixWebpackSourcePaths: true
+    },
+    reporters: ['progress', 'kjhtml'],
+    port: 9876,
+    colors: true,
+    logLevel: config.LOG_INFO,
+    autoWatch: true,
+    browsers: ['Chrome'],
+    singleRun: false
+  });
+};
\ No newline at end of file
diff --git a/cds-ui/client/src/main.ts b/cds-ui/client/src/main.ts
new file mode 100644 (file)
index 0000000..cc4408c
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { enableProdMode } from '@angular/core';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { AppModule } from './app/app.module';
+import { environment } from './environments/environment';
+
+if (environment.production) {
+  enableProdMode();
+}
+
+platformBrowserDynamic().bootstrapModule(AppModule)
+  .catch(err => console.error(err));
diff --git a/cds-ui/client/src/polyfills.ts b/cds-ui/client/src/polyfills.ts
new file mode 100644 (file)
index 0000000..b0b6c8f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+/**
+ * This file includes polyfills needed by Angular and is loaded before the app.
+ * You can add your own extra polyfills to this file.
+ *
+ * This file is divided into 2 sections:
+ *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
+ *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
+ *      file.
+ *
+ * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
+ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
+ * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
+ *
+ * Learn more in https://angular.io/guide/browser-support
+ */
+
+/***************************************************************************************************
+ * BROWSER POLYFILLS
+ */
+
+/** IE9, IE10 and IE11 requires all of the following polyfills. **/
+// import 'core-js/es6/symbol';
+// import 'core-js/es6/object';
+// import 'core-js/es6/function';
+// import 'core-js/es6/parse-int';
+// import 'core-js/es6/parse-float';
+// import 'core-js/es6/number';
+// import 'core-js/es6/math';
+// import 'core-js/es6/string';
+// import 'core-js/es6/date';
+// import 'core-js/es6/array';
+// import 'core-js/es6/regexp';
+// import 'core-js/es6/map';
+// import 'core-js/es6/weak-map';
+// import 'core-js/es6/set';
+
+/**
+ * If the application will be indexed by Google Search, the following is required.
+ * Googlebot uses a renderer based on Chrome 41.
+ * https://developers.google.com/search/docs/guides/rendering
+ **/
+// import 'core-js/es6/array';
+
+/** IE10 and IE11 requires the following for NgClass support on SVG elements */
+// import 'classlist.js';  // Run `npm install --save classlist.js`.
+
+/** IE10 and IE11 requires the following for the Reflect API. */
+// import 'core-js/es6/reflect';
+
+/**
+ * Web Animations `@angular/platform-browser/animations`
+ * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
+ * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
+ **/
+// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
+
+/**
+ * By default, zone.js will patch all possible macroTask and DomEvents
+ * user can disable parts of macroTask/DomEvents patch by setting following flags
+ */
+
+ // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
+ // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
+ // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
+
+ /*
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
+ */
+// (window as any).__Zone_enable_cross_context_check = true;
+
+/***************************************************************************************************
+ * Zone JS is required by default for Angular itself.
+ */
+import 'zone.js/dist/zone';  // Included with Angular CLI.
+
+
+/***************************************************************************************************
+ * APPLICATION IMPORTS
+ */
diff --git a/cds-ui/client/src/styles.scss b/cds-ui/client/src/styles.scss
new file mode 100644 (file)
index 0000000..54eb746
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+/* 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;
+}
+
+.btn-active {
+    margin: 0.5em;
+    background-color: #3f51b5;
+    color: white;
+    border-radius: 4px;
+    border: none;
+    padding: 0.5em;
+    min-width: 6em;
+    cursor: pointer;
+}
+
+.btn-disablled {
+    background-color: #c5cae8;
+    border-radius: 4px;
+    color: darkgray;
+    margin: 0.5em;
+    padding: 0.5em;
+    min-width: 6em;
+    border: none;
+    cursor: initial;
+}
\ No newline at end of file
diff --git a/cds-ui/client/src/tsconfig.app.json b/cds-ui/client/src/tsconfig.app.json
new file mode 100644 (file)
index 0000000..190fd30
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "extends": "../tsconfig.json",
+  "compilerOptions": {
+    "outDir": "../out-tsc/app",
+    "types": []
+  },
+  "exclude": [
+    "test.ts",
+    "**/*.spec.ts"
+  ]
+}
diff --git a/cds-ui/client/src/tsconfig.spec.json b/cds-ui/client/src/tsconfig.spec.json
new file mode 100644 (file)
index 0000000..de77336
--- /dev/null
@@ -0,0 +1,18 @@
+{
+  "extends": "../tsconfig.json",
+  "compilerOptions": {
+    "outDir": "../out-tsc/spec",
+    "types": [
+      "jasmine",
+      "node"
+    ]
+  },
+  "files": [
+    "test.ts",
+    "polyfills.ts"
+  ],
+  "include": [
+    "**/*.spec.ts",
+    "**/*.d.ts"
+  ]
+}
diff --git a/cds-ui/client/src/tslint.json b/cds-ui/client/src/tslint.json
new file mode 100644 (file)
index 0000000..52e2c1a
--- /dev/null
@@ -0,0 +1,17 @@
+{
+    "extends": "../tslint.json",
+    "rules": {
+        "directive-selector": [
+            true,
+            "attribute",
+            "app",
+            "camelCase"
+        ],
+        "component-selector": [
+            true,
+            "element",
+            "app",
+            "kebab-case"
+        ]
+    }
+}
diff --git a/cds-ui/client/tsconfig.json b/cds-ui/client/tsconfig.json
new file mode 100644 (file)
index 0000000..b271fd9
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "compileOnSave": false,
+  "compilerOptions": {
+    "baseUrl": "./",
+    "outDir": "./dist/out-tsc",
+    "sourceMap": true,
+    "declaration": false,
+    "module": "es2015",
+    "moduleResolution": "node",
+    "emitDecoratorMetadata": true,
+    "experimentalDecorators": true,
+    "importHelpers": true,
+    "target": "es5",
+    "typeRoots": [
+      "node_modules/@types"
+    ],
+    "lib": [
+      "es2018",
+      "dom"
+    ]
+  }
+}
diff --git a/cds-ui/common/README.md b/cds-ui/common/README.md
new file mode 100644 (file)
index 0000000..c24ecda
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# cds-ui-server
+
+This folder contains sll the common models/resources shared between server and client
diff --git a/cds-ui/server/.npmrc b/cds-ui/server/.npmrc
new file mode 100644 (file)
index 0000000..43c97e7
--- /dev/null
@@ -0,0 +1 @@
+package-lock=false
diff --git a/cds-ui/server/.prettierignore b/cds-ui/server/.prettierignore
new file mode 100644 (file)
index 0000000..c6911da
--- /dev/null
@@ -0,0 +1,2 @@
+dist
+*.json
diff --git a/cds-ui/server/.prettierrc b/cds-ui/server/.prettierrc
new file mode 100644 (file)
index 0000000..f58b81d
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "bracketSpacing": false,
+  "singleQuote": true,
+  "printWidth": 80,
+  "trailingComma": "all"
+}
diff --git a/cds-ui/server/.yo-rc.json b/cds-ui/server/.yo-rc.json
new file mode 100644 (file)
index 0000000..0967ef4
--- /dev/null
@@ -0,0 +1 @@
+{}
diff --git a/cds-ui/server/README.md b/cds-ui/server/README.md
new file mode 100644 (file)
index 0000000..5591df0
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# cds-ui-server
+
+[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)-@2x.png)](http://loopback.io/)
diff --git a/cds-ui/server/index.js b/cds-ui/server/index.js
new file mode 100644 (file)
index 0000000..b79f7d6
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+const application = require('./dist');
+
+module.exports = application;
+
+if (require.main === module) {
+  // Run the application
+  const config = {
+    rest: {
+      port: +process.env.PORT || 3000,
+      host: process.env.HOST || 'localhost',
+      openApiSpec: {
+        // useful when used with OASGraph to locate your application
+        setServersFromRequest: true,
+      },
+    },
+  };
+  application.main(config).catch(err => {
+    console.error('Cannot start the application.', err);
+    process.exit(1);
+  });
+}
diff --git a/cds-ui/server/index.ts b/cds-ui/server/index.ts
new file mode 100644 (file)
index 0000000..8717b8d
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export * from './src';
diff --git a/cds-ui/server/package.json b/cds-ui/server/package.json
new file mode 100644 (file)
index 0000000..4d0f946
--- /dev/null
@@ -0,0 +1,64 @@
+{
+  "name": "cds-ui-server",
+  "version": "1.0.0",
+  "description": "Intermediate layer between UI and backend. Implemented in loopback 4",
+  "keywords": [
+    "loopback-application",
+    "loopback"
+  ],
+  "main": "index.js",
+  "engines": {
+    "node": ">=8.9"
+  },
+  "scripts": {
+    "build:apidocs": "lb-apidocs",
+    "build": "lb-tsc es2017 --outDir dist",
+    "build:watch": "lb-tsc --watch",
+    "clean": "lb-clean dist",
+    "lint": "npm run prettier:check && npm run tslint",
+    "lint:fix": "npm run tslint:fix && npm run prettier:fix",
+    "prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"",
+    "prettier:check": "npm run prettier:cli -- -l",
+    "prettier:fix": "npm run prettier:cli -- --write",
+    "tslint": "lb-tslint",
+    "tslint:fix": "npm run tslint -- --fix",
+    "pretest": "npm run clean && npm run build",
+    "test": "lb-mocha --allow-console-logs \"dist/test\"",
+    "posttest": "npm run lint",
+    "test:dev": "lb-mocha --allow-console-logs dist/test/**/*.js && npm run posttest",
+    "migrate": "node ./dist/src/migrate",
+    "prestart": "npm run build",
+    "start": "node .",
+    "prepublishOnly": "npm run test"
+  },
+  "repository": {
+    "type": "git"
+  },
+  "author": "",
+  "license": "",
+  "files": [
+    "README.md",
+    "index.js",
+    "index.d.ts",
+    "dist/src",
+    "dist/index*",
+    "src"
+  ],
+  "dependencies": {
+    "@loopback/boot": "^1.0.8",
+    "@loopback/context": "^1.4.0",
+    "@loopback/core": "^1.1.3",
+    "@loopback/openapi-v3": "^1.1.5",
+    "@loopback/repository": "^1.1.1",
+    "@loopback/rest": "^1.5.1",
+    "@loopback/rest-explorer": "^1.1.4",
+    "@loopback/service-proxy": "^1.0.8",
+    "loopback-connector-rest": "^3.4.1"
+  },
+  "devDependencies": {
+    "@loopback/build": "^1.1.0",
+    "@loopback/testlab": "^1.0.3",
+    "@loopback/tslint-config": "^1.0.0",
+    "@types/node": "^10.11.2"
+  }
+}
diff --git a/cds-ui/server/pom.xml b/cds-ui/server/pom.xml
new file mode 100644 (file)
index 0000000..bac8b03
--- /dev/null
@@ -0,0 +1,99 @@
+<!-- 
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    
+    <parent>
+        <groupId>org.onap.ccsdk.cds</groupId>
+        <artifactId>controller-design-studio</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+        <relativePath>../..</relativePath>
+    </parent>
+    
+    <groupId>org.onap.ccsdk.cds.server</groupId>
+    <artifactId>controller-design-studio-server</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>cds-ui-server</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <npm.executable>npm</npm.executable>
+        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+    </properties>
+
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.github.eirslett</groupId>
+                <artifactId>frontend-maven-plugin</artifactId>
+                <!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
+                <version>1.3</version>
+                <configuration>
+                    <nodeVersion>v8.12.0</nodeVersion>
+                    <nodeDownloadRoot>https://nodejs.org/dist/</nodeDownloadRoot>
+                    <npmDownloadRoot>https://nodejs.org/dist/npm/</npmDownloadRoot>
+                    <installDirectory>./</installDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>install node and npm</id>
+                        <goals>
+                            <goal>install-node-and-npm</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                    </execution>
+
+                    <execution>
+                        <id>npm install</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+
+                        <phase>generate-resources</phase>
+
+                        <configuration>
+                            <arguments>install</arguments>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>npm build</id>
+                        <goals>
+                            <goal>npm</goal>
+                        </goals>
+
+                        <phase>generate-resources</phase>
+
+                        <configuration>
+                            <arguments>run build</arguments>
+                        </configuration>
+                    </execution>
+
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/cds-ui/server/public/index.html b/cds-ui/server/public/index.html
new file mode 100644 (file)
index 0000000..81e9728
--- /dev/null
@@ -0,0 +1,19 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
diff --git a/cds-ui/server/src/application.ts b/cds-ui/server/src/application.ts
new file mode 100644 (file)
index 0000000..463f330
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { BootMixin } from '@loopback/boot';
+import { ApplicationConfig } from '@loopback/core';
+import {
+  RestExplorerBindings,
+  RestExplorerComponent,
+} from '@loopback/rest-explorer';
+import { RepositoryMixin } from '@loopback/repository';
+import { RestApplication } from '@loopback/rest';
+import { ServiceMixin } from '@loopback/service-proxy';
+import * as path from 'path';
+import { MySequence } from './sequence';
+
+export class CdsUiServerApplication extends BootMixin(
+  ServiceMixin(RepositoryMixin(RestApplication)),
+) {
+  constructor(options: ApplicationConfig = {}) {
+    super(options);
+
+    // Set up the custom sequence
+    this.sequence(MySequence);
+
+    // Set up default home page
+    this.static('/', path.join(__dirname, '../../public'));
+
+    // Customize @loopback/rest-explorer configuration here
+    this.bind(RestExplorerBindings.CONFIG).to({
+      path: '/explorer',
+    });
+    this.component(RestExplorerComponent);
+
+    this.projectRoot = __dirname;
+    // Customize @loopback/boot Booter Conventions here
+    this.bootOptions = {
+      controllers: {
+        // Customize ControllerBooter Conventions here
+        dirs: ['controllers'],
+        extensions: ['.controller.js'],
+        nested: true,
+      },
+    };
+  }
+}
diff --git a/cds-ui/server/src/controllers/README.md b/cds-ui/server/src/controllers/README.md
new file mode 100644 (file)
index 0000000..837a462
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# Controllers
+
+This directory contains source files for the controllers exported by this app.
+
+To add a new empty controller, type in `lb4 controller [<name>]` from the
+command-line of your application's root directory.
+
+For more information, please visit
+[Controller generator](http://loopback.io/doc/en/lb4/Controller-generator.html).
diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
new file mode 100644 (file)
index 0000000..960f09f
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {
+  Count,
+  CountSchema,
+  Filter,
+  repository,
+  Where,
+} from '@loopback/repository';
+import {
+  post,
+  param,
+  get,
+  getFilterSchemaFor,
+  getWhereSchemaFor,
+  patch,
+  put,
+  del,
+  requestBody,
+} from '@loopback/rest';
+import {Blueprint} from '../models';
+import {BlueprintRepository} from '../repositories';
+
+export class BlueprintRestController {
+  constructor(
+    @repository(BlueprintRepository)
+    public blueprintRepository : BlueprintRepository,
+  ) {}
+
+  @post('/blueprints', {
+    responses: {
+      '200': {
+        description: 'Blueprint model instance',
+        content: {'application/json': {schema: {'x-ts-type': Blueprint}}},
+      },
+    },
+  })
+  async create(@requestBody() blueprint: Blueprint): Promise<Blueprint> {
+    return await this.blueprintRepository.create(blueprint);
+  }
+
+  @get('/blueprints/count', {
+    responses: {
+      '200': {
+        description: 'Blueprint model count',
+        content: {'application/json': {schema: CountSchema}},
+      },
+    },
+  })
+  async count(
+    @param.query.object('where', getWhereSchemaFor(Blueprint)) where?: Where,
+  ): Promise<Count> {
+    return await this.blueprintRepository.count(where);
+  }
+
+  @get('/blueprints', {
+    responses: {
+      '200': {
+        description: 'Array of Blueprint model instances',
+        content: {
+          'application/json': {
+            schema: {type: 'array', items: {'x-ts-type': Blueprint}},
+          },
+        },
+      },
+    },
+  })
+  async find(
+    @param.query.object('filter', getFilterSchemaFor(Blueprint)) filter?: Filter,
+  ): Promise<Blueprint[]> {
+    return await this.blueprintRepository.find(filter);
+  }
+
+  @patch('/blueprints', {
+    responses: {
+      '200': {
+        description: 'Blueprint PATCH success count',
+        content: {'application/json': {schema: CountSchema}},
+      },
+    },
+  })
+  async updateAll(
+    @requestBody() blueprint: Blueprint,
+    @param.query.object('where', getWhereSchemaFor(Blueprint)) where?: Where,
+  ): Promise<Count> {
+    return await this.blueprintRepository.updateAll(blueprint, where);
+  }
+
+  @get('/blueprints/{id}', {
+    responses: {
+      '200': {
+        description: 'Blueprint model instance',
+        content: {'application/json': {schema: {'x-ts-type': Blueprint}}},
+      },
+    },
+  })
+  async findById(@param.path.number('id') id: number): Promise<Blueprint> {
+    return await this.blueprintRepository.findById(id);
+  }
+
+  @patch('/blueprints/{id}', {
+    responses: {
+      '204': {
+        description: 'Blueprint PATCH success',
+      },
+    },
+  })
+  async updateById(
+    @param.path.number('id') id: number,
+    @requestBody() blueprint: Blueprint,
+  ): Promise<void> {
+    await this.blueprintRepository.updateById(id, blueprint);
+  }
+
+  @put('/blueprints/{id}', {
+    responses: {
+      '204': {
+        description: 'Blueprint PUT success',
+      },
+    },
+  })
+  async replaceById(
+    @param.path.number('id') id: number,
+    @requestBody() blueprint: Blueprint,
+  ): Promise<void> {
+    await this.blueprintRepository.replaceById(id, blueprint);
+  }
+
+  @del('/blueprints/{id}', {
+    responses: {
+      '204': {
+        description: 'Blueprint DELETE success',
+      },
+    },
+  })
+  async deleteById(@param.path.number('id') id: number): Promise<void> {
+    await this.blueprintRepository.deleteById(id);
+  }
+}
diff --git a/cds-ui/server/src/controllers/index.ts b/cds-ui/server/src/controllers/index.ts
new file mode 100644 (file)
index 0000000..bf2bd6f
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+export * from './ping.controller';
diff --git a/cds-ui/server/src/controllers/ping.controller.ts b/cds-ui/server/src/controllers/ping.controller.ts
new file mode 100644 (file)
index 0000000..d3098bc
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { Request, RestBindings, get, ResponseObject } from '@loopback/rest';
+import { inject } from '@loopback/context';
+
+/**
+ * OpenAPI response for ping()
+ */
+const PING_RESPONSE: ResponseObject = {
+  description: 'Ping Response',
+  content: {
+    'application/json': {
+      schema: {
+        type: 'object',
+        properties: {
+          greeting: { type: 'string' },
+          date: { type: 'string' },
+          url: { type: 'string' },
+          headers: {
+            type: 'object',
+            properties: {
+              'Content-Type': { type: 'string' },
+            },
+            additionalProperties: true,
+          },
+        },
+      },
+    },
+  },
+};
+
+/**
+ * A simple controller to bounce back http requests
+ */
+export class PingController {
+  constructor(@inject(RestBindings.Http.REQUEST) private req: Request) { }
+
+  // Map to `GET /ping`
+  @get('/ping', {
+    responses: {
+      '200': PING_RESPONSE,
+    },
+  })
+  ping(): object {
+    // Reply with a greeting, the current time, the url, and request headers
+    return {
+      greeting: 'Hello from LoopBack',
+      date: new Date(),
+      url: this.req.url,
+      headers: Object.assign({}, this.req.headers),
+    };
+  }
+}
diff --git a/cds-ui/server/src/datasources/README.md b/cds-ui/server/src/datasources/README.md
new file mode 100644 (file)
index 0000000..2d4d4c3
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# Datasources
+
+This directory contains config for datasources used by this app.
diff --git a/cds-ui/server/src/datasources/db.datasource.json b/cds-ui/server/src/datasources/db.datasource.json
new file mode 100644 (file)
index 0000000..a68f220
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "name": "db",
+  "connector": "memory",
+  "localStorage": "",
+  "file": "./data/db.json"
+}
diff --git a/cds-ui/server/src/datasources/db.datasource.ts b/cds-ui/server/src/datasources/db.datasource.ts
new file mode 100644 (file)
index 0000000..f1b19a1
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {inject} from '@loopback/core';
+import {juggler} from '@loopback/repository';
+import * as config from './db.datasource.json';
+
+export class DbDataSource extends juggler.DataSource {
+  static dataSourceName = 'db';
+
+  constructor(
+    @inject('datasources.config.db', {optional: true})
+    dsConfig: object = config,
+  ) {
+    super(dsConfig);
+  }
+}
diff --git a/cds-ui/server/src/datasources/index.ts b/cds-ui/server/src/datasources/index.ts
new file mode 100644 (file)
index 0000000..1726b45
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+
+export * from './db.datasource';
diff --git a/cds-ui/server/src/datasources/rest.config.json b/cds-ui/server/src/datasources/rest.config.json
new file mode 100644 (file)
index 0000000..86f33fb
--- /dev/null
@@ -0,0 +1,39 @@
+{
+   "name": "restConfig",
+   "connector": "rest",
+   "options": {
+      "headers": {
+          "accept": "application/json",
+          "content-type": "application/json"
+      }
+   },
+   "operations": [
+       {
+      "template": {
+         "method": "GET",
+         "url": ""
+      },
+      "functions": {
+         "getEnricheddata": [""]
+      }
+   },
+   {
+      "template": {
+         "method": "POST",
+         "url": ""
+      },
+      "functions": {
+         "saveBlueprint": [""]
+      }
+   },
+   {
+      "template": {
+         "method": "POST",
+         "url": ""
+      },
+      "functions": {
+         "test": [""]
+      }
+   }
+]
+}
\ No newline at end of file
diff --git a/cds-ui/server/src/datasources/rest.datasource.ts b/cds-ui/server/src/datasources/rest.datasource.ts
new file mode 100644 (file)
index 0000000..42cdb80
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { juggler } from '@loopback/service-proxy';
+import * as config from './rest.config.json';
+
+
+export class RestDataSource extends juggler.DataSource {
+   static dataSourceName = 'rest';
+   constructor(dsConfig: object = config) {
+      super(dsConfig);
+   }
+}
diff --git a/cds-ui/server/src/index.ts b/cds-ui/server/src/index.ts
new file mode 100644 (file)
index 0000000..0485249
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { CdsUiServerApplication } from './application';
+import { ApplicationConfig } from '@loopback/core';
+
+export { CdsUiServerApplication };
+
+export async function main(options: ApplicationConfig = {}) {
+  const app = new CdsUiServerApplication(options);
+  await app.boot();
+  await app.start();
+
+  const url = app.restServer.url;
+  console.log(`Server is running at ${url}`);
+  console.log(`Try ${url}/ping`);
+
+  return app;
+}
diff --git a/cds-ui/server/src/migrate.ts b/cds-ui/server/src/migrate.ts
new file mode 100644 (file)
index 0000000..0897b98
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { CdsUiServerApplication } from './application';
+
+export async function migrate(args: string[]) {
+  const existingSchema = args.includes('--rebuild') ? 'drop' : 'alter';
+  console.log('Migrating schemas (%s existing schema)', existingSchema);
+
+  const app = new CdsUiServerApplication();
+  await app.boot();
+  await app.migrateSchema({ existingSchema });
+
+  // Connectors usually keep a pool of opened connections,
+  // this keeps the process running even after all work is done.
+  // We need to exit explicitly.
+  process.exit(0);
+}
+
+migrate(process.argv).catch(err => {
+  console.error('Cannot migrate database schema', err);
+  process.exit(1);
+});
diff --git a/cds-ui/server/src/models/README.md b/cds-ui/server/src/models/README.md
new file mode 100644 (file)
index 0000000..b4bbe4a
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# Models
+
+This directory contains code for models provided by this app.
diff --git a/cds-ui/server/src/models/blueprint.model.ts b/cds-ui/server/src/models/blueprint.model.ts
new file mode 100644 (file)
index 0000000..d9fe1a8
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {Entity, model, property} from '@loopback/repository';
+
+@model()
+export class Blueprint extends Entity {
+  @property({
+    type: 'number',
+    id: true,
+  })
+  id?: number;
+
+  @property({
+    type: 'object',
+  })
+  metadata?: object;
+
+  @property({
+    type: 'array',
+    itemType: 'object',
+  })
+  fileImports?: object[];
+
+  @property({
+    type: 'object',
+  })
+  topologyTemplates?: object;
+
+  constructor(data?: Partial<Blueprint>) {
+    super(data);
+  }
+}
diff --git a/cds-ui/server/src/models/index.ts b/cds-ui/server/src/models/index.ts
new file mode 100644 (file)
index 0000000..b4de6a5
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+
+export * from './blueprint.model';
diff --git a/cds-ui/server/src/repositories/README.md b/cds-ui/server/src/repositories/README.md
new file mode 100644 (file)
index 0000000..dc7af90
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+# Repositories
+
+This directory contains code for repositories provided by this app.
diff --git a/cds-ui/server/src/repositories/blueprint.repository.ts b/cds-ui/server/src/repositories/blueprint.repository.ts
new file mode 100644 (file)
index 0000000..3af5c11
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {DefaultCrudRepository, juggler} from '@loopback/repository';
+import {Blueprint} from '../models';
+import {DbDataSource} from '../datasources';
+import {inject} from '@loopback/core';
+
+export class BlueprintRepository extends DefaultCrudRepository<
+  Blueprint,
+  typeof Blueprint.prototype.id
+> {
+  constructor(
+    @inject('datasources.db') dataSource: DbDataSource,
+  ) {
+    super(Blueprint, dataSource);
+  }
+}
diff --git a/cds-ui/server/src/repositories/index.ts b/cds-ui/server/src/repositories/index.ts
new file mode 100644 (file)
index 0000000..ac56b3c
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================
+*/
+
+
+export * from './blueprint.repository';
diff --git a/cds-ui/server/src/sequence.ts b/cds-ui/server/src/sequence.ts
new file mode 100644 (file)
index 0000000..b270931
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 { inject } from '@loopback/context';
+import {
+  FindRoute,
+  InvokeMethod,
+  ParseParams,
+  Reject,
+  RequestContext,
+  RestBindings,
+  Send,
+  SequenceHandler,
+} from '@loopback/rest';
+
+const SequenceActions = RestBindings.SequenceActions;
+
+export class MySequence implements SequenceHandler {
+  constructor(
+    @inject(SequenceActions.FIND_ROUTE) protected findRoute: FindRoute,
+    @inject(SequenceActions.PARSE_PARAMS) protected parseParams: ParseParams,
+    @inject(SequenceActions.INVOKE_METHOD) protected invoke: InvokeMethod,
+    @inject(SequenceActions.SEND) public send: Send,
+    @inject(SequenceActions.REJECT) public reject: Reject,
+  ) { }
+
+  async handle(context: RequestContext) {
+    try {
+      const { request, response } = context;
+      const route = this.findRoute(request);
+      const args = await this.parseParams(request, route);
+      const result = await this.invoke(route, args);
+      this.send(response, result);
+    } catch (err) {
+      this.reject(context, err);
+    }
+  }
+}
diff --git a/cds-ui/server/src/services/rest.service.ts b/cds-ui/server/src/services/rest.service.ts
new file mode 100644 (file)
index 0000000..b94ea4d
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018-19 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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 {getService, juggler} from '@loopback/service-proxy';
+import {inject, Provider} from '@loopback/core';
+import {RestDataSource} from '../datasources/rest.datasource';
+
+
+export interface RestResponseData {
+   userId: number;
+   id: number;
+   title: string;
+   completed: boolean;
+}
+
+export interface RestService {
+   getrestdata(id?: number): Promise<RestResponseData>;
+}
+export class RestProvider implements Provider<RestService> {
+   constructor(
+      @inject('datasources.rest')
+      protected dataSource: juggler.DataSource = new RestDataSource(),
+   ) {}
+   
+   value(): Promise<RestService> {
+      return getService(this.dataSource);
+   }
+}
\ No newline at end of file
diff --git a/cds-ui/server/tsconfig.json b/cds-ui/server/tsconfig.json
new file mode 100644 (file)
index 0000000..eb96bb5
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "$schema": "http://json.schemastore.org/tsconfig",
+  "extends": "@loopback/build/config/tsconfig.common.json",
+  "include": [
+    "src",
+    "test",
+    "index.ts"
+  ],
+  "exclude": [
+    "node_modules/**",
+    "packages/*/node_modules/**",
+    "**/*.d.ts"
+  ]
+}
diff --git a/cds-ui/server/tslint.build.json b/cds-ui/server/tslint.build.json
new file mode 100644 (file)
index 0000000..121b8ad
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "$schema": "http://json.schemastore.org/tslint",
+  "extends": ["@loopback/tslint-config/tslint.build.json"]
+}
diff --git a/cds-ui/server/tslint.json b/cds-ui/server/tslint.json
new file mode 100644 (file)
index 0000000..2bb931e
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "$schema": "http://json.schemastore.org/tslint",
+  "extends": ["@loopback/tslint-config/tslint.common.json"]
+}
diff --git a/docs/CBA/CDS_Architecture_Design.pptx b/docs/CBA/CDS_Architecture_Design.pptx
new file mode 100644 (file)
index 0000000..a6c158d
Binary files /dev/null and b/docs/CBA/CDS_Architecture_Design.pptx differ
diff --git a/docs/CBA/index.rst b/docs/CBA/index.rst
new file mode 100644 (file)
index 0000000..3bc6aca
--- /dev/null
@@ -0,0 +1,113 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+Controller Blueprint Archived Tool(CBA)
+----------------------------------------
+.. toctree::
+   :maxdepth: 1
+   
+Introduction:
+=============
+The Controller Blueprint Archived is the overall service design, fully model-driven, package needed to automate the resolution of resources for instantiation and any config provisioning operation, such as day0, day1 or day2 configuration.
+
+The CBA is .zip file, comprised of the following folder structure, the files may vary:
+
+|image0|
+
+.. |image0| image:: media/image0.jpg
+   :width: 7.88889in 
+   :height: 4.43750in
+
+Architecture:
+=============
+
+|image3|
+
+.. |image3| image:: media/CDS_architecture.jpg
+   :height: 4.43750in
+   :width: 7.88889in
+   
+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" ]
+   
+Development:
+=============
+
+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:
+==========
+|image1|
+
+.. |image1| image:: media/image1.jpg
+   :width: 7.88889in 
+   :height: 4.43750in
+   
+Functional Decomposition:
+=========================
+|image2|
+
+.. |image2| image:: media/image2.jpg
+   :width: 7.88889in 
+   :height: 4.43750in
+   
+Controller design Studio Presentation:
+======================================
+
+Details about CDS Architecture and Design detail, Please click the link.
+:download:`CDS_Architecture_Design.pptx`
\ No newline at end of file
diff --git a/docs/CBA/media/CDS_architecture.jpg b/docs/CBA/media/CDS_architecture.jpg
new file mode 100644 (file)
index 0000000..6401e6b
Binary files /dev/null and b/docs/CBA/media/CDS_architecture.jpg differ
diff --git a/docs/CBA/media/image0.PNG b/docs/CBA/media/image0.PNG
new file mode 100644 (file)
index 0000000..1c5d8c5
Binary files /dev/null and b/docs/CBA/media/image0.PNG differ
diff --git a/docs/CBA/media/image0.jpg b/docs/CBA/media/image0.jpg
new file mode 100644 (file)
index 0000000..8e53a2d
Binary files /dev/null and b/docs/CBA/media/image0.jpg differ
diff --git a/docs/CBA/media/image1.PNG b/docs/CBA/media/image1.PNG
new file mode 100644 (file)
index 0000000..7a4b96d
Binary files /dev/null and b/docs/CBA/media/image1.PNG differ
diff --git a/docs/CBA/media/image1.jpg b/docs/CBA/media/image1.jpg
new file mode 100644 (file)
index 0000000..9a5cd63
Binary files /dev/null and b/docs/CBA/media/image1.jpg differ
diff --git a/docs/CBA/media/image2.PNG b/docs/CBA/media/image2.PNG
new file mode 100644 (file)
index 0000000..e6a0cf8
Binary files /dev/null and b/docs/CBA/media/image2.PNG differ
diff --git a/docs/CBA/media/image2.jpg b/docs/CBA/media/image2.jpg
new file mode 100644 (file)
index 0000000..20fc262
Binary files /dev/null and b/docs/CBA/media/image2.jpg differ
diff --git a/docs/CBA/resourceassignment.rst b/docs/CBA/resourceassignment.rst
new file mode 100644 (file)
index 0000000..be8b08e
--- /dev/null
@@ -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/datadictionary/index.rst b/docs/datadictionary/index.rst
new file mode 100644 (file)
index 0000000..83c6e47
--- /dev/null
@@ -0,0 +1,45 @@
+.. 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 Definition 
+-------------------
+.. toctree::
+   :maxdepth: 1
+
+Introduction:
+=============
+A Resource Definition defines a specifc resource that can be resolved using the bellow supported sources.
+
+A Resource Definition can support multiple sources.
+
+The main goal of Resource Definition is to define generic entity that could be shared accross services.
+
+
+Resolution sources:
+===================
+
+   * Input
+   * Default
+   * DB
+   * REST
+   * Capability
+
+Artifacts:
+==========
+
+   * artifact-mapping-resource
+   * artifact-template-velocity
+   * artifact-directed-graph
+
+Node type:
+==========
+       
+   * component-resource-resolution
+   * component-jython-executor
+   * component-netconf-executor
+   * component-restconf-executor
+
+Data type:
+==========
+   * vnf-netconf-device
\ No newline at end of file
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644 (file)
index 0000000..f46653a
--- /dev/null
@@ -0,0 +1,45 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+CONTROLLER DESIGN STUDIO (CDS) 
+------------------------------
+.. toctree::
+   :maxdepth: 1
+   
+Introduction:
+=============
+The system is designed to be self service, which means that users, not just programmers, can reconfigure the software system as needed to meet customer requirements. To accomplish this goal, the system is built around models that provide for real-time changes in how the system operates.  Users merely need to change a model to change how a service operates.
+Self service is a completely new way of delivering services.  It removes the dependence on code releases and the delays they cause and puts the control of services into the hands of the service providers.  They can change a model and its parameters and create a new service without writing a single line of code.  
+This makes SERVICE PROVIDER(S) more responsive to its customers and able to deliver products that more closely match the needs of its customers.
+
+Design tools:
+=============
+.. toctree::
+   :maxdepth: 1
+   :glob:
+
+   CBA/index
+   datadictionary/index
+
+
+Architecture:
+=============
+The Controller Design Studio is composed of two major components: 
+       * The GUI (or frontend)
+       * The Run Time (or backend)  
+The GUI handles direct user input and allows for displaying both design time and run time activities.  For design time, it allows for the creation of controller blueprint, from selecting the DGs to be included, to incorporating the artifact templates, to adding necessary components.  For run time, it allows the user to direct the system to resolve the unresolved elements of the controller blueprint and download the resulting configuration into a VNF.  At a more basic level, it allows for creation of data dictionaries, capabilities catalogs, and controller blueprint, the basic elements that are used to generate a configuration. The essential function of the Controller Design Studio is to create and populate a controller blueprint, create a configuration file from this Controller blueprint, and download this configuration file (configlet) to a VNF/PNF.
+
+Resource assignment:
+=====================
+.. toctree::
+   :maxdepth: 1
+   :glob:
+   
+   resourceassignment
+
+ResolutionHelper:
+=================
+When executing a component executor script, designer might want to perform resource resolution along with template meshing directly from the script itself.
+
+The helper can be find here: https://github.com/onap/ccsdk-apps/blob/master/components/scripts/python/ccsdk_netconf/common.py
\ No newline at end of file
diff --git a/docs/logging.rst b/docs/logging.rst
new file mode 100644 (file)
index 0000000..c6cfad9
--- /dev/null
@@ -0,0 +1,16 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+Logging
+-------
+.. toctree::
+   :maxdepth: 1
+
+CCSDK uses slf4j to log messages to the standard OpenDaylight karaf.log
+log file.
+
+Where to Access Information
+---------------------------
+Logs are found within the SDNC docker container, in the directory
+/opt/opendaylight/current/data/logs.
\ No newline at end of file
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
new file mode 100644 (file)
index 0000000..a53419f
--- /dev/null
@@ -0,0 +1,8 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2019 IBM.
+
+Release-Notes
+-------------
+.. toctree::
+   :maxdepth: 1
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644 (file)
index 0000000..1d69d2f
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,136 @@
+<!--
+============LICENSE_START==========================================
+===================================================================
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
+===================================================================
+
+Unless otherwise specified, all software contained herein is licensed
+under the Apache License, Version 2.0 (the License);
+you may not use this software 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============================================ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+               <groupId>org.onap.ccsdk.parent</groupId>
+               <artifactId>spring-boot-starter-parent</artifactId>
+               <version>1.2.1-SNAPSHOT</version>
+               <relativePath/>
+       </parent>
+
+    <groupId>org.onap.ccsdk.cds</groupId>
+    <artifactId>controller-design-studio</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+
+    <name>controller-design-studio</name>
+    <description>Creates Controller Design Studio UI Docker container</description>
+
+    <properties>
+        <image.name>onap/ccsdk-cds-ui</image.name>
+        <ccsdk.project.version>${project.version}</ccsdk.project.version>
+             <ccsdk.distribution.version>${project.version}</ccsdk.distribution.version>
+        <ccsdk.build.timestamp>${maven.build.timestamp}</ccsdk.build.timestamp>
+        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+       <docker.verbose>true</docker.verbose>
+    </properties>
+
+<!--
+       <modules>
+               <module>cds-ui/client</module>
+               <module>cds-ui/server</module>
+       </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <npm.executable>npm</npm.executable>
+        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+    </properties>
+-->
+
+<build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.groovy.maven</groupId>
+                <artifactId>gmaven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <source>${basedir}/TagVersion.groovy</source>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <version>0.28.0</version>
+                        <inherited>false</inherited>
+                        <configuration>
+                            <images>
+                                <image>
+                                    <name>${image.name}</name>
+                                    <build>
+                                        <cleanup>try</cleanup>
+                                        <dockerFileDir>${basedir}/cds-ui</dockerFileDir>
+                                        <tags>
+                                            <tag>${project.docker.latestminortag.version}</tag>
+                                            <tag>${project.docker.latestfulltag.version}</tag>
+                                            <tag>${project.docker.latesttagtimestamp.version}</tag>
+                                        </tags>
+                                    </build>
+                                </image>
+                            </images>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>generate-images</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>build</goal>
+                                </goals>
+                            </execution>
+
+                            <execution>
+                                <id>push-images</id>
+                                <phase>deploy</phase>
+                                <goals>
+                                    <goal>build</goal>
+                                    <goal>push</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <organization>
+        <name>ONAP</name>
+    </organization>
+
+</project>
diff --git a/version.properties b/version.properties
new file mode 100644 (file)
index 0000000..1da7b9a
--- /dev/null
@@ -0,0 +1,15 @@
+###########################################################
+# Versioning variables
+# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
+# because they are used in Jenkins, whose plug-in doesn't support
+
+
+release_name=1
+sprint_number=0
+feature_revision=0
+
+base_version=${release_name}.${sprint_number}.${feature_revision}
+
+release_version=${base_version}
+snapshot_version=${base_version}-SNAPSHOT
+