27
27
/>
28
28
29
29
<template slot-scope="{ result: { data } }" v-if =" data " >
30
- <VueButton
30
+ <VueDropdown
31
31
v-for =" suggestion of data.suggestions"
32
32
:key =" suggestion.id"
33
- :label =" $t(suggestion.label)"
34
- :loading =" suggestion.busy"
35
- class =" suggestion round"
36
- v-tooltip =" $t('components.suggestion-bar.suggestion')"
37
- @click =" select(suggestion)"
38
- />
39
- </template >
40
-
41
- <VueModal
42
- v-if =" showDetails"
43
- :title =" $t(currentSuggestion.label)"
44
- class =" medium"
45
- @close =" showDetails = false"
46
- >
47
- <div class =" default-body" >
48
- <div
49
- v-if =" currentSuggestion.message"
50
- class =" info message"
51
- v-html =" $t(currentSuggestion.message)"
52
- />
53
- <div
54
- v-if =" currentSuggestion.link"
55
- class =" info links"
56
- >
57
- <a :href =" currentSuggestion.link" target =" _blank" >
58
- {{ $t('components.list-item-info.more-info') }}
59
- </a >
60
- </div >
61
- </div >
62
-
63
- <div slot =" footer" class =" actions" >
33
+ :disabled =" !suggestion.message && !suggestion.link"
34
+ class =" suggestion"
35
+ placement =" bottom-end"
36
+ >
64
37
<VueButton
65
- class =" big"
66
- :label =" $t('components.suggestion-bar.modal.cancel')"
67
- icon =" close"
68
- @click =" showDetails = false"
38
+ slot =" trigger"
39
+ :label =" $t(suggestion.label)"
40
+ :loading =" suggestion.busy"
41
+ class =" round"
42
+ v-tooltip =" $t('components.suggestion-bar.suggestion')"
43
+ @click =" if (!suggestion.message && !suggestion.link) activate(suggestion)"
69
44
/>
70
- <VueButton
71
- class =" primary big"
72
- :label =" $t('components.suggestion-bar.modal.continue')"
73
- icon =" done"
74
- @click =" activate(currentSuggestion)"
75
- />
76
- </div >
77
- </VueModal >
45
+
46
+ <div class =" suggestion-details" >
47
+ <div class =" info label" >
48
+ {{ $t(suggestion.label) }}
49
+ </div >
50
+
51
+ <div
52
+ v-if =" suggestion.message"
53
+ class =" info message"
54
+ v-html =" $t(suggestion.message)"
55
+ />
56
+
57
+ <div class =" actions-bar" >
58
+ <VueButton
59
+ :href =" suggestion.link"
60
+ :label =" $t('components.list-item-info.more-info')"
61
+ target =" _blank"
62
+ class =" flat"
63
+ icon-right =" open_in_new"
64
+ />
65
+ <div class =" vue-ui-spacer" />
66
+ <VueButton
67
+ :label =" $t('components.suggestion-bar.modal.cancel')"
68
+ icon-left =" close"
69
+ v-close-popover
70
+ />
71
+ <VueButton
72
+ class =" primary"
73
+ :label =" $t('components.suggestion-bar.modal.continue')"
74
+ icon-left =" done"
75
+ v-close-popover
76
+ @click =" activate(suggestion)"
77
+ />
78
+ </div >
79
+ </div >
80
+ </VueDropdown >
81
+ </template >
78
82
</ApolloQuery >
79
83
</template >
80
84
81
85
<script >
82
86
import SUGGESTION_ACTIVATE from ' ../graphql/suggestionActivate.gql'
83
87
84
88
export default {
85
- data () {
86
- return {
87
- currentSuggestion: null ,
88
- showDetails: false
89
- }
90
- },
91
-
92
89
methods: {
93
- select (suggestion ) {
94
- if (suggestion .message || suggestion .link ) {
95
- this .currentSuggestion = suggestion
96
- this .showDetails = true
97
- } else {
98
- this .activate (suggestion)
99
- }
100
- },
101
-
102
90
async activate (suggestion ) {
103
91
this .showDetails = false
104
92
await this .$apollo .mutate ({
@@ -121,7 +109,19 @@ export default {
121
109
& :not (:first-child )
122
110
margin-left $padding-item
123
111
124
- .info
125
- & :not (:last-child )
126
- margin-bottom $padding-item
112
+ .suggestion-details
113
+ padding ($padding-item * 2 - 8px ) ($padding-item * 2 )
114
+ box-sizing border-box
115
+ width 440px
116
+
117
+ .label
118
+ font-size 20px
119
+
120
+ .actions-bar
121
+ padding 0
122
+ margin-top ($padding-item * 3 )
123
+
124
+ .info
125
+ & :not (:last-child )
126
+ margin-bottom $padding-item
127
127
</style >
0 commit comments