Skip to content

Commit a598d92

Browse files
committed
fix: resolve comments
1 parent 0fe0b30 commit a598d92

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue

+12-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ export default defineComponent({
199199
options: UpdateLinkOptions['options']
200200
}) => {
201201
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+
) {
203208
Object.assign(options, {
204209
...options,
205210
expirationDateTime: DateTime.now()
@@ -208,7 +213,12 @@ export default defineComponent({
208213
.toISO()
209214
})
210215
}
211-
if (unref(resource).isFolder && linkShare.expirationDateTime) {
216+
if (
217+
unref(resource).isFolder &&
218+
linkShare.expirationDateTime &&
219+
sharingPublicExpireDateDefaultRWFolders &&
220+
sharingPublicExpireDateMaxRWFolders
221+
) {
212222
if (
213223
DateTime.fromISO(linkShare.expirationDateTime).diff(DateTime.now(), 'days').as('days') >
214224
Duration.fromObject(sharingPublicExpireDateMaxRWFolders).as('days')

packages/web-app-files/src/components/SideBar/Shares/Links/EditDropdown.vue

+11-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ export default defineComponent({
114114
currentDate: currentDate.isValid ? currentDate : null,
115115
minDate: DateTime.now(),
116116
maxDate:
117-
resource.value.isFolder && props.linkShare.type === SharingLinkType.Edit
117+
resource.value.isFolder &&
118+
props.linkShare.type === SharingLinkType.Edit &&
119+
sharingPublicExpireDateMaxRWFolders
118120
? DateTime.now().plus(sharingPublicExpireDateMaxRWFolders).endOf('day')
119121
: null
120122
}),
@@ -220,8 +222,14 @@ export default defineComponent({
220222
method: showDatePickerModal
221223
})
222224
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+
) {
225233
result.push({
226234
id: 'remove-expiration',
227235
title: $gettext('Remove expiration date'),

packages/web-pkg/src/components/CreateLinkModal.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
class="oc-mt-s"
5050
:min-date="DateTime.now()"
5151
:max-date="
52-
isFolder && selectedType === 'edit'
52+
isFolder && selectedType === 'edit' && sharingPublicExpireDateMaxRWFolders
5353
? DateTime.now().plus(sharingPublicExpireDateMaxRWFolders).endOf('day')
5454
: null
5555
"
@@ -313,6 +313,7 @@ export default defineComponent({
313313
onExpiryDateChanged({
314314
date: unref(selectedExpiry),
315315
error:
316+
sharingPublicExpireDateMaxRWFolders &&
316317
unref(selectedExpiry)?.toISO() >
317318
DateTime.now().plus(sharingPublicExpireDateMaxRWFolders).endOf('day').toISO() &&
318319
isFolder &&

packages/web-pkg/src/composables/piniaStores/config/config.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ const defaultOptions = {
3838
tokenStorageLocal: true,
3939
userListRequiresFilter: false,
4040
hideLogo: false,
41-
alertRwFolders: {
42-
en: '',
43-
fr: ''
44-
}
41+
alertRwFolders: {}
4542
} satisfies Partial<OptionsConfig>
4643

4744
export const useConfigStore = defineStore('config', () => {

packages/web-pkg/src/composables/piniaStores/config/types.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ const OptionsConfigSchema = z.object({
127127
hideAccountMenu: z.boolean().optional(),
128128
hideNavigation: z.boolean().optional(),
129129
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()
136131
})
137132

138133
export type OptionsConfig = z.infer<typeof OptionsConfigSchema>

0 commit comments

Comments
 (0)