Skip to content

Commit dbfd2cd

Browse files
committed
Disable add to a project in sharing tab by default
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent 58fb55f commit dbfd2cd

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<SharingEntryInternal :file-info="fileInfo" />
7070

7171
<!-- projects -->
72-
<CollectionList v-if="fileInfo"
72+
<CollectionList v-if="projectsEnabled && fileInfo"
7373
:id="`${fileInfo.id}`"
7474
type="file"
7575
:name="fileInfo.name" />
@@ -90,6 +90,7 @@ import { CollectionList } from 'nextcloud-vue-collections'
9090
import { generateOcsUrl } from '@nextcloud/router'
9191
import Avatar from '@nextcloud/vue/dist/Components/Avatar'
9292
import axios from '@nextcloud/axios'
93+
import { loadState } from '@nextcloud/initial-state'
9394
9495
import Config from '../services/ConfigService'
9596
import { shareWithTitle } from '../utils/SharedWithMe'
@@ -103,6 +104,8 @@ import SharingInherited from './SharingInherited'
103104
import SharingLinkList from './SharingLinkList'
104105
import SharingList from './SharingList'
105106
107+
const projectsEnabled = loadState('core', 'projects_enabled', false)
108+
106109
export default {
107110
name: 'SharingTab',
108111
@@ -136,6 +139,7 @@ export default {
136139
linkShares: [],
137140
138141
sections: OCA.Sharing.ShareTabSections.getSections(),
142+
projectsEnabled,
139143
}
140144
},
141145

config/config.sample.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2218,5 +2218,13 @@
22182218
* \OCP\Accounts\IAccountManager::PROPERTY_PHONE => \OCP\Accounts\IAccountManager::SCOPE_PRIVATE
22192219
* ]
22202220
*/
2221-
'account_manager.default_property_scope' => []
2221+
'account_manager.default_property_scope' => [],
2222+
2223+
/**
2224+
* Enable the legacy Projects feature,
2225+
* superseded by Related resources as of Nextcloud 25
2226+
*
2227+
* Defaults to ``false``
2228+
*/
2229+
'projects.enabled' => false,
22222230
];

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/private/Template/JSConfigHelper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ public function getConfig(): string {
293293
]);
294294
}
295295

296+
$this->initialStateService->provideInitialState('core', 'projects_enabled', $this->config->getSystemValueBool('projects.enabled', false));
297+
296298
$this->initialStateService->provideInitialState('core', 'config', $config);
297299
$this->initialStateService->provideInitialState('core', 'capabilities', $capabilities);
298300

0 commit comments

Comments
 (0)