@kigi/components 1.42.0-alpha.3 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kigi/components",
3
- "version": "1.42.0-alpha.3",
3
+ "version": "1.42.0",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -9,11 +9,11 @@
9
9
  aria-hidden="true"
10
10
  uib-tooltip="Sem permissão para visualizar"
11
11
  tooltip-placement="left"
12
- ng-if="$ctrl.isBlockValuesDashboarReturnCustomer && !$ctrl.hideValue"></i>
13
- <i ng-if="!$ctrl.hideValue && $ctrl.isPermissionAverageCustomerReturnTime"
12
+ ng-if="$ctrl.isBlockValuesDashboarReturnCustomer"></i>
13
+ <i ng-if="$ctrl.hideValue && !$ctrl.isBlockValuesDashboarReturnCustomer"
14
14
  disable-animate
15
15
  class="far fa-eye eye-board-target"></i>
16
- <i ng-if="$ctrl.hideValue && $ctrl.isPermissionAverageCustomerReturnTime"
16
+ <i ng-if="!$ctrl.hideValue && !$ctrl.isBlockValuesDashboarReturnCustomer"
17
17
  disable-animate
18
18
  class="far fa-eye-slash eye-board-target"></i>
19
19
  </div>
@@ -15,6 +15,7 @@ class MbgAverageCustomerTimeController {
15
15
  private isBlockValuesDashboarReturnCustomer
16
16
  private hideValue: boolean = false
17
17
  private boundAdjustContainerWidth
18
+ private allowDashBoardAutoValues
18
19
 
19
20
  constructor(
20
21
  public $scope,
@@ -28,6 +29,7 @@ class MbgAverageCustomerTimeController {
28
29
  async $onInit() {
29
30
  this.isBlockValuesDashboarReturnCustomer =
30
31
  !this.allowedToSee || !this.isPermissionAverageCustomerReturnTime
32
+ this.initialize()
31
33
  this.$scope.$watch(
32
34
  '$ctrl.percentagesReturnCustomerTime',
33
35
  (data) => {
@@ -50,6 +52,21 @@ class MbgAverageCustomerTimeController {
50
52
  window.addEventListener('resize', this.boundAdjustContainerWidth)
51
53
  }
52
54
 
55
+ initialize() {
56
+ if (this.allowDashBoardAutoValues) {
57
+ this.hideValue = this.isPermissionAverageCustomerReturnTime ? true : false
58
+ return
59
+ }
60
+
61
+ if (this.allowedToSee && !this.allowDashBoardAutoValues) {
62
+ this.hideValue =
63
+ this.allowDashBoardAutoValues && this.isPermissionAverageCustomerReturnTime ? true : false
64
+ return
65
+ }
66
+
67
+ this.hideValue = this.allowedToSee && this.isPermissionAverageCustomerReturnTime ? true : false
68
+ }
69
+
53
70
  $onDestroy() {
54
71
  window.removeEventListener('resize', this.boundAdjustContainerWidth)
55
72
  }
@@ -67,7 +84,7 @@ class MbgAverageCustomerTimeController {
67
84
 
68
85
  configPanelPercentagesReturnCustomerTime() {
69
86
  const colors = ['#696EF0', '#45C413', '#F8D658', '#F5AE3C', '#FF8A22', '#FF4641']
70
- const hasPermissionPorcentages = !this.isPermissionAverageCustomerReturnTime || this.hideValue
87
+ const hasPermissionPorcentages = this.hideValue
71
88
  const transformedData = this.percentagesReturnCustomerTime.map((item, index) => {
72
89
  let daysLabel = ''
73
90
  switch (index) {
@@ -163,9 +180,9 @@ class MbgAverageCustomerTimeController {
163
180
  cursor: 'pointer',
164
181
  borderRadius: 8,
165
182
  dataLabels: {
166
- enabled: !hasPermissionPorcentages,
183
+ enabled: hasPermissionPorcentages,
167
184
  formatter: function () {
168
- if (!hasPermissionPorcentages) {
185
+ if (hasPermissionPorcentages) {
169
186
  return `<span style="color:#7B7B7B">${
170
187
  this.point.days
171
188
  } dias</span><br><span style="font-weight:bold; color:#333">(${this.y.toFixed(
@@ -183,7 +200,7 @@ class MbgAverageCustomerTimeController {
183
200
  tooltip: {
184
201
  backgroundColor: '#FFF',
185
202
  formatter: function () {
186
- if (hasPermissionPorcentages) {
203
+ if (!hasPermissionPorcentages) {
187
204
  return 'Sem permissão para visualizar'
188
205
  }
189
206
  return `<b>${this.point.days} dias</b><br>Porcentagem: ${this.y.toFixed(
@@ -241,6 +258,7 @@ const mbgAverageCustomerTime = {
241
258
  allowedToSee: '=?',
242
259
  allowedCallBack: '&?',
243
260
  isBlockValuesDashboarReturnCustomer: '=?',
261
+ allowDashBoardAutoValues: '=?',
244
262
  },
245
263
  template,
246
264
  controller: MbgAverageCustomerTimeController,
@@ -1,5 +1,5 @@
1
- <div ng-class="{'opacity-dash-goal': !$ctrl.isPermissionStoreGoal}"
2
- class="store-goal-wrapper"
1
+ <div class="store-goal-wrapper"
2
+ ng-class="{'opacity-dash-goal': $ctrl.blockStoreGoal}"
3
3
  ng-show="$ctrl.showDashboard">
4
4
  <div class="description-container-dash">
5
5
  <p class="description-dash">
@@ -16,11 +16,11 @@
16
16
  aria-hidden="true"
17
17
  uib-tooltip="Sem permissão para visualizar"
18
18
  tooltip-placement="left"
19
- ng-if="!$ctrl.isPermissionStoreGoal"></i>
20
- <i ng-if="$ctrl.hideValue && $ctrl.isPermissionStoreGoal"
19
+ ng-if="$ctrl.blockStoreGoal"></i>
20
+ <i ng-if="$ctrl.hideValue && !$ctrl.blockStoreGoal"
21
21
  disable-animate
22
22
  class="far fa-eye eye-board-target"></i>
23
- <i ng-if="!$ctrl.hideValue && $ctrl.isPermissionStoreGoal"
23
+ <i ng-if="!$ctrl.hideValue && !$ctrl.blockStoreGoal"
24
24
  disable-animate
25
25
  class="far fa-eye-slash eye-board-target"></i>
26
26
  </div>
@@ -120,9 +120,7 @@
120
120
  bottom: 195px;
121
121
  }
122
122
 
123
- .opacity-dash-goal {
124
- opacity: 0.5;
125
- }
123
+
126
124
 
127
125
  .goal-target {
128
126
  position: relative;
@@ -207,7 +205,6 @@
207
205
 
208
206
  .lock-dash-store {
209
207
  position: relative;
210
- right: -20px;
211
208
  }
212
209
 
213
210
  .show-tooltip {
@@ -317,6 +314,10 @@
317
314
 
318
315
  }
319
316
 
317
+ .opacity-dash-goal {
318
+ opacity: 0.6;
319
+ }
320
+
320
321
  .hide-goal {
321
322
  display: flex;
322
323
  justify-content: center;
@@ -28,6 +28,7 @@ class MbgStoreGoalController {
28
28
  private percentageEstimatedMessage
29
29
  private showDashboard: boolean = false
30
30
  private indexActiveSlide
31
+ private blockStoreGoal
31
32
 
32
33
  constructor(
33
34
  public $scope,
@@ -39,6 +40,7 @@ class MbgStoreGoalController {
39
40
  ) {}
40
41
 
41
42
  async $onInit() {
43
+ this.blockStoreGoal = !this.allowedToSee || !this.isPermissionStoreGoal
42
44
  this.initialize()
43
45
  this.$scope.$watch(
44
46
  '$ctrl.goalDataForTheMonth',