Common module 76/75276/2
authorArundathi Patil <arundpil@in.ibm.com>
Fri, 4 Jan 2019 10:29:37 +0000 (15:59 +0530)
committerArundathi Patil <arundpil@in.ibm.com>
Fri, 4 Jan 2019 10:43:38 +0000 (10:43 +0000)
This folder contains all the common components, directives,pipes,
services, store that will be used across the application.

Issue-ID: CCSDK-816
Change-Id: Ied731e4034e1a5ddd86c2e78dc5922e10a05123a
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
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/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/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/store/README.md [new file with mode: 0644]
cds-ui/client/src/app/common/utility/README.md [new file with mode: 0644]

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..a00e25f
--- /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============================================
+*/
+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'}]
+                        }
+    }
+
+};
\ 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/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..c76be76
--- /dev/null
@@ -0,0 +1,32 @@
+<!--
+============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>
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..f3c33e8
--- /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-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..bbfc119
--- /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============================================
+*/
+import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+import { Router } from '@angular/router';
+
+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;
+  @Output() stepChanged = new EventEmitter();
+  public stepDetails = GlobalContants.cbawizard.stepsRequired.steps;
+
+  constructor(private router: Router) { }
+
+  ngOnInit() {
+  }
+
+  changeRoute(event){
+    this.stepDetails.forEach((step, index)=>{
+      if(index == event.selectedIndex) {
+        this.router.navigate([step.componentURL]);
+      }
+    });
+  }
+
+}
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/store/README.md b/cds-ui/client/src/app/common/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/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