Fix Don't show groups in share placeholder if group sharing is disabled #2242

Signed-off-by: Zishan-7 <zishan2539@gmail.com>
This commit is contained in:
Zishan-7 2021-08-30 18:29:28 +05:30 committed by hamza221
parent 73ef6e258f
commit fb0709f4a4
3 changed files with 35 additions and 1 deletions

View File

@ -106,7 +106,10 @@ class PageController extends Controller {
$isCirclesEnabled = $this->appManager->isEnabledForUser('circles') === true;
// if circles is not installed, we use 0.0.0
$isCircleVersionCompatible = $this->compareVersion->isCompatible($circleVersion ? $circleVersion : '0.0.0', 22);
// Check whether group sharing is enabled or not
$isGroupSharingEnabled = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
$this->initialStateService->provideInitialState(Application::APP_ID, 'isGroupSharingEnabled', $isGroupSharingEnabled);
$this->initialStateService->provideInitialState(Application::APP_ID, 'locales', $locales);
$this->initialStateService->provideInitialState(Application::APP_ID, 'defaultProfile', $defaultProfile);
$this->initialStateService->provideInitialState(Application::APP_ID, 'supportedNetworks', $supportedNetworks);

View File

@ -49,6 +49,7 @@
<script>
import { NcSelect } from '@nextcloud/vue'
import client from '../../../services/cdav.js'
import isGroupSharingEnabled from '../../../services/isGroupSharingEnabled.js'
import addressBookSharee from './SettingsAddressbookSharee.vue'
import debounce from 'debounce'
@ -79,7 +80,11 @@ export default {
},
computed: {
placeholder() {
return t('contacts', 'Share with users or groups')
if (isGroupSharingEnabled) {
return t('contacts', 'Share with users or groups')
} else {
return t('contacts', 'Share with users')
}
},
noResult() {
return t('contacts', 'No users or groups')

View File

@ -0,0 +1,26 @@
/**
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import { loadState } from '@nextcloud/initial-state'
const isGroupSharingEnabled = loadState('contacts', 'isGroupSharingEnabled', false)
export default isGroupSharingEnabled