-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
marketplace: adding community review support for marketplace items
- Loading branch information
Showing
15 changed files
with
141 additions
and
20 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
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,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2022-2024 GEO Secretariat. | ||
# | ||
# geo-rdm-records is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""GEO Marketplace requests resolver.""" |
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,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2022 Geo Secretariat. | ||
# | ||
# geo-rdm-records is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""GEO RDM Records Resources requests resolver.""" | ||
|
||
from geo_rdm_records.base.requests import BaseRecordProxy, BaseRecordResolver | ||
|
||
from ..records.api import GEOMarketplaceItem, GEOMarketplaceItemDraft | ||
|
||
|
||
class RecordProxy(BaseRecordProxy): | ||
"""Proxy for draft or record classes.""" | ||
|
||
record_cls = GEOMarketplaceItem | ||
|
||
draft_cls = GEOMarketplaceItemDraft | ||
|
||
|
||
class MarketplaceItemDraftResolver(BaseRecordResolver): | ||
"""Marketplace Item draft entity resolver.""" | ||
|
||
type_id = "marketplace-items" | ||
|
||
record_cls = GEOMarketplaceItemDraft | ||
|
||
proxy_cls = RecordProxy | ||
|
||
service_id = "marketplace_items" | ||
|
||
type_key = "marketplace_item" | ||
|
||
|
||
class MarketplaceItemResolver(BaseRecordResolver): | ||
"""Marketplace Item entity resolver.""" | ||
|
||
type_id = "marketplace-item-record" | ||
|
||
record_cls = GEOMarketplaceItem | ||
|
||
proxy_cls = RecordProxy | ||
|
||
service_id = "marketplace_items" | ||
|
||
type_key = "marketplace_item_record" |
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,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2022 Geo Secretariat. | ||
# | ||
# geo-rdm-records is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Community requests configurations.""" |
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,37 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2022 Geo Secretariat. | ||
# | ||
# geo-rdm-records is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Community-related requests.""" | ||
|
||
from invenio_requests.customizations import actions | ||
|
||
from geo_rdm_records.modules.requests.community.submission import ( | ||
AcceptAction, | ||
CancelAction, | ||
DeclineAction, | ||
ExpireAction, | ||
SubmitAction, | ||
) | ||
|
||
# | ||
# Extra configurations for the `CommunitySubmission` class | ||
# > This configuration is possible as in the GEO Knowledge Hub, we use a | ||
# > custom version of the `CommunitySubmission` class, which has support for | ||
# > `overridable configurations.` | ||
# | ||
CommunitySubmissionConfig = { | ||
"allowed_topic_ref_types": ["record", "package", "marketplace_item"], | ||
"available_actions": { | ||
"create": actions.CreateAction, | ||
"submit": SubmitAction, | ||
"delete": actions.DeleteAction, | ||
"accept": AcceptAction, | ||
"cancel": CancelAction, | ||
"decline": DeclineAction, | ||
"expire": ExpireAction, | ||
}, | ||
} |
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,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright (C) 2022 Geo Secretariat. | ||
# | ||
# geo-rdm-records is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Requests notification.""" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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