diff options
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/l10n/es.js | 15 | ||||
-rw-r--r-- | apps/files_sharing/l10n/es.json | 15 | ||||
-rw-r--r-- | apps/files_sharing/lib/Listener/LoadSidebarListener.php | 12 | ||||
-rw-r--r-- | apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue | 30 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 15 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingInput.vue | 44 | ||||
-rw-r--r-- | apps/files_sharing/src/views/SharingDetailsTab.vue | 5 | ||||
-rw-r--r-- | apps/files_sharing/src/views/SharingTab.vue | 3 |
8 files changed, 97 insertions, 42 deletions
diff --git a/apps/files_sharing/l10n/es.js b/apps/files_sharing/l10n/es.js index fba03819b5b..6db11d86aa0 100644 --- a/apps/files_sharing/l10n/es.js +++ b/apps/files_sharing/l10n/es.js @@ -185,6 +185,7 @@ OC.L10N.register( "Set default folder for accepted shares" : "Establecer la carpeta por defecto para los recursos compartidos aceptados", "Reset" : "Restaurar", "Reset folder to system default" : "Restaurar la carpeta por defecto del sistema", + "Share expiration: {date}" : "El recurso compartido caduca el: {date}", "Share Expiration" : "Caducidad del recurso compartido", "group" : "grupo", "conversation" : "conversación", @@ -256,6 +257,7 @@ OC.L10N.register( "File drop" : "Entrega de archivos", "Upload files to {foldername}." : "Cargar archivos a {foldername}.", "By uploading files, you agree to the terms of service." : "Al subir archivos, aceptas los términos del servicio", + "Successfully uploaded files" : "Se cargaron los archivos de manera exitosa", "View terms of service" : "Ver los términos del servicio", "Terms of service" : "Términos del servicio", "Share with {userName}" : "Compartir con {userName}", @@ -306,7 +308,10 @@ OC.L10N.register( "Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "Utiliza este método para compartir archivos con individuos o equipos dentro de tu organización. Si el destinatario ya tiene acceso pero no puede encontrarlos, puedes enviarle este enlace interno para facilitarle el acceso.", "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "Usa este método para compartir archivos con individuos u organizaciones externas a tu organización. Los archivos y carpetas pueden ser compartidos mediante enlaces públicos y por correo. También puedes compartir con otras cuentas de Nextcloud alojadas en otras instancias utilizando su ID de nube federada.", "Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Recursos compartidos que no son internos o externos. Pueden estar compartidos desde aplicaciones u otras fuentes.", + "Share with accounts, teams, federated cloud IDs" : "Comparta con cuentas, equipos, IDs de nubes federadas", "Share with accounts and teams" : "Compartir con cuentas y equipos", + "Federated cloud ID" : "ID de nube federada", + "Email, federated cloud ID" : "Correo, ID de nube federada", "Unable to load the shares list" : "No se pudo cargar la lista de recursos compartidos", "Expires {relativetime}" : "Caduca en {relativetime}", "this share just expired." : "este recurso compartido acaba de caducar.", @@ -363,6 +368,7 @@ OC.L10N.register( "List of unapproved shares." : "Lista de recursos compartidos no aprobados", "No pending shares" : "No hay recursos compartidos pendientes", "Shares you have received but not approved will show up here" : "Aquí aparecerán los compartidos que ha recibido pero que no ha aprobado", + "Error deleting the share: {errorMessage}" : "Error al eliminar el recurso compartido: {errorMessage}", "Error deleting the share" : "Error borrando el recurso compartido", "Error updating the share: {errorMessage}" : "Error al actualizar el recurso compartido: {errorMessage}", "Error updating the share" : "Error actualizando el recurso compartido", @@ -376,8 +382,17 @@ OC.L10N.register( "Share note for recipient saved" : "Nota para el destinatario del recurso compartido guardada", "Share password saved" : "Se ha guardado la contraseña del recurso compartido", "Share permissions saved" : "Permisos del recurso compartido guardados", + "To upload files to {folder}, you need to provide your name first." : "Para cargar archivos a {folder}, necesita proporcionar primero su nombre.", "Upload files to {folder}" : "Cargar archivos a {folder}", + "Please confirm your name to upload files to {folder}" : "Por favor, confirme su nombre para cargar archivos a {folder}", "{ownerDisplayName} shared a folder with you." : "{ownerDisplayName} ha compartido una carpeta contigo.", + "Names must not be empty." : "Los nombres no deben estar vacíos.", + "Names must not start with a dot." : "Los nombres no deben comenzar con un punto.", + "\"{char}\" is not allowed inside a name." : "\"{char}\" no está permitido dentro de un nombre.", + "\"{segment}\" is a reserved name and not allowed." : "\"{segment}\" es un nombre reservado y no está permitido.", + "\"{extension}\" is not an allowed name." : "\"{extension}\" no es un nombre permitido.", + "Names must not end with \"{extension}\"." : "Los nombres no deben terminar con \"{extension}\".", + "Invalid name." : "Nombre inválido.", "Shared by" : "Compartido por", "Shared with" : "Compartido con", "Password created successfully" : "Contraseña creada exitosamente", diff --git a/apps/files_sharing/l10n/es.json b/apps/files_sharing/l10n/es.json index b3fde704542..9d3aef5d575 100644 --- a/apps/files_sharing/l10n/es.json +++ b/apps/files_sharing/l10n/es.json @@ -183,6 +183,7 @@ "Set default folder for accepted shares" : "Establecer la carpeta por defecto para los recursos compartidos aceptados", "Reset" : "Restaurar", "Reset folder to system default" : "Restaurar la carpeta por defecto del sistema", + "Share expiration: {date}" : "El recurso compartido caduca el: {date}", "Share Expiration" : "Caducidad del recurso compartido", "group" : "grupo", "conversation" : "conversación", @@ -254,6 +255,7 @@ "File drop" : "Entrega de archivos", "Upload files to {foldername}." : "Cargar archivos a {foldername}.", "By uploading files, you agree to the terms of service." : "Al subir archivos, aceptas los términos del servicio", + "Successfully uploaded files" : "Se cargaron los archivos de manera exitosa", "View terms of service" : "Ver los términos del servicio", "Terms of service" : "Términos del servicio", "Share with {userName}" : "Compartir con {userName}", @@ -304,7 +306,10 @@ "Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "Utiliza este método para compartir archivos con individuos o equipos dentro de tu organización. Si el destinatario ya tiene acceso pero no puede encontrarlos, puedes enviarle este enlace interno para facilitarle el acceso.", "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "Usa este método para compartir archivos con individuos u organizaciones externas a tu organización. Los archivos y carpetas pueden ser compartidos mediante enlaces públicos y por correo. También puedes compartir con otras cuentas de Nextcloud alojadas en otras instancias utilizando su ID de nube federada.", "Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "Recursos compartidos que no son internos o externos. Pueden estar compartidos desde aplicaciones u otras fuentes.", + "Share with accounts, teams, federated cloud IDs" : "Comparta con cuentas, equipos, IDs de nubes federadas", "Share with accounts and teams" : "Compartir con cuentas y equipos", + "Federated cloud ID" : "ID de nube federada", + "Email, federated cloud ID" : "Correo, ID de nube federada", "Unable to load the shares list" : "No se pudo cargar la lista de recursos compartidos", "Expires {relativetime}" : "Caduca en {relativetime}", "this share just expired." : "este recurso compartido acaba de caducar.", @@ -361,6 +366,7 @@ "List of unapproved shares." : "Lista de recursos compartidos no aprobados", "No pending shares" : "No hay recursos compartidos pendientes", "Shares you have received but not approved will show up here" : "Aquí aparecerán los compartidos que ha recibido pero que no ha aprobado", + "Error deleting the share: {errorMessage}" : "Error al eliminar el recurso compartido: {errorMessage}", "Error deleting the share" : "Error borrando el recurso compartido", "Error updating the share: {errorMessage}" : "Error al actualizar el recurso compartido: {errorMessage}", "Error updating the share" : "Error actualizando el recurso compartido", @@ -374,8 +380,17 @@ "Share note for recipient saved" : "Nota para el destinatario del recurso compartido guardada", "Share password saved" : "Se ha guardado la contraseña del recurso compartido", "Share permissions saved" : "Permisos del recurso compartido guardados", + "To upload files to {folder}, you need to provide your name first." : "Para cargar archivos a {folder}, necesita proporcionar primero su nombre.", "Upload files to {folder}" : "Cargar archivos a {folder}", + "Please confirm your name to upload files to {folder}" : "Por favor, confirme su nombre para cargar archivos a {folder}", "{ownerDisplayName} shared a folder with you." : "{ownerDisplayName} ha compartido una carpeta contigo.", + "Names must not be empty." : "Los nombres no deben estar vacíos.", + "Names must not start with a dot." : "Los nombres no deben comenzar con un punto.", + "\"{char}\" is not allowed inside a name." : "\"{char}\" no está permitido dentro de un nombre.", + "\"{segment}\" is a reserved name and not allowed." : "\"{segment}\" es un nombre reservado y no está permitido.", + "\"{extension}\" is not an allowed name." : "\"{extension}\" no es un nombre permitido.", + "Names must not end with \"{extension}\"." : "Los nombres no deben terminar con \"{extension}\".", + "Invalid name." : "Nombre inválido.", "Shared by" : "Compartido por", "Shared with" : "Compartido con", "Password created successfully" : "Contraseña creada exitosamente", diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index 88c39f38545..17fee71978f 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -15,6 +15,7 @@ use OCA\Files_Sharing\Config\ConfigLexicon; use OCP\AppFramework\Services\IInitialState; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; +use OCP\GlobalScale\IConfig; use OCP\IAppConfig; use OCP\Server; use OCP\Share\IManager; @@ -35,10 +36,15 @@ class LoadSidebarListener implements IEventListener { if (!($event instanceof LoadSidebar)) { return; } + Util::addScript(Application::APP_ID, 'files_sharing_tab', 'files'); $appConfig = Server::get(IAppConfig::class); - $this->initialState->provideInitialState('showFederatedSharesAsInternal', $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL)); - $this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_TO_TRUSTED_AS_INTERNAL)); - Util::addScript(Application::APP_ID, 'files_sharing_tab', 'files'); + $gsConfig = Server::get(IConfig::class); + $showFederatedToTrustedAsInternal = $gsConfig->isGlobalScaleEnabled() || $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_TO_TRUSTED_AS_INTERNAL); + $showFederatedAsInternal = ($gsConfig->isGlobalScaleEnabled() && $gsConfig->onlyInternalFederation()) + || $appConfig->getValueBool('files_sharing', ConfigLexicon::SHOW_FEDERATED_AS_INTERNAL); + + $this->initialState->provideInitialState('showFederatedSharesAsInternal', $showFederatedAsInternal); + $this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $showFederatedToTrustedAsInternal); } } diff --git a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue index 4c14b21e1d5..7e6d56e8794 100644 --- a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue +++ b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue @@ -14,9 +14,9 @@ <fieldset class="file-request-dialog__expiration" data-cy-file-request-dialog-fieldset="expiration"> <!-- Enable expiration --> <legend>{{ t('files_sharing', 'When should the request expire?') }}</legend> - <NcCheckboxRadioSwitch v-show="!defaultExpireDateEnforced" - :checked="defaultExpireDateEnforced || expirationDate !== null" - :disabled="disabled || defaultExpireDateEnforced" + <NcCheckboxRadioSwitch v-show="!isExpirationDateEnforced" + :checked="isExpirationDateEnforced || expirationDate !== null" + :disabled="disabled || isExpirationDateEnforced" @update:checked="onToggleDeadline"> {{ t('files_sharing', 'Set a submission expiration date') }} </NcCheckboxRadioSwitch> @@ -46,9 +46,9 @@ <fieldset class="file-request-dialog__password" data-cy-file-request-dialog-fieldset="password"> <!-- Enable password --> <legend>{{ t('files_sharing', 'What password should be used for the request?') }}</legend> - <NcCheckboxRadioSwitch v-show="!enforcePasswordForPublicLink" - :checked="enforcePasswordForPublicLink || password !== null" - :disabled="disabled || enforcePasswordForPublicLink" + <NcCheckboxRadioSwitch v-show="!isPasswordEnforced" + :checked="isPasswordEnforced || password !== null" + :disabled="disabled || isPasswordEnforced" @update:checked="onTogglePassword"> {{ t('files_sharing', 'Set a password') }} </NcCheckboxRadioSwitch> @@ -59,7 +59,7 @@ :disabled="disabled" :label="t('files_sharing', 'Password')" :placeholder="t('files_sharing', 'Enter a valid password')" - :required="false" + :required="enforcePasswordForPublicLink" :value="password" name="password" @update:value="$emit('update:password', $event)" /> @@ -180,6 +180,18 @@ export default defineComponent({ return '' }, + + isExpirationDateEnforced(): boolean { + // Both fields needs to be enabled in the settings + return this.defaultExpireDateEnabled + && this.defaultExpireDateEnforced + }, + + isPasswordEnforced(): boolean { + // Both fields needs to be enabled in the settings + return this.enableLinkPasswordByDefault + && this.enforcePasswordForPublicLink + }, }, mounted() { @@ -189,12 +201,12 @@ export default defineComponent({ } // If enforced, we cannot set a date before the default expiration days (see admin settings) - if (this.defaultExpireDateEnforced) { + if (this.isExpirationDateEnforced) { this.maxDate = sharingConfig.defaultExpirationDate } // If enabled by default, we generate a valid password - if (this.enableLinkPasswordByDefault) { + if (this.isPasswordEnforced) { this.generatePassword() } }, diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 1fbe740cb11..342b40ce384 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -19,8 +19,9 @@ :href="share.shareWithLink" class="sharing-entry__summary__desc"> <span>{{ title }} - <span v-if="!isUnique" class="sharing-entry__summary__desc-unique"> ({{ - share.shareWithDisplayNameUnique }})</span> + <span v-if="!isUnique" class="sharing-entry__summary__desc-unique"> + ({{ share.shareWithDisplayNameUnique }}) + </span> <small v-if="hasStatus && share.status.message">({{ share.status.message }})</small> </span> </component> @@ -73,13 +74,17 @@ export default { computed: { title() { let title = this.share.shareWithDisplayName - if (this.share.type === ShareType.Group) { + + const showAsInternal = this.config.showFederatedSharesAsInternal + || (this.share.isTrustedServer && this.config.showFederatedSharesToTrustedServersAsInternal) + + if (this.share.type === ShareType.Group || (this.share.type === ShareType.RemoteGroup && showAsInternal)) { title += ` (${t('files_sharing', 'group')})` } else if (this.share.type === ShareType.Room) { title += ` (${t('files_sharing', 'conversation')})` - } else if (this.share.type === ShareType.Remote && !this.share.isTrustedServer) { + } else if (this.share.type === ShareType.Remote && !showAsInternal) { title += ` (${t('files_sharing', 'remote')})` - } else if (this.share.type === ShareType.RemoteGroup && !this.share.isTrustedServer) { + } else if (this.share.type === ShareType.RemoteGroup) { title += ` (${t('files_sharing', 'remote group')})` } else if (this.share.type === ShareType.Guest) { title += ` (${t('files_sharing', 'guest')})` diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index f50dc96fc08..46bacef0c6c 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -195,17 +195,15 @@ export default { const remoteTypes = [ShareType.Remote, ShareType.RemoteGroup] const shareType = [] - const showFederatedAsInternal - = this.config.showFederatedSharesAsInternal - || this.config.showFederatedSharesToTrustedServersAsInternal - - const shouldAddRemoteTypes - // For internal users, add remote types if config says to show them as internal - = (!this.isExternal && showFederatedAsInternal) - // For external users, add them if config *doesn't* say to show them as internal - || (this.isExternal && !showFederatedAsInternal) - // Edge case: federated-to-trusted is a separate "add" trigger for external users - || (this.isExternal && this.config.showFederatedSharesToTrustedServersAsInternal) + const showFederatedAsInternal = this.config.showFederatedSharesAsInternal + || this.config.showFederatedSharesToTrustedServersAsInternal + + // For internal users, add remote types if config says to show them as internal + const shouldAddRemoteTypes = (!this.isExternal && showFederatedAsInternal) + // For external users, add them if config *doesn't* say to show them as internal + || (this.isExternal && !showFederatedAsInternal) + // Edge case: federated-to-trusted is a separate "add" trigger for external users + || (this.isExternal && this.config.showFederatedSharesToTrustedServersAsInternal) if (this.isExternal) { if (getCapabilities().files_sharing.public.enabled === true) { @@ -244,13 +242,10 @@ export default { return } - const data = request.data.ocs.data - const exact = request.data.ocs.data.exact - data.exact = [] // removing exact from general results - + const { exact, ...data } = request.data.ocs.data // flatten array of arrays - const rawExactSuggestions = Object.values(exact).reduce((arr, elem) => arr.concat(elem), []) - const rawSuggestions = Object.values(data).reduce((arr, elem) => arr.concat(elem), []) + const rawExactSuggestions = Object.values(exact).flat() + const rawSuggestions = Object.values(data).flat() // remove invalid data and format to user-select layout const exactSuggestions = this.filterOutExistingShares(rawExactSuggestions) @@ -470,14 +465,19 @@ export default { */ formatForMultiselect(result) { let subname + let displayName = result.name || result.label + if (result.value.shareType === ShareType.User && this.config.shouldAlwaysShowUnique) { subname = result.shareWithDisplayNameUnique ?? '' - } else if ((result.value.shareType === ShareType.Remote - || result.value.shareType === ShareType.RemoteGroup - ) && result.value.server) { - subname = t('files_sharing', 'on {server}', { server: result.value.server }) } else if (result.value.shareType === ShareType.Email) { subname = result.value.shareWith + } else if (result.value.shareType === ShareType.Remote || result.value.shareType === ShareType.RemoteGroup) { + if (this.config.showFederatedSharesAsInternal) { + subname = result.extra?.email?.value ?? '' + displayName = result.extra?.name?.value ?? displayName + } else if (result.value.server) { + subname = t('files_sharing', 'on {server}', { server: result.value.server }) + } } else { subname = result.shareWithDescription ?? '' } @@ -487,7 +487,7 @@ export default { shareType: result.value.shareType, user: result.uuid || result.value.shareWith, isNoUser: result.value.shareType !== ShareType.User, - displayName: result.name || result.label, + displayName, subname, shareWithDisplayNameUnique: result.shareWithDisplayNameUnique || '', ...this.shareTypeToIcon(result.value.shareType), diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue index ee902a24c8a..b3a3b95d92e 100644 --- a/apps/files_sharing/src/views/SharingDetailsTab.vue +++ b/apps/files_sharing/src/views/SharingDetailsTab.vue @@ -373,7 +373,7 @@ export default { title() { switch (this.share.type) { case ShareType.User: - return t('files_sharing', 'Share with {userName}', { userName: this.share.shareWithDisplayName }) + return t('files_sharing', 'Share with {user}', { user: this.share.shareWithDisplayName }) case ShareType.Email: return t('files_sharing', 'Share with email {email}', { email: this.share.shareWith }) case ShareType.Link: @@ -384,6 +384,9 @@ export default { return t('files_sharing', 'Share in conversation') case ShareType.Remote: { const [user, server] = this.share.shareWith.split('@') + if (this.config.showFederatedSharesAsInternal) { + return t('files_sharing', 'Share with {user}', { user }) + } return t('files_sharing', 'Share with {user} on remote server {server}', { user, server }) } case ShareType.RemoteGroup: diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index 262504aca01..dc200c61df4 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -243,8 +243,7 @@ export default { * @return {boolean} */ isSharedWithMe() { - return this.sharedWithMe !== null - && this.sharedWithMe !== undefined + return !!this.sharedWithMe?.user }, /** |