@afeefa/vue-app 0.0.116 → 0.0.117

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.
@@ -1 +1 @@
1
- 0.0.116
1
+ 0.0.117
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.116",
3
+ "version": "0.0.117",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -3,6 +3,7 @@
3
3
  ref="radios"
4
4
  :rules="validationRules"
5
5
  :class="{hasLabel: $has.label}"
6
+ :valueComparator="compareValues"
6
7
  v-bind="$attrs"
7
8
  @change="$emit('input', $event)"
8
9
  >
@@ -22,6 +23,7 @@
22
23
 
23
24
  <script>
24
25
  import { Component, Vue, Watch } from '@a-vue'
26
+ import { Model } from '@afeefa/api-resources-client'
25
27
 
26
28
  @Component({
27
29
  props: ['options', 'validator']
@@ -56,6 +58,13 @@ export default class ARadioGroup extends Vue {
56
58
  }
57
59
  }
58
60
 
61
+ compareValues (a, b) {
62
+ if (a instanceof Model && b instanceof Model) {
63
+ return a.equals(b)
64
+ }
65
+ return JSON.stringify(a) === JSON.stringify(b)
66
+ }
67
+
59
68
  get validationRules () {
60
69
  const label = this.$attrs.label
61
70
  return (this.validator && this.validator.getRules(label)) || []
@@ -53,7 +53,7 @@ export default class ASelect extends Mixins(ComponentWidthMixin) {
53
53
  }
54
54
 
55
55
  if (a instanceof Model && b instanceof Model) {
56
- return a.id === b.id && a.type === b.type
56
+ return a.equals(b)
57
57
  }
58
58
 
59
59
  return JSON.stringify(a) === JSON.stringify(b)
@@ -18,9 +18,7 @@ export default class FormFieldRadioGroup extends Mixins(FormFieldMixin) {
18
18
  options = null
19
19
 
20
20
  created () {
21
- if (this.fieldHasOptionsRequest()) {
22
- this.options = this.getSelectOptions()
23
- } else if (this.fieldHasOptions()) {
21
+ if (this.fieldHasOptionsRequest() || this.fieldHasOptions()) {
24
22
  this.options = this.getSelectOptions()
25
23
  }
26
24
  }
@@ -50,8 +50,8 @@
50
50
  <div>
51
51
  <div class="accountName">
52
52
  {{ account.first_name }}
53
- <template v-if="$auth.roles()[0]">
54
- ({{ $auth.roles()[0].title }})
53
+ <template v-if="$auth.roles[0]">
54
+ ({{ $auth.roles[0].title }})
55
55
  </template>
56
56
  </div>
57
57
 
@@ -10,7 +10,9 @@ class AuthPlugin {
10
10
 
11
11
  hasRole: name => authService.currentAccountHasRole(name),
12
12
 
13
- roles: () => authService.getCurrentAccountRoles(),
13
+ get roles () {
14
+ return authService.getCurrentAccountRoles()
15
+ },
14
16
 
15
17
  logout: () => authService.forwardToLogoutEndpoint()
16
18
  }