Skip to content

Commit

Permalink
changed: management of sidebar icon with env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Panico committed Oct 4, 2024
1 parent 423a9df commit c56b845
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 25 deletions.
46 changes: 24 additions & 22 deletions src/app/components/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,22 @@
<!-- ------------------------------------------- -->
<!-- Conversations (MONITOR) (click)="goToConversations()" -->
<!-- ------------------------------------------- -->
<!-- <ng-container *ngIf="USER_ROLE !== 'agent'"> -->
<div matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
<a target="_self" href="{{ dashboard_convs_url }}" class="customAncor">
<!-- <i class="material-icons sidebar-icons">forum</i> -->
<span class="realtime-icon-wpr" >
<svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 5px;">
<path d="M17.9,11.6l-1.4,1.9l-3.2-5.6l-1-2l-0.2,0.2l-3.7,6.4l-3-4.8L2.7,9.9v2.4l2.4-1.8L9,16.2l3.3-6.2l4,6.7l2.7-3.3
l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
</svg>
</span>

</a>
</div>
<!-- </ng-container> -->
<ng-container *ngIf="isVisibleMON">
<div matTooltipClass="custom-mat-tooltip" matTooltip="Monitor"
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
<a target="_self" href="{{ dashboard_convs_url }}" class="customAncor">
<!-- <i class="material-icons sidebar-icons">forum</i> -->
<span class="realtime-icon-wpr" >
<svg version="1.1" id="Livello_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve" style="width: 30px;height: 30px;margin-top: 5px;">
<path d="M17.9,11.6l-1.4,1.9l-3.2-5.6l-1-2l-0.2,0.2l-3.7,6.4l-3-4.8L2.7,9.9v2.4l2.4-1.8L9,16.2l3.3-6.2l4,6.7l2.7-3.3
l0.9,0c0.5-0.7,1-1.4,1.4-2L17.9,11.6z"/>
</svg>
</span>
</a>
</div>
</ng-container>

</div>

Expand All @@ -125,12 +125,14 @@
<!-- ------------------------------------------- -->
<!-- CONTACTS (LEADS) (click)="goToContacts()" -->
<!-- ------------------------------------------- -->
<div matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
<a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
<i class="material-icons sidebar-icons">contacts</i>
</a>
</div>
<ng-container *ngIf="isVisibleCNT">
<div matTooltipClass="custom-mat-tooltip" matTooltip="{{ contacts_lbl }}"
#tooltip="matTooltip" matTooltipPosition='right' matTooltipHideDelay="100">
<a target="_self" href="{{ dashboard_contacts_url }}" class="customAncor">
<i class="material-icons sidebar-icons">contacts</i>
</a>
</div>
</ng-container>


<!-- ------------------------------------------- -->
Expand Down
32 changes: 29 additions & 3 deletions src/app/components/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export class SidebarComponent implements OnInit {
isVisibleAPP: boolean;
isVisibleANA: boolean;
isVisibleACT: boolean;
isVisibleMON: boolean;
isVisibleCNT: boolean;
photo_profile_URL: string;
project_id: string;
DASHBOARD_URL: string;
Expand Down Expand Up @@ -298,26 +300,50 @@ export class SidebarComponent implements OnInit {
this.isVisibleAPP = true;
}
}

if (key.includes("MON")) {
let lbs = key.split(":");
if (lbs[1] === "F") {
this.isVisibleMON = false;
} else {
this.isVisibleMON = true;
}
}

if (key.includes("CNT")) {
let lbs = key.split(":");
if (lbs[1] === "F") {
this.isVisibleCNT = false;
} else {
this.isVisibleCNT = true;
}
}

});


if (!this.public_Key.includes("ANA")) {
this.isVisibleANA = false;
}

if (!this.public_Key.includes("ACT")) {
this.isVisibleACT = false;
}


if (!this.public_Key.includes("APP")) {
this.isVisibleAPP = false;
}
if (!this.public_Key.includes("MON")) {
this.isVisibleMON = false;
}
if (!this.public_Key.includes("CNT")) {
this.isVisibleCNT = false;
}

} else {
this.isVisibleANA = false;
this.isVisibleACT = false;
this.isVisibleAPP = false;
this.isVisibleMON = false;
this.isVisibleCNT = false;
}


Expand Down

0 comments on commit c56b845

Please sign in to comment.