11<template >
2- <div class =" m-3 card-request" >
3- <div v-for =" event in emptyStartEvents" :key =" event.id" class =" card" >
4- <div class =" card-body" >
5- <div class =" d-flex justify-content-between" >
6- <div style =" width : 80% " >
7- <span v-uni-id =" event.id.toString()" >{{ transformedName }}</span >
8- <span v-if =" process.startEvents.length > 1" >
9- : {{ event.name }}
10- </span >
11- <a
12- href =" #"
13- :aria-expanded =" ariaExpanded"
14- :aria-controls =" getComputedId(process)"
15- @click =" showRequestDetails"
16- >
17- ...
18- </a >
2+ <div >
3+ <template v-for =" event in emptyStartEvents " >
4+ <div :key =" event.id" class =" mb-3 card-request" >
5+ <div class =" card-body" >
6+ <div class =" d-flex justify-content-between" >
7+ <div >
8+ <span v-uni-id =" event.id.toString()" class =" card-info card-title" >
9+ {{ transformedName }}
10+ </span >
11+ <span class =" card-info" >
12+ {{ event.name }}
13+ </span >
14+ </div >
15+ <div class =" d-flex align-items-center" >
16+ <button
17+ :aria-expanded =" ariaExpanded"
18+ :aria-controls =" getComputedId(process, event)"
19+ class =" btn btn-ellipsis btn-sm mr-1"
20+ @click =" showRequestDetails(process, event)"
21+ >
22+ <i class =" fas fa-ellipsis-v" ></i >
23+ </button >
24+ <button
25+ v-uni-aria-describedby =" event.id.toString()"
26+ :href =" getNewRequestLinkHref(process, event)"
27+ class =" btn btn-custom btn-sm"
28+ @click.prevent =" newRequestLink(process, event)"
29+ >
30+ {{ $t("Start") }}
31+ <i class =" fas fa-play mr-1 card-icon" ></i >
32+ </button >
33+ </div >
1934 </div >
20- <div class =" text-right" >
21- <button
22- v-uni-aria-describedby =" event.id.toString()"
23- :href =" getNewRequestLinkHref(process, event)"
24- class =" btn btn-primary btn-sm"
25- @click.prevent =" newRequestLink(process, event)"
26- >
27- <i class =" fas fa-caret-square-right mr-1" ></i > {{ $t("Start") }}
28- </button >
29- </div >
30- </div >
31- <div
32- v-if =" showdetail"
33- :id =" getComputedId(process)"
34- :aria-hidden =" ariaHidden"
35- >
36- <hr />
37- <p class =" card-text text-muted" >{{ process.description }}</p >
35+ <b-collapse
36+ :id =" getComputedId(process, event)"
37+ :aria-hidden =" ariaHidden"
38+ >
39+ <hr />
40+ <p class =" card-text text-muted card-description" >
41+ {{ process.description }}
42+ </p >
43+ </b-collapse >
3844 </div >
3945 </div >
40- </div >
46+ </template >
4147 </div >
4248</template >
4349
@@ -116,7 +122,7 @@ export default {
116122 this .spin = 0 ;
117123 const instance = response .data ;
118124 this .$cookies .set (" fromTriggerStartEvent" , true , " 1min" );
119- window .location = ` /requests/${ instance .id } ?fromRedirect=true ` ;
125+ window .location = ` /requests/${ instance .id } ?fromTriggerStartEvent= ` ;
120126 })
121127 .catch ((err ) => {
122128 this .disabled = false ;
@@ -126,29 +132,85 @@ export default {
126132 }
127133 });
128134 },
129- showRequestDetails (id ) {
135+ showRequestDetails (process , event ) {
130136 if (this .showdetail === false ) {
131137 this .showdetail = true ;
132138 } else {
133139 this .showdetail = false ;
134140 }
141+ this .$root .$emit (
142+ " bv::toggle::collapse" ,
143+ this .getComputedId (process , event )
144+ );
135145 },
136146 getNewRequestLinkHref (process , event ) {
137147 const { id } = process ;
138148 const startEventId = event .id ;
139149 return ` /process_events/${ id} ?event=${ startEventId} ` ;
140150 },
141- getComputedId (process ) {
142- return ` process-${ process .id } ` ;
151+ getComputedId (process , event ) {
152+ return ` process-${ process .id } - ${ event . id } ` ;
143153 }
144154 }
145155};
146156 </script >
147157
148158<style scoped>
159+ .btn-custom {
160+ border-radius : 4px ;
161+ border : 1px solid #eceff3 ;
162+ background : #e8f0f9 ;
163+ display : flex ;
164+ height : 28px ;
165+ padding : 4px 9px ;
166+ justify-content : center ;
167+ align-items : inherit ;
168+ gap : 6px ;
169+ color : #1572c2 ;
170+ font-size : 14px ;
171+ font-weight : 600 ;
172+ }
173+ .btn-ellipsis {
174+ background : #fff ;
175+ height : 28px ;
176+ justify-content : center ;
177+ align-items : center ;
178+ color : #1572c2 ;
179+ font-size : 14px ;
180+ }
181+ .btn-ellipsis :hover {
182+ border-radius : 4px ;
183+ background : #e8f0f9 ;
184+ }
149185.card-request {
150- width : 45% ;
151- min-width : 40% ;
152- max-width : 50% ;
186+ display : flex ;
187+ justify-content : space-between ;
188+ align-items : center ;
189+ border-radius : 8px ;
190+ border : 1px solid #cdddee ;
191+ background : #fff ;
192+ }
193+ .card-info {
194+ -webkit-line-clamp : 1 ;
195+ display : -webkit-box ;
196+ -webkit-box-orient : vertical ;
197+ overflow : hidden ;
198+ }
199+ .card-description {
200+ -webkit-line-clamp : 2 ;
201+ display : -webkit-box ;
202+ -webkit-box-orient : vertical ;
203+ overflow : hidden ;
204+ }
205+ .card-title {
206+ font-weight : 700 ;
207+ }
208+ .card-icon {
209+ display : flex ;
210+ padding : 2px 1px 0px 0px ;
211+ justify-content : center ;
212+ align-items : center ;
213+ gap : 10px ;
214+ font-size : 7px ;
153215}
154216 </style >
0 commit comments