-
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.
Merge pull request #1246 from research-software-directory/1212-softwa…
…re-add-community-categories Allow adding community categories to software
- Loading branch information
Showing
13 changed files
with
436 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
-- SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
-- | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
CREATE FUNCTION delete_community_categories_from_software(software_id UUID, community_id UUID) | ||
RETURNS VOID | ||
LANGUAGE sql AS | ||
$$ | ||
DELETE FROM category_for_software | ||
USING category | ||
WHERE category_for_software.category_id = category.id AND category_for_software.software_id = software_id AND category.community = community_id; | ||
$$; |
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 |
---|---|---|
|
@@ -139,4 +139,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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// SPDX-FileCopyrightText: 2024 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <[email protected]> | ||
// SPDX-FileCopyrightText: 2024 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
@@ -16,22 +17,22 @@ export default function useCategories({community}:{community:string|null}){ | |
const [loading, setLoading] = useState<boolean> (true) | ||
|
||
useEffect(() => { | ||
let abort = false | ||
let abort: boolean = false | ||
// only if there is community value | ||
loadCategoryRoots(community) | ||
.then(roots => { | ||
if (abort===true) return | ||
if (abort) return | ||
setRoots(roots) | ||
setError(null) | ||
}) | ||
.catch(e => { | ||
logger(`useCategories...${e.message}`,'error') | ||
if (abort===true) return | ||
if (abort) return | ||
setError('Couldn\'t load the categories, please try again or contact us') | ||
setRoots(null) | ||
}) | ||
.finally(() => { | ||
if (abort===true) return | ||
if (abort) return | ||
setLoading(false) | ||
}) | ||
|
||
|
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
Oops, something went wrong.