@afeefa/vue-app 0.0.50 → 0.0.51

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.50
1
+ 0.0.51
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -197,6 +197,7 @@ export class RemoveAction {
197
197
  .params({
198
198
  id: this.id
199
199
  })
200
+ .data(null)
200
201
  .send()
201
202
 
202
203
  if (this.afterRemoveHook) {
@@ -6,7 +6,7 @@
6
6
  >
7
7
  <slot name="activator">
8
8
  <a-icon class="contextButton">
9
- $dotsHorizontalIcon
9
+ {{ triggerIcon || '$dotsHorizontalIcon' }}
10
10
  </a-icon>
11
11
  </slot>
12
12
  </div>
@@ -31,7 +31,7 @@ import { Positions, PositionConfig } from '../services/PositionService'
31
31
  import { randomCssClass } from '../utils/random'
32
32
 
33
33
  @Component({
34
- props: ['contentHeight', 'repositionWatchKey']
34
+ props: ['contentHeight', 'repositionWatchKey', 'triggerIcon']
35
35
  })
36
36
  export default class AContextMenu extends Mixins(UsesPositionServiceMixin) {
37
37
  CONTEXT_MENU = true
@@ -10,7 +10,9 @@
10
10
  <script>
11
11
  import { Component, Vue } from 'vue-property-decorator'
12
12
 
13
- @Component
13
+ @Component({
14
+ props: ['to']
15
+ })
14
16
  export default class AContextMenuItem extends Vue {
15
17
  get contextMenu () {
16
18
  let parent = this.$parent
@@ -25,7 +27,12 @@ export default class AContextMenuItem extends Vue {
25
27
 
26
28
  click () {
27
29
  this.contextMenu.close()
28
- this.$emit('click')
30
+ if (this.to) {
31
+ this.$router.push(this.to)
32
+ .catch(() => null) // prevent duplicated navigation
33
+ } else {
34
+ this.$emit('click')
35
+ }
29
36
  }
30
37
  }
31
38
  </script>
@@ -59,32 +59,14 @@
59
59
  </div>
60
60
  </div>
61
61
 
62
- <v-menu top>
63
- <template #activator="{ on, attrs }">
64
- <v-icon
65
- class="contextButton"
66
- v-bind="attrs"
67
- v-on="on"
68
- >
69
- $dotsVerticalIcon
70
- </v-icon>
71
- </template>
72
-
73
- <v-list
74
- class="pa-0"
62
+ <a-context-menu triggerIcon="$dotsVerticalIcon">
63
+ <a-context-menu-item
64
+ :to="{name: 'settings', params: {accountId: account.id}}"
75
65
  >
76
- <v-list-item :to="{name: 'accounts.edit', params: {accountId: account.id}}">
77
- <v-list-item-icon class="ma-0 mr-2 align-self-center">
78
- <v-icon class="ml-n1 mr-1">
79
- $pencilIcon
80
- </v-icon>
81
- </v-list-item-icon>
82
- <v-list-item-title>
83
- Einstellungen
84
- </v-list-item-title>
85
- </v-list-item>
86
- </v-list>
87
- </v-menu>
66
+ <v-icon>$pencilIcon</v-icon>
67
+ Einstellungen
68
+ </a-context-menu-item>
69
+ </a-context-menu>
88
70
  </div>
89
71
  </v-container>
90
72
  </v-container>
@@ -69,7 +69,7 @@ export default class CreatePage extends Mixins(EditPageMixin) {
69
69
  }
70
70
 
71
71
  get modelUpateAction () {
72
- return this.editConfig.createAction || this.ModelClass.getAction('create')
72
+ return this.editConfig.createAction || this.ModelClass.getAction('save')
73
73
  }
74
74
 
75
75
  get _icon () {
@@ -110,7 +110,7 @@ export default class DetailPage extends Vue {
110
110
  }
111
111
 
112
112
  get _deleteAction () {
113
- return this.detailConfig.removeAction || this.ModelClass.getAction('delete')
113
+ return this.detailConfig.removeAction || this.ModelClass.getAction('save')
114
114
  }
115
115
 
116
116
  async remove () {
@@ -99,7 +99,7 @@ export default class EditPage extends Mixins(EditPageMixin) {
99
99
  }
100
100
 
101
101
  get modelUpateAction () {
102
- return this.editConfig.updateAction || this.ModelClass.getAction('update')
102
+ return this.editConfig.updateAction || this.ModelClass.getAction('save')
103
103
  }
104
104
 
105
105
  get _getAction () {
@@ -29,7 +29,7 @@ function load (route) {
29
29
  return new GetAction()
30
30
  .setAction(action)
31
31
  .setFields(detailConfig.fields)
32
- .setId(route.params[routeDefinition.idKey])
32
+ .setId(detailConfig.id || route.params[routeDefinition.idKey])
33
33
  .load()
34
34
  }
35
35
 
@@ -30,7 +30,7 @@ function load (route) {
30
30
  return new GetAction()
31
31
  .setAction(action)
32
32
  .setFields(editConfig.fields)
33
- .setId(route.params[routeDefinition.idKey])
33
+ .setId(editConfig.id || route.params[routeDefinition.idKey])
34
34
  .load()
35
35
  }
36
36