Skip to content

Commit

Permalink
Hide add to a project in sharing tab by default
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Aug 18, 2022
1 parent 2f538bb commit c6c0236
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
6 changes: 5 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 All @@ -103,6 +104,8 @@ import SharingInherited from './SharingInherited'
import SharingLinkList from './SharingLinkList'
import SharingList from './SharingList'
const projectsEnabled = loadState('core', 'projects_enabled', false)
export default {
name: 'SharingTab',
Expand Down Expand Up @@ -136,6 +139,7 @@ export default {
linkShares: [],
sections: OCA.Sharing.ShareTabSections.getSections(),
projectsEnabled,
}
},
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

0 comments on commit c6c0236

Please sign in to comment.