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

Ay11 community views #1028

Closed
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -58,8 +58,15 @@

render() {
const { loading, actionSuccess, error } = this.state;
const { options, currentValue, optionsSerializer, disabled, direction, fluid } =
this.props;
const {
options,
currentValue,
optionsSerializer,
disabled,
direction,
fluid,
label,
} = this.props;

return (
<Overridable
Expand All @@ -79,6 +86,7 @@
openOnFocus={false}
selectOnBlur={false}
onChange={this.handleOnChange}
aria-label={label}
disabled={disabled}
direction={direction}
fluid={fluid}
Expand All @@ -102,6 +110,7 @@
optionsSerializer: PropTypes.func,
disabled: PropTypes.bool,
direction: PropTypes.string,
label: PropTypes.string,

Check warning on line 113 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/ActionDropdown.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, opensearch2)

propType "label" is not required, but has no corresponding defaultProps declaration

Check warning on line 113 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/ActionDropdown.js

View workflow job for this annotation

GitHub Actions / Tests (3.8, pypi, postgresql13, elasticsearch7)

propType "label" is not required, but has no corresponding defaultProps declaration

Check warning on line 113 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/ActionDropdown.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, opensearch2)

propType "label" is not required, but has no corresponding defaultProps declaration

Check warning on line 113 in invenio_communities/assets/semantic-ui/js/invenio_communities/members/components/ActionDropdown.js

View workflow job for this annotation

GitHub Actions / Tests (3.9, pypi, postgresql13, elasticsearch7)

propType "label" is not required, but has no corresponding defaultProps declaration
resource: PropTypes.object.isRequired,
fluid: PropTypes.bool,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const MembersSearchBarElement = withState(
icon: "search",
onClick: onBtnSearchClick,
className: "search",
title: i18next.t("Search"),
}}
fluid
placeholder={placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class RemoveMemberModal extends Component {
closeModal={this.onCloseHandler}
contentMap={this.contentMap}
>
<Modal open={modalOpen}>
<Modal open={modalOpen} role="dialog" aria-label={i18next.t("Remove user")}>
<Modal.Header>{content?.headerText}</Modal.Header>
<Modal.Content>
{content?.bodyText} <br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class RadioSelection extends Component {
<Radio
onClick={this.handleOnChange}
label={option.title}
aria-label={option.title}
value={option.name}
checked={selected === option.name}
name="membersRoles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class SearchResultsBulkActions extends Component {
className="align-self-center mr-10"
onChange={this.handleOnChange}
checked={allSelectedChecked && allSelected}
aria-label={i18next.t("Select all members")}
/>
<Dropdown
className="align-self-center fluid-responsive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BulkActionsContext } from "./context";
import React, { Component } from "react";
import PropTypes from "prop-types";
import { Checkbox } from "semantic-ui-react";
import { i18next } from "@translations/invenio_communities/i18next";
import _hasIn from "lodash/hasIn";

export class SearchResultsRowCheckbox extends Component {
Expand Down Expand Up @@ -52,6 +53,7 @@ export class SearchResultsRowCheckbox extends Component {
className="mt-auto mb-auto "
checked={this.isChecked(bulkActionContext, allSelected) || allSelected}
onChange={this.handleOnChange}
aria-label={i18next.t("Select member")}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const RoleDropdown = ({
disabled,
currentValue,
resource,
label,
}) => {
return (
<ActionDropdown
Expand All @@ -64,6 +65,7 @@ export const RoleDropdown = ({
resource={resource}
direction="left"
fluid
label={label}
/>
);
};
Expand Down Expand Up @@ -97,6 +99,7 @@ export const VisibilityDropdown = ({
disabled,
currentValue,
resource,
label,
}) => {
return (
<ActionDropdown
Expand All @@ -111,6 +114,7 @@ export const VisibilityDropdown = ({
resource={resource}
direction="left"
fluid
label={label}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class InvitationResultItem extends Component {
} = this.state;
const { api: invitationsApi } = this.context;
const rolesCanInviteByType = rolesCanInvite[member.type];
const memberInvitationExpiration = formattedTime(request.expires_at);
return (
<Table.Row className="community-member-item">
<Table.Cell>
Expand All @@ -70,8 +71,11 @@ export class InvitationResultItem extends Component {
<Table.Cell data-label={i18next.t("Status")}>
<RequestStatus status={request.status} />
</Table.Cell>
<Table.Cell data-label={i18next.t("Expires")}>
{formattedTime(request.expires_at)}
<Table.Cell
aria-label={i18next.t("Expires") + " " + memberInvitationExpiration}
data-label={i18next.t("Expires")}
>
{memberInvitationExpiration}
</Table.Cell>
<Table.Cell data-label={i18next.t("Role")}>
<RoleDropdown
Expand All @@ -81,6 +85,7 @@ export class InvitationResultItem extends Component {
disabled={!invitation.permissions.can_update_role}
currentValue={invitation.role}
resource={invitation}
label={i18next.t("Role") + " " + invitation.role}
/>
</Table.Cell>
<Table.Cell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const InvitationsSearchBarElement = ({
icon: "search",
onClick: onBtnSearchClick,
className: "search",
title: i18next.t("Search"),
}}
fluid
placeholder={i18next.t("Search in invitations...")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export class InvitationsMembersModal extends Component {
onOpen={this.handleOpenModal}
closeOnDimmerClick={false}
open={open}
aria-label={i18next.t("Invite members")}
trigger={
<Button
className="fluid-responsive"
Expand All @@ -151,6 +152,7 @@ export class InvitationsMembersModal extends Component {
menu={{
className: "rel-pl-2 rel-pt-2",
tabular: true,
role: "tablist",
}}
activeIndex={activeIndex}
panes={this.getPanes()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export class ManagerMembersResultItem extends Component {
const { config } = this.props;
const { result } = this.state;
const { api } = this.context;

const membershipRelativeTimestamp = timestampToRelativeTime(result.created);
const memberVisibility = result.visible
? i18next.t(config.visibility[0].title)
: i18next.t(config.visibility[1].title);
return (
<Table.Row>
<Table.Cell>
Expand Down Expand Up @@ -111,23 +114,28 @@ export class ManagerMembersResultItem extends Component {
</Grid>
</Table.Cell>

<Table.Cell data-label={i18next.t("Member since")}>
{timestampToRelativeTime(result.created)}
<Table.Cell
aria-label={i18next.t("Member since") + " " + membershipRelativeTimestamp}
data-label={i18next.t("Member since")}
>
{membershipRelativeTimestamp}
</Table.Cell>

<Table.Cell data-label={i18next.t("Visibility")}>
<Table.Cell
aria-label={i18next.t("Visibility") + " " + memberVisibility}
data-label={i18next.t("Visibility")}
>
{result.permissions.can_update_visible ? (
<VisibilityDropdown
visibilityTypes={config.visibility}
successCallback={this.updateMemberVisibility}
action={api.updateVisibility}
currentValue={result.visible}
resource={result}
label={i18next.t("Visibility") + " " + memberVisibility}
/>
) : result.visible ? (
i18next.t("Public")
) : (
i18next.t("Hidden")
memberVisibility
)}
</Table.Cell>

Expand All @@ -139,6 +147,7 @@ export class ManagerMembersResultItem extends Component {
action={api.updateRole}
currentValue={result.role}
resource={result}
label={i18next.t("Role") + " " + result.role}
/>
) : (
_upperFirst(result.role)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const ReviewPolicyField = ({ label, formConfig, ...props }) => {
key={item.value}
fieldPath="access.review_policy"
label={item.text}
aria-label={item.text}
labelIcon={item.icon}
checked={_get(field.value, "access.review_policy") === item.value}
value={item.value}
Expand Down
Loading