feat: hide "External Shares" section if no external shares can be created

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2025-11-12 17:37:31 +01:00 committed by nextcloud-command
parent d86975e9fa
commit de286709f8
3 changed files with 11 additions and 1 deletions

View file

@ -43,8 +43,11 @@ class LoadSidebarListener implements IEventListener {
$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);
$showExternalSharing = $appConfig->getValueBool('files_sharing', 'outgoing_server2server_share_enabled', true)
|| $appConfig->getValueBool('core', 'shareapi_allow_links', true);
$this->initialState->provideInitialState('showFederatedSharesAsInternal', $showFederatedAsInternal);
$this->initialState->provideInitialState('showFederatedSharesToTrustedServersAsInternal', $showFederatedToTrustedAsInternal);
$this->initialState->provideInitialState('showExternalSharing', $showExternalSharing);
}
}

View file

@ -329,4 +329,11 @@ export default class Config {
get showFederatedSharesToTrustedServersAsInternal(): boolean {
return loadState('files_sharing', 'showFederatedSharesToTrustedServersAsInternal', false)
}
/**
* Show the external share ui
*/
get showExternalSharing(): boolean {
return loadState('files_sharing', 'showExternalSharing', true)
}
}

View file

@ -72,7 +72,7 @@
<SharingEntryInternal :file-info="fileInfo" />
</section>
<section>
<section v-if="config.showExternalSharing">
<div class="section-header">
<h4>{{ t('files_sharing', 'External shares') }}</h4>
<NcPopover popup-role="dialog">