-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only show enabled modules in global search bar when no results a…
…vailable
- Loading branch information
1 parent
ed4caf7
commit cdc410f
Showing
5 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,4 +143,4 @@ | |
"fontWeightBold": 600 | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl> | ||
// SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import useRsdSettings from '~/config/useRsdSettings' | ||
|
||
export function useModules() { | ||
const {host} = useRsdSettings() | ||
|
||
// TODO: change the type of the module parameter to RsdModule when the modules news and user are also in the default settings | ||
function isModuleEnabled(module: 'software'| 'projects' | 'organisations' | 'communities'): boolean { | ||
if (host?.modules && host?.modules?.length > 0){ | ||
// include only options defined for this RSD host | ||
return host.modules.includes(module) | ||
} | ||
// else all menuItems are allowed by default | ||
return true | ||
} | ||
|
||
return ({ | ||
isModuleEnabled | ||
}) | ||
} |