Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: add subcommunity invitation facet and label #415

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
slint marked this conversation as resolved.
Show resolved Hide resolved
"RequestTypeLabel.layout.community-membership-request":
LabelTypeCommunityMembershipRequest,
"RequestActionModalTrigger.accept": RequestAcceptModalTrigger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const ComputerTabletRequestItem = ({
name={getUserIcon(result.expanded?.receiver)}
/>
<span className="ml-5">{result.expanded?.receiver.metadata.title}</span>
{result.expires_at && " - "}
</>
)}
{result.expires_at && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const MobileRequestItem = ({
name={getUserIcon(result.expanded?.receiver)}
/>
<span className="ml-5">{result.expanded?.receiver.metadata.title}</span>
{result.expires_at && " - "}
</>
)}
{result.expires_at && (
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
Loading