Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to hide deprecated projects in sharing tab by default #33569

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<SharingEntryInternal :file-info="fileInfo" />

<!-- projects -->
<CollectionList v-if="fileInfo"
<CollectionList v-if="projectsEnabled && fileInfo"
:id="`${fileInfo.id}`"
type="file"
:name="fileInfo.name" />
Expand All @@ -90,6 +90,7 @@ import { CollectionList } from 'nextcloud-vue-collections'
import { generateOcsUrl } from '@nextcloud/router'
import Avatar from '@nextcloud/vue/dist/Components/Avatar'
import axios from '@nextcloud/axios'
import { loadState } from '@nextcloud/initial-state'

import Config from '../services/ConfigService'
import { shareWithTitle } from '../utils/SharedWithMe'
Expand Down Expand Up @@ -136,6 +137,7 @@ export default {
linkShares: [],

sections: OCA.Sharing.ShareTabSections.getSections(),
projectsEnabled: loadState('core', 'projects_enabled', false),
}
},

Expand Down
10 changes: 9 additions & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2218,5 +2218,13 @@
* \OCP\Accounts\IAccountManager::PROPERTY_PHONE => \OCP\Accounts\IAccountManager::SCOPE_PRIVATE
* ]
*/
'account_manager.default_property_scope' => []
'account_manager.default_property_scope' => [],

/**
* Enable the deprecated Projects feature,
* superseded by Related resources as of Nextcloud 25
*
* Defaults to ``false``
*/
'projects.enabled' => false,
];
4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/private/Template/JSConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ public function getConfig(): string {
]);
}

$this->initialStateService->provideInitialState('core', 'projects_enabled', $this->config->getSystemValueBool('projects.enabled', false));

$this->initialStateService->provideInitialState('core', 'config', $config);
$this->initialStateService->provideInitialState('core', 'capabilities', $capabilities);

Expand Down