@afeefa/vue-app 0.0.175 → 0.0.177

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 0.0.175
1
+ 0.0.177
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.175",
3
+ "version": "0.0.177",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
 
69
69
  <script>
70
- import { Component, Watch, Vue } from 'vue-property-decorator'
70
+ import { Component, Watch, Vue } from '@a-vue'
71
71
  import moment from 'moment'
72
72
  import formatHour from '@a-vue/utils/format-hour'
73
73
  import formatMinutes from '@a-vue/utils/format-minutes'
@@ -46,14 +46,18 @@
46
46
  </template>
47
47
 
48
48
  <template #row="{ model, on }">
49
- <v-icon
49
+ <div
50
50
  v-if="$has.icon"
51
- :color="model.getIcon().color"
52
- size="1.5rem"
53
- class="mr-2"
54
- v-on="on"
55
- v-text="model.getIcon().icon"
56
- />
51
+ class="pr-0"
52
+ >
53
+ <v-icon
54
+ :color="model.getIcon().color"
55
+ size="1.5rem"
56
+ class="mr-2"
57
+ v-on="on"
58
+ v-text="model.getIcon().icon"
59
+ />
60
+ </div>
57
61
 
58
62
  <div
59
63
  style="width:100%;"
@@ -46,14 +46,18 @@
46
46
  </template>
47
47
 
48
48
  <template #row="{ model, on }">
49
- <v-icon
49
+ <div
50
50
  v-if="$has.icon"
51
- :color="model.getIcon().color"
52
- size="1.5rem"
53
- class="mr-2"
54
- v-on="on"
55
- v-text="model.getIcon().icon"
56
- />
51
+ class="pr-0"
52
+ >
53
+ <v-icon
54
+ :color="model.getIcon().color"
55
+ size="1.5rem"
56
+ class="mr-2"
57
+ v-on="on"
58
+ v-text="model.getIcon().icon"
59
+ />
60
+ </div>
57
61
 
58
62
  <div
59
63
  style="width:100%;"
@@ -12,6 +12,7 @@ import routeConfigPlugin from './config/routing'
12
12
  import vuetify from './config/vuetify'
13
13
  import { authPlugin } from './plugins/AuthPlugin'
14
14
  import { configPlugin } from './plugins/ConfigPlugin'
15
+ import { iconsPlugin } from './plugins/IconsPlugin'
15
16
 
16
17
  Vue.config.productionTip = false
17
18
 
@@ -58,6 +59,7 @@ export class AfeefaAdmin {
58
59
  adminConfig.app = this._appConfig
59
60
 
60
61
  Vue.use(configPlugin)
62
+ Vue.use(iconsPlugin)
61
63
 
62
64
  // authenticate current user before doing any gui-voodo
63
65
  if (this._authService) {
@@ -2,11 +2,11 @@
2
2
  <div class="detailProperty">
3
3
  <div class="header">
4
4
  <v-icon
5
- v-if="_icon"
6
- :color="_icon.color"
5
+ v-if="icon"
6
+ :color="icon.color"
7
7
  size="3rem"
8
8
  >
9
- {{ _icon.icon }}
9
+ {{ icon.icon }}
10
10
  </v-icon>
11
11
 
12
12
  <div
@@ -37,19 +37,9 @@
37
37
  import { Component, Vue } from '@a-vue'
38
38
 
39
39
  @Component({
40
- props: ['icon', 'iconModelType', 'label']
40
+ props: ['icon', 'label']
41
41
  })
42
42
  export default class DetailProperty extends Vue {
43
- get _icon () {
44
- if (this.icon) {
45
- return this.icon
46
- }
47
-
48
- if (this.iconModelType) {
49
- const ModelClass = this.$apiResources.getModelClass(this.iconModelType)
50
- return ModelClass.icon
51
- }
52
- }
53
43
  }
54
44
  </script>
55
45
 
@@ -10,11 +10,11 @@
10
10
  @click="derail"
11
11
  >
12
12
  <v-icon
13
- v-if="_icon"
14
- :color="_icon.color"
13
+ v-if="icon"
14
+ :color="icon.color"
15
15
  size="2rem"
16
16
  >
17
- {{ _icon.icon }}
17
+ {{ icon.icon }}
18
18
  </v-icon>
19
19
 
20
20
  <div
@@ -62,7 +62,6 @@ import { SidebarEvent } from '@a-admin/events'
62
62
  @Component({
63
63
  props: [
64
64
  'icon',
65
- 'iconModelType',
66
65
  'label',
67
66
  {
68
67
  top: true,
@@ -97,17 +96,6 @@ export default class InformationBarItem extends Vue {
97
96
  this.$events.off(SidebarEvent.STATUS, this.railChanged)
98
97
  }
99
98
 
100
- get _icon () {
101
- if (this.icon) {
102
- return this.icon
103
- }
104
-
105
- if (this.iconModelType) {
106
- const ModelClass = this.$apiResources.getModelClass(this.iconModelType)
107
- return ModelClass.icon
108
- }
109
- }
110
-
111
99
  railChanged ({payload: {informationRailed}}) {
112
100
  if (this.rail === informationRailed) {
113
101
  return
@@ -12,7 +12,9 @@ class AdminConfig {
12
12
  components: {
13
13
  Splash: null,
14
14
  SidebarMenu: null
15
- }
15
+ },
16
+
17
+ icons: {}
16
18
  }
17
19
 
18
20
  config = {}
@@ -1,5 +1,5 @@
1
1
  import { translationService } from '@a-admin/services/TranslationService'
2
- import { Model as ApiResourcesModel, apiResources } from '@afeefa/api-resources-client'
2
+ import { Model as ApiResourcesModel } from '@afeefa/api-resources-client'
3
3
  import { mdiAlphaMCircle } from '@mdi/js'
4
4
 
5
5
  import { ModelAdminConfig } from './ModelAdminConfig'
@@ -7,7 +7,6 @@ import { ModelAdminConfig } from './ModelAdminConfig'
7
7
  export { ModelAdminConfig }
8
8
 
9
9
  export class Model extends ApiResourcesModel {
10
- static resourceType = null
11
10
  static routeName = null
12
11
  static routeIdKey = 'id'
13
12
 
@@ -17,17 +16,6 @@ export class Model extends ApiResourcesModel {
17
16
  return (new this()).getLink(action)
18
17
  }
19
18
 
20
- static getAction (actionName) {
21
- if (this.resourceType) {
22
- return apiResources.getAction({
23
- resourceType: this.resourceType,
24
- actionName
25
- })
26
- }
27
- console.warn('You can\'t get an action out of a model without resourceType:', this.type)
28
- return null
29
- }
30
-
31
19
  static get adminConfig () {
32
20
  return new ModelAdminConfig()
33
21
  .setIcon({
@@ -53,10 +41,6 @@ export class Model extends ApiResourcesModel {
53
41
  }
54
42
  }
55
43
 
56
- getAction (action) {
57
- return this.constructor.getAction(action)
58
- }
59
-
60
44
  getIcon () {
61
45
  return this.constructor.icon
62
46
  }
@@ -0,0 +1,13 @@
1
+ import { adminConfig } from '../config/AdminConfig'
2
+
3
+ class IconsPlugin {
4
+ install (Vue) {
5
+ Object.defineProperty(Vue.prototype, '$icons', {
6
+ get () {
7
+ return adminConfig.app.icons
8
+ }
9
+ })
10
+ }
11
+ }
12
+
13
+ export const iconsPlugin = new IconsPlugin()