|
@@ -4,38 +4,40 @@ const { dashboardIcon, staffMemberIcon, staffingAgencyIcon, laborIcon, retailerI
|
|
|
|
|
|
|
|
app.component('appUserAreaNav', {
|
|
app.component('appUserAreaNav', {
|
|
|
template: html`
|
|
template: html`
|
|
|
- <h3>
|
|
|
|
|
- Intelligence
|
|
|
|
|
- </h3>
|
|
|
|
|
|
|
+ <div ng-if="$ctrl.api.claims.METRICS_VIEW">
|
|
|
|
|
+ <h3>
|
|
|
|
|
+ Intelligence
|
|
|
|
|
+ </h3>
|
|
|
|
|
|
|
|
- <md-menu-item>
|
|
|
|
|
- <md-button ng-href="/dashboard">
|
|
|
|
|
- <md-icon md-svg-icon="${dashboardIcon}"></md-icon>
|
|
|
|
|
- Dashboard
|
|
|
|
|
- </md-button>
|
|
|
|
|
- </md-menu-item>
|
|
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.METRICS_VIEW">
|
|
|
|
|
+ <md-button ng-href="/dashboard">
|
|
|
|
|
+ <md-icon md-svg-icon="${dashboardIcon}"></md-icon>
|
|
|
|
|
+ Dashboard
|
|
|
|
|
+ </md-button>
|
|
|
|
|
+ </md-menu-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div ng-repeat="location in ctrl.locations">
|
|
|
|
|
|
|
+ <div ng-repeat="location in $ctrl.locations">
|
|
|
<h3>{{::location.name}}</h3>
|
|
<h3>{{::location.name}}</h3>
|
|
|
- <md-menu-item>
|
|
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.LABOR_VIEW">
|
|
|
<md-button ng-href="/labor/{{::location.key}}">
|
|
<md-button ng-href="/labor/{{::location.key}}">
|
|
|
<md-icon md-svg-icon="${laborIcon}"></md-icon>
|
|
<md-icon md-svg-icon="${laborIcon}"></md-icon>
|
|
|
{{::location.key}} Labor
|
|
{{::location.key}} Labor
|
|
|
</md-button>
|
|
</md-button>
|
|
|
</md-menu-item>
|
|
</md-menu-item>
|
|
|
- <md-menu-item>
|
|
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.SERVICES_VIEW">
|
|
|
<md-button ng-href="/services/{{::location.key}}">
|
|
<md-button ng-href="/services/{{::location.key}}">
|
|
|
<md-icon md-svg-icon="${serviceIcon}"></md-icon>
|
|
<md-icon md-svg-icon="${serviceIcon}"></md-icon>
|
|
|
{{::location.key}} Services
|
|
{{::location.key}} Services
|
|
|
</md-button>
|
|
</md-button>
|
|
|
</md-menu-item>
|
|
</md-menu-item>
|
|
|
- <md-menu-item>
|
|
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.STAFF_MEMBER_READ">
|
|
|
<md-button ng-href="/staff-members/{{::location.key}}">
|
|
<md-button ng-href="/staff-members/{{::location.key}}">
|
|
|
<md-icon md-svg-icon="${staffMemberIcon}"></md-icon>
|
|
<md-icon md-svg-icon="${staffMemberIcon}"></md-icon>
|
|
|
{{::location.key}} Staff Members
|
|
{{::location.key}} Staff Members
|
|
|
</md-button>
|
|
</md-button>
|
|
|
</md-menu-item>
|
|
</md-menu-item>
|
|
|
- <md-menu-item>
|
|
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.RETAILER_READ">
|
|
|
<md-button ng-href="/retailers/{{::location.key}}">
|
|
<md-button ng-href="/retailers/{{::location.key}}">
|
|
|
<md-icon md-svg-icon="${retailerIcon}"></md-icon>
|
|
<md-icon md-svg-icon="${retailerIcon}"></md-icon>
|
|
|
{{::location.key}} Clients
|
|
{{::location.key}} Clients
|
|
@@ -43,31 +45,34 @@ app.component('appUserAreaNav', {
|
|
|
</md-menu-item>
|
|
</md-menu-item>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <h3>All</h3>
|
|
|
|
|
- <md-menu-item>
|
|
|
|
|
- <md-button ng-href="/staff-members/all">
|
|
|
|
|
- <md-icon md-svg-icon="${staffMemberIcon}"></md-icon>
|
|
|
|
|
- Staff Members
|
|
|
|
|
- </md-button>
|
|
|
|
|
- </md-menu-item>
|
|
|
|
|
- <md-menu-item>
|
|
|
|
|
- <md-button ng-href="/staffing-agencies">
|
|
|
|
|
- <md-icon md-svg-icon="${staffingAgencyIcon}"></md-icon>
|
|
|
|
|
- Staffing Agencies
|
|
|
|
|
- </md-button>
|
|
|
|
|
- </md-menu-item>
|
|
|
|
|
- <md-menu-item>
|
|
|
|
|
- <md-button ng-href="/retailers/all">
|
|
|
|
|
- <md-icon md-svg-icon="${retailerIcon}"></md-icon>
|
|
|
|
|
- Clients
|
|
|
|
|
- </md-button>
|
|
|
|
|
- </md-menu-item>
|
|
|
|
|
|
|
+ <div ng-if="$ctrl.api.claims.LOCATION_ALL_ACCESS">
|
|
|
|
|
+ <h3>All</h3>
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.STAFF_MEMBER_READ">
|
|
|
|
|
+ <md-button ng-href="/staff-members/all">
|
|
|
|
|
+ <md-icon md-svg-icon="${staffMemberIcon}"></md-icon>
|
|
|
|
|
+ Staff Members
|
|
|
|
|
+ </md-button>
|
|
|
|
|
+ </md-menu-item>
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.STAFFING_AGENCY_READ">
|
|
|
|
|
+ <md-button ng-href="/staffing-agencies">
|
|
|
|
|
+ <md-icon md-svg-icon="${staffingAgencyIcon}"></md-icon>
|
|
|
|
|
+ Staffing Agencies
|
|
|
|
|
+ </md-button>
|
|
|
|
|
+ </md-menu-item>
|
|
|
|
|
+ <md-menu-item ng-if="$ctrl.api.claims.RETAILER_READ">
|
|
|
|
|
+ <md-button ng-href="/retailers/all">
|
|
|
|
|
+ <md-icon md-svg-icon="${retailerIcon}"></md-icon>
|
|
|
|
|
+ Clients
|
|
|
|
|
+ </md-button>
|
|
|
|
|
+ </md-menu-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
`,
|
|
`,
|
|
|
- controllerAs: 'ctrl',
|
|
|
|
|
controller: function(api) {
|
|
controller: function(api) {
|
|
|
- window.api = api.locations().then(locations => {
|
|
|
|
|
|
|
+ this.api = api
|
|
|
|
|
+ api.locations().then(locations => {
|
|
|
this.locations = _.sortBy(locations, 'key')
|
|
this.locations = _.sortBy(locations, 'key')
|
|
|
|
|
+ .filter(({key}) => api.claims[`LOCATION_${key}_ACCESS`])
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|