Skip to content

Commit

Permalink
ui: add subcommunity invitation facet and label
Browse files Browse the repository at this point in the history
  • Loading branch information
carlinmack committed Nov 18, 2024
1 parent 4ea19d2 commit a175c3e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
//
// Invenio 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.
// This file is part of InvenioRequests
// Copyright (C) 2023 CERN.
//
// Invenio 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.

import React from "react";
import { Icon } from "semantic-ui-react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// This file is part of Invenio Requests
// Copyright (C) 2024 CERN.
//
// Invenio is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.

import {
LabelStatusAccept,
LabelStatusCancel,
Expand All @@ -12,6 +18,7 @@ import {
LabelTypeUserAccess,
LabelTypeCommunityManageRecord,
LabelTypeCommunitySubcommunity,
LabelTypeCommunitySubcommunityInvitation,
LabelTypeCommunityMembershipRequest,
} from "@js/invenio_requests/contrib";
import {
Expand Down Expand Up @@ -39,6 +46,8 @@ export const defaultContribComponents = {
[`RequestTypeLabel.layout.user-access-request`]: LabelTypeUserAccess,
[`RequestTypeLabel.layout.community-manage-record`]: LabelTypeCommunityManageRecord,
[`RequestTypeLabel.layout.subcommunity`]: LabelTypeCommunitySubcommunity,
[`RequestTypeLabel.layout.subcommunity-invitation`]:
LabelTypeCommunitySubcommunityInvitation,
[`RequestTypeLabel.layout.community-membership-request`]:
LabelTypeCommunityMembershipRequest,
[`RequestStatusLabel.layout.submitted`]: LabelStatusSubmit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export const LabelTypeCommunitySubcommunity = (props) => (
</Label>
);

export const LabelTypeCommunitySubcommunityInvitation = (props) => (
<Label horizontal className="primary" size="small">
{i18next.t("Subcommunity invitation")}
</Label>
);

export const LabelTypeCommunityMembershipRequest = (props) => (
<Label horizontal className="primary" size="small">
{i18next.t("Membership request")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
LabelTypeUserAccess,
LabelTypeCommunityManageRecord,
LabelTypeCommunitySubcommunity,
LabelTypeCommunitySubcommunityInvitation,
LabelTypeCommunityMembershipRequest,
} from "./contrib";
import {
Expand Down Expand Up @@ -78,6 +79,8 @@ const defaultComponents = {
"RequestTypeLabel.layout.user-access-request": LabelTypeUserAccess,
"RequestTypeLabel.layout.community-manage-record": LabelTypeCommunityManageRecord,
"RequestTypeLabel.layout.subcommunity": LabelTypeCommunitySubcommunity,
"RequestTypeLabel.layout.subcommunity-invitation":
LabelTypeCommunitySubcommunityInvitation,
"RequestTypeLabel.layout.community-membership-request":
LabelTypeCommunityMembershipRequest,
"RequestActionModalTrigger.accept": RequestAcceptModalTrigger,
Expand Down
1 change: 1 addition & 0 deletions invenio_requests/services/requests/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"community-invitation": _("Member invitation"),
# Subcommunity
"subcommunity": _("Subcommunity"),
"subcommunity-invitation": _("Subcommunity invitation"),
# Moderation
"user-moderation": _("User moderation"),
# Instance-specific labels which ideally should not be listed here
Expand Down

0 comments on commit a175c3e

Please sign in to comment.