1.100.0 • Published 7 months ago

dc-common v1.100.0

Weekly downloads
5
License
MIT
Repository
-
Last release
7 months ago

DC-Common NPM Library

Steps To follow to integrate Dc-Common NPM Library:-

Dc-Common NPM Library URL:-

https://www.npmjs.com/package/dc-common

  1. Install the Library:-

Install the library into your application by the command

npm i dc-common

  1. Import " HeaderFooterModule" and "overlayService" to your app.module.ts
  2. import { NgModule } from'@angular/core';
  3. import { BrowserModule } from'@angular/platform-browser';
  4. import { AppComponent } from'./app';
  5. import { HeaderFooterModule } from '../../node_modules/dc-common/src/app/headerFooter.module';
  6. import { OverlayService } from '../../node_modules/dc-common/src/app/services/verlay.service';
  7. @NgModule({
  8. imports: BrowserModule, HeaderFooterModule,
  9. declarations: AppComponent,
  10. bootstrap: AppComponent,
  11. providers: OverlayService,
  12. })
  13. exportclassAppModule {}
  1. Now let's add the component definition to our template. Edit app/app.component.html as fallows
  2. \<divclass="content-fluid"\>
  3. \<DC-Sidebar-Tab\>\</DC-Sidebar-Tab\>
  4. \<main#mainWrapperclass="main_wrap"\>
  5. \&lt;DC-Header-Tab\&gt;\&lt;/DC-Header-Tab\&gt;
  6. \&lt;divclass=&quot;container&quot;\&gt;
  7.   \&lt;router-outlet\&gt;
  8.     \&lt;endpoint-watcher\&gt;\&lt;/endpoint-watcher\&gt;
  9.   \&lt;/router-outlet\&gt;
  10. \&lt;/div\&gt;
  11. \&lt;DC-Footer-Tab\&gt;\&lt;/DC-Footer-Tab\&gt;
  12. \</main\>
  13. \</div\>

  14. Now let's add the overlayService in the components and add the path of overlayservice pointing to node_Module and pass the Track Name, Page Name, Tab Names(optional perameter) to overlayService by the method setOverlayImage.

Eg:-

import { Component, OnInit, Output, EventEmitter, ElementRef, ViewChild,

HostListener, Input, ChangeDetectorRef , OnChanges} from'@angular/core';

//import OverlayService pointing the path to node_module

import { OverlayService } from'../../node_modules/header-footer/src/app/services/overlay.service';

@Component({

selector:'app-root',

templateUrl:'./app.component.html',

styleUrls: './app.component.css'

})

exportclassAppComponentimplementsOnInit {

constructor(

//to initiate the overlayService in the component add overlayService in the constructor

privateoverlayService: OverlayService,

) { }

ngOnInit() {

//pass the Track Name, Page Name, Tab Names(optional perameter) to overlayService by the method setOverlayImage

this.overlayService.setOverlayImg(&#39;Hardware&#39;, &#39;Home&#39;);

}

}

Parameters to be passed for DC-Header-Tab :-

Parameters Type:-

// Input Parameters from other applications

// UserId and UserName is to be passed in order to mitigate the getUserId calls

userData: any = {

userId:&#39;anthfern&#39;,

userName:&#39;Subba Reddy Nusum&#39;,

};

// piwikData has to be passed PiwikSite and piwikId are different for different tracts

piwikData: any = {

 piwikSite:&#39;\*.devscui-stg.cloudapps.cisco.com&#39;,

 piwikSiteId:&#39;10&#39;,

};

// Base Url should be passed to let library known in what environment the user is in

localHostMode: string = 'https://dc-stg1.cisco.com';

// End url has to passed by the Tracks who are using wrapper service if not default url will be used

getMenuListUrl: string = 'devscapp/dsc/getMenuList';

getHWPUserAccessUrl: string = 'devscapp/dsc/getHWPUserAccess';

notificationsUrl: string = 'devscapp/dsc/notifications1';

getSEEMAdminsUrl: string = 'getSEEMAdmins';

overlayUrl: string = 'devscapp/images/imagemap';

getTracksUrl: string = 'devscapp/sef/getReleaseRevisionTracks';

//Input parameters ends here

How to pass parameters in app.component.html for DC-Header-Tab Tag

\<DC-Header-TabpiwikData='this.piwikData'localHostMode='this.localHostMode'

getMenuListUrl='this.getMenuListUrl'

getHWPUserAccessUrl='this.getHWPUserAccessUrl'

  [notificationsUrl]=&#39;this.notificationsUrl&#39;[getSEEMAdminsUrl]=&#39;this.getSEEMAdminsUrl&#39;[overlayUrl]=&#39;this.overlayUrl&#39;[getTracksUrl]=&#39;this.getTracksUrl&#39;\&gt;\&lt;/DC-Header-Tab\&gt;
1.100.0

7 months ago

1.99.0

2 years ago

1.98.0

2 years ago

1.96.0

3 years ago

1.95.0

3 years ago

1.94.0

3 years ago

1.93.0

3 years ago

1.92.0

3 years ago

1.91.0

3 years ago

1.90.0

3 years ago

1.89.0

3 years ago

1.88.0

4 years ago

1.87.0

4 years ago

1.86.0

4 years ago

1.85.0

4 years ago

1.84.0

4 years ago

1.83.0

4 years ago

1.82.0

4 years ago

1.81.0

4 years ago

1.80.0

4 years ago

1.79.0

4 years ago

1.78.0

4 years ago

1.77.0

4 years ago

1.76.0

4 years ago

1.75.0

4 years ago

1.74.0

4 years ago

1.73.0

4 years ago

1.72.0

4 years ago

1.71.0

4 years ago

1.70.0

4 years ago

1.69.0

4 years ago

1.68.0

4 years ago

1.67.0

4 years ago

1.66.0

4 years ago

1.65.0

4 years ago

1.64.0

4 years ago

1.63.0

4 years ago

1.62.0

4 years ago

1.61.0

4 years ago

1.60.0

4 years ago

1.59.0

4 years ago

1.58.0

4 years ago

1.57.0

4 years ago

1.56.0

4 years ago

1.55.0

4 years ago

1.54.0

4 years ago

1.53.0

4 years ago

1.52.0

4 years ago

1.51.0

4 years ago

1.50.0

4 years ago

1.49.0

4 years ago

1.48.0

4 years ago

1.47.0

4 years ago

1.46.0

4 years ago

1.45.0

4 years ago

1.44.0

4 years ago

1.43.0

4 years ago

1.42.0

4 years ago

1.41.0

4 years ago

1.40.0

4 years ago

1.39.0

4 years ago

1.38.0

4 years ago

1.37.0

4 years ago

1.36.0

4 years ago

1.35.0

5 years ago

1.34.0

5 years ago

1.33.0

5 years ago

1.32.0

5 years ago

1.31.0

5 years ago

1.30.0

5 years ago

1.29.0

5 years ago

1.28.0

5 years ago

1.27.0

5 years ago

1.26.0

5 years ago

1.25.0

5 years ago

1.24.0

5 years ago

1.23.0

5 years ago

1.22.0

5 years ago

1.21.0

5 years ago

1.20.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

2.2.0

5 years ago