File tree 5 files changed +27
-16
lines changed
composables/piniaStores/config
5 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,12 @@ export default defineComponent({
199
199
options: UpdateLinkOptions [' options' ]
200
200
}) => {
201
201
try {
202
- if (unref (resource ).isFolder && options .type === ' edit' && ! linkShare .expirationDateTime ) {
202
+ if (
203
+ options .type === ' edit' &&
204
+ unref (resource ).isFolder &&
205
+ ! linkShare .expirationDateTime &&
206
+ sharingPublicExpireDateDefaultRWFolders
207
+ ) {
203
208
Object .assign (options , {
204
209
... options ,
205
210
expirationDateTime: DateTime .now ()
@@ -208,7 +213,12 @@ export default defineComponent({
208
213
.toISO ()
209
214
})
210
215
}
211
- if (unref (resource ).isFolder && linkShare .expirationDateTime ) {
216
+ if (
217
+ unref (resource ).isFolder &&
218
+ linkShare .expirationDateTime &&
219
+ sharingPublicExpireDateDefaultRWFolders &&
220
+ sharingPublicExpireDateMaxRWFolders
221
+ ) {
212
222
if (
213
223
DateTime .fromISO (linkShare .expirationDateTime ).diff (DateTime .now (), ' days' ).as (' days' ) >
214
224
Duration .fromObject (sharingPublicExpireDateMaxRWFolders ).as (' days' )
Original file line number Diff line number Diff line change @@ -114,7 +114,9 @@ export default defineComponent({
114
114
currentDate: currentDate .isValid ? currentDate : null ,
115
115
minDate: DateTime .now (),
116
116
maxDate:
117
- resource .value .isFolder && props .linkShare .type === SharingLinkType .Edit
117
+ resource .value .isFolder &&
118
+ props .linkShare .type === SharingLinkType .Edit &&
119
+ sharingPublicExpireDateMaxRWFolders
118
120
? DateTime .now ().plus (sharingPublicExpireDateMaxRWFolders ).endOf (' day' )
119
121
: null
120
122
}),
@@ -220,8 +222,14 @@ export default defineComponent({
220
222
method: showDatePickerModal
221
223
})
222
224
223
- // only if is not a edit folder link
224
- if (! (props .linkShare .type === SharingLinkType .Edit && resource .value .isFolder )) {
225
+ // only if it isn't a edit folder link
226
+ if (
227
+ ! (
228
+ props .linkShare .type === SharingLinkType .Edit &&
229
+ resource .value .isFolder &&
230
+ sharingPublicExpireDateMaxRWFolders
231
+ )
232
+ ) {
225
233
result .push ({
226
234
id: ' remove-expiration' ,
227
235
title: $gettext (' Remove expiration date' ),
Original file line number Diff line number Diff line change 49
49
class =" oc-mt-s"
50
50
:min-date =" DateTime.now()"
51
51
:max-date ="
52
- isFolder && selectedType === 'edit'
52
+ isFolder && selectedType === 'edit' && sharingPublicExpireDateMaxRWFolders
53
53
? DateTime.now().plus(sharingPublicExpireDateMaxRWFolders).endOf('day')
54
54
: null
55
55
"
@@ -313,6 +313,7 @@ export default defineComponent({
313
313
onExpiryDateChanged ({
314
314
date: unref (selectedExpiry ),
315
315
error:
316
+ sharingPublicExpireDateMaxRWFolders &&
316
317
unref (selectedExpiry )?.toISO () >
317
318
DateTime .now ().plus (sharingPublicExpireDateMaxRWFolders ).endOf (' day' ).toISO () &&
318
319
isFolder &&
Original file line number Diff line number Diff line change @@ -38,10 +38,7 @@ const defaultOptions = {
38
38
tokenStorageLocal : true ,
39
39
userListRequiresFilter : false ,
40
40
hideLogo : false ,
41
- alertRwFolders : {
42
- en : '' ,
43
- fr : ''
44
- }
41
+ alertRwFolders : { }
45
42
} satisfies Partial < OptionsConfig >
46
43
47
44
export const useConfigStore = defineStore ( 'config' , ( ) => {
Original file line number Diff line number Diff line change @@ -127,12 +127,7 @@ const OptionsConfigSchema = z.object({
127
127
hideAccountMenu : z . boolean ( ) . optional ( ) ,
128
128
hideNavigation : z . boolean ( ) . optional ( ) ,
129
129
defaultLanguage : z . string ( ) . optional ( ) ,
130
- alertRwFolders : z
131
- . object ( {
132
- en : z . string ( ) . optional ( ) ,
133
- fr : z . string ( ) . optional ( )
134
- } )
135
- . optional ( )
130
+ alertRwFolders : z . object ( { } ) . optional ( )
136
131
} )
137
132
138
133
export type OptionsConfig = z . infer < typeof OptionsConfigSchema >
You can’t perform that action at this time.
0 commit comments