File tree 3 files changed +22
-8
lines changed
3 files changed +22
-8
lines changed Original file line number Diff line number Diff line change 200
200
{/if }
201
201
</div >
202
202
{/if }
203
+ {#if primaryAttribute ?.key }
204
+ <EventDetailsRow {...primaryAttribute } {attributes } />
205
+ {/if }
203
206
{#if currentEvent ?.userMetadata ?.summary }
204
207
<MetadataDecoder
205
208
value ={currentEvent .userMetadata .summary }
214
217
{decodedValue }
215
218
</Badge >
216
219
</div >
217
- {:else }
218
- <EventDetailsRow {...primaryAttribute } {attributes } />
219
220
{/if }
220
221
</MetadataDecoder >
221
- {:else if primaryAttribute ?.key }
222
- <EventDetailsRow {...primaryAttribute } {attributes } />
223
222
{/if }
224
223
{#if currentEvent ?.links ?.length }
225
224
<EventLink
235
234
{attributes }
236
235
/>
237
236
{/if }
238
- {#if compact && secondaryAttribute ?.key }
237
+ {#if compact && secondaryAttribute ?.key && ! currentEvent ?. userMetadata ?. summary }
239
238
<EventDetailsRow {...secondaryAttribute } {attributes } />
240
239
{/if }
241
240
</td >
Original file line number Diff line number Diff line change 11
11
12
12
export let value: Payload | undefined = undefined ;
13
13
export let fallback: string = ' ' ;
14
+ export let prefix: string = ' ' ;
14
15
export let onDecode: (decodedValue : string ) => void | undefined = undefined ;
15
16
17
+ const maxLength = 100 ;
18
+
16
19
let decodedValue = ' ' ;
17
20
18
21
$ : endpoint = getCodecEndpoint ($page .data .settings );
28
31
},
29
32
};
30
33
34
+ const setPrefix = (metadata : string ) => {
35
+ if (prefix ) {
36
+ metadata = ` ${prefix } • ${metadata } ` ;
37
+ }
38
+ if (metadata .length < maxLength ) return metadata ;
39
+ return metadata .slice (0 , maxLength ) + ' ...' ;
40
+ };
41
+
31
42
$ : decodePayload = async (_value : Payload | undefined ) => {
32
43
if (! _value ) return fallback ;
33
44
if (decodedValue ) return decodedValue ;
38
49
);
39
50
40
51
if (typeof metadata === ' string' ) {
52
+ decodedValue = setPrefix (metadata );
41
53
if (onDecode ) {
42
- onDecode (metadata );
54
+ onDecode (decodedValue );
43
55
}
44
- decodedValue = metadata ;
45
- return metadata ;
56
+ return decodedValue ;
46
57
}
47
58
48
59
decodedValue = fallback ;
Original file line number Diff line number Diff line change 6
6
import type { EventGroup } from ' $lib/models/event-groups/event-groups' ;
7
7
import { setActiveGroup } from ' $lib/stores/active-events' ;
8
8
import { getMillisecondDuration } from ' $lib/utilities/format-time' ;
9
+ import { isActivityTaskScheduledEvent } from ' $lib/utilities/is-event-type' ;
9
10
10
11
import {
11
12
CategoryIcon ,
129
130
{:else }
130
131
<MetadataDecoder
131
132
value ={group ?.userMetadata ?.summary }
133
+ prefix ={isActivityTaskScheduledEvent (group .initialEvent )
134
+ ? group ?.displayName
135
+ : ' ' }
132
136
fallback ={group ?.displayName }
133
137
let:decodedValue
134
138
>
You can’t perform that action at this time.
0 commit comments