@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 +1 -1
- package/src/components/mbg-average-customer-time/mbg-average-customer-time.html +3 -3
- package/src/components/mbg-average-customer-time/mbg-average-customer-time.ts +22 -4
- package/src/components/mbg-store-goal/mbg-store-goal.html +5 -5
- package/src/components/mbg-store-goal/mbg-store-goal.scss +5 -4
- package/src/components/mbg-store-goal/mbg-store-goal.ts +2 -0
package/package.json
CHANGED
|
@@ -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
|
|
13
|
-
<i ng-if="
|
|
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="
|
|
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 =
|
|
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:
|
|
183
|
+
enabled: hasPermissionPorcentages,
|
|
167
184
|
formatter: function () {
|
|
168
|
-
if (
|
|
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
|
|
2
|
-
class="
|
|
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="
|
|
20
|
-
<i ng-if="$ctrl.hideValue &&
|
|
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 &&
|
|
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
|
-
|
|
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',
|