Initial Commit - NG UI
* Roboto and font-awesome fonts are added in package.json
* Replace Nginx alpine varient to stable
* Devops files are added
* Docker file aligned as per community reviews
* Enhancement - NS primitive, Azure inclusion and domain name
* RWD changes
Change-Id: If543efbf127964cbd8f4be4c5a67260c91407fd9
Signed-off-by: kumaran.m <kumaran.m@tataelxsi.co.in>
diff --git a/src/app/utilities/project-link/ProjectLinkComponent.html b/src/app/utilities/project-link/ProjectLinkComponent.html
new file mode 100644
index 0000000..6d29f0b
--- /dev/null
+++ b/src/app/utilities/project-link/ProjectLinkComponent.html
@@ -0,0 +1,25 @@
+<!--
+Copyright 2020 TATA ELXSI
+
+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.
+
+Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+-->
+<a *ngIf="isPresent" class="link" [ngClass]="value.projectName === selectedProject ? 'activeProject' : ''"
+ href="javascript:void(0);"
+ (click)="value.projectName === selectedProject ? '' : this.projectService.switchProjectModal(value)" placement="right" container="body" ngbTooltip="{{ (value.projectName === selectedProject ? 'CURRENTPROJECT' : 'SWITCHPROJECT') | translate}}">
+ <span>{{value.projectName}}</span>
+ <i *ngIf="value.projectName === selectedProject" class="fas fa-check-circle text-success"></i>
+ <i *ngIf="value.projectName !== selectedProject" class="fas fa-exchange-alt text-danger"></i>
+</a>
+<span *ngIf="!isPresent">{{value.projectName}}</span>
\ No newline at end of file
diff --git a/src/app/utilities/project-link/ProjectLinkComponent.scss b/src/app/utilities/project-link/ProjectLinkComponent.scss
new file mode 100644
index 0000000..152cf8d
--- /dev/null
+++ b/src/app/utilities/project-link/ProjectLinkComponent.scss
@@ -0,0 +1,28 @@
+/*
+ Copyright 2020 TATA ELXSI
+
+ 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.
+
+ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+*/
+@import '../../../assets/scss/mixins/mixin';
+@import '../../../assets/scss/variable';
+.link{
+ text-decoration: none !important;
+ &.activeProject{
+ border-radius: 3px;
+ @include padding-value(2, 2, 2, 2);
+ text-decoration: none !important;
+ cursor: default;
+ }
+}
\ No newline at end of file
diff --git a/src/app/utilities/project-link/ProjectLinkComponent.ts b/src/app/utilities/project-link/ProjectLinkComponent.ts
new file mode 100644
index 0000000..35c5b2c
--- /dev/null
+++ b/src/app/utilities/project-link/ProjectLinkComponent.ts
@@ -0,0 +1,81 @@
+/*
+ Copyright 2020 TATA ELXSI
+
+ 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.
+
+ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
+*/
+/**
+ * @file Project Link Component.
+ */
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';
+import { environment } from 'environment';
+import { ProjectData } from 'ProjectModel';
+import { ProjectService } from 'ProjectService';
+import { RestService } from 'RestService';
+import { UserDetail } from 'UserModel';
+/**
+ * Creating component
+ * @Component takes ProjectLinkComponent.html as template url
+ */
+@Component({
+ selector: 'app-project-link',
+ templateUrl: './ProjectLinkComponent.html',
+ styleUrls: ['./ProjectLinkComponent.scss'],
+ changeDetection: ChangeDetectionStrategy.OnPush
+})
+/** Exporting a class @exports ProjectLinkComponent */
+export class ProjectLinkComponent implements OnInit {
+ /** Invoke service injectors @public */
+ public injector: Injector;
+ /** Variables holds the selected project @public */
+ public selectedProject: string;
+ /** To get the value from the nspackage via valuePrepareFunction default Property of ng-smarttable @public */
+ public value: ProjectData;
+ /** Variables holds all the projects @public */
+ public projectList: {}[] = [];
+ /** Check the project is present for the user @public */
+ public isPresent: boolean = false;
+ /** Set timeout @private */
+ private timeOut: number = 10;
+ /** Instance of the rest service @private */
+ private restService: RestService;
+ /** Holds all project details @private */
+ private projectService: ProjectService;
+ /** Detect changes for the User Input */
+ private cd: ChangeDetectorRef;
+ constructor(injector: Injector) {
+ this.injector = injector;
+ this.projectService = this.injector.get(ProjectService);
+ this.restService = this.injector.get(RestService);
+ this.cd = this.injector.get(ChangeDetectorRef);
+ }
+
+ public ngOnInit(): void {
+ this.selectedProject = localStorage.getItem('project');
+ this.getAdminProjects();
+ }
+
+ /** Get the admin projects to be selectable @public */
+ public getAdminProjects(): void {
+ const username: string = localStorage.getItem('username');
+ this.restService.getResource(environment.USERS_URL + '/' + username).subscribe((projects: UserDetail) => {
+ this.projectList = projects.project_role_mappings;
+ this.isPresent = this.projectList.some((item: ProjectData) => item.project === this.value.project);
+ setTimeout(() => {
+ this.cd.detectChanges();
+ }, this.timeOut);
+ });
+ }
+
+}