Skip to content

Commit b217ef0

Browse files
committed
Fix for reset / edit function in user-roles #554
1 parent f369fc9 commit b217ef0

6 files changed

Lines changed: 17 additions & 11 deletions

File tree

client/src/components/MinimalDateField.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ import React, {useRef} from "react";
33
import DatePicker from "react-datepicker";
44
import ResetIcon from "@surfnet/sds/icons/functional-icons/close.svg";
55
import EditIcon from "@surfnet/sds/icons/functional-icons/edit.svg";
6-
76
import "react-datepicker/dist/react-datepicker.css";
87
import "./MinimalDateField.scss"
98
import {futureDate, shortDateFromEpoch} from "../utils/Date";
109
import {isEmpty} from "../utils/Utils";
1110
import I18n from "../locale/I18n";
12-
import {Chip, ChipType} from "@surfnet/sds";
11+
import {Chip, ChipType, Tooltip} from "@surfnet/sds";
1312

1413
export const MinimalDateField = ({
1514
onChange,
@@ -64,11 +63,17 @@ export const MinimalDateField = ({
6463
{(!isEmpty(value) && allowNull) &&
6564
<div className="icon reset-icon left"
6665
onClick={() => onChange(null)}>
67-
<ResetIcon/>
66+
<Tooltip standalone={true}
67+
children={<ResetIcon/>}
68+
tip={I18n.t("forms.reset")}/>
69+
6870
</div>}
6971
<div className={`icon edit-icon ${isEmpty(value) || !allowNull ? "left" : ""}`}
7072
onClick={toggle}>
71-
<EditIcon/>
73+
<Tooltip standalone={true}
74+
children={<EditIcon/>}
75+
tip={I18n.t("forms.edit")}/>
76+
7277
</div>
7378
</div>
7479
);

client/src/components/User.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const User = ({user, other, config, currentUser}) => {
108108
</section>
109109
</div>;
110110
return (
111-
<Card cardType={CardType.Big} children={children}/>
111+
<Card key={index} cardType={CardType.Big} children={children}/>
112112
);
113113
}
114114

client/src/locale/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ const en = {
317317
ok: "OK",
318318
or: "or ",
319319
edit: "Edit",
320+
reset: "Reset",
320321
cancel: "Cancel",
321322
save: "Save",
322323
specificDate: "Set specific date",

client/src/locale/nl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ const nl = {
317317
ok: "Oké",
318318
or: "of ",
319319
edit: "Bewerken",
320+
reset: "Reset",
320321
cancel: "Annuleren",
321322
save: "Opslaan",
322323
specificDate: "Zet specifieke datum",

client/src/pages/Role.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,19 @@ export const Role = () => {
6464
const newTabs = [
6565
<Page key="guests"
6666
name="guests"
67-
label={I18n.t("tabs.guestRoles")}
68-
>
67+
label={I18n.t("tabs.guestRoles")}>
6968
<UserRoles role={res}
7069
guests={true}
7170
/>
7271
</Page>,
7372
<Page key="invitations"
7473
name="invitations"
75-
label={I18n.t("tabs.allPendingInvitations")}
76-
>
74+
label={I18n.t("tabs.allPendingInvitations")}>
7775
<Invitations role={res}/>
7876
</Page>,
7977
<Page key="maintainers"
8078
name="maintainers"
81-
label={I18n.t("tabs.userRoles")}
82-
>
79+
label={I18n.t("tabs.userRoles")}>
8380
<UserRoles role={res}
8481
guests={false}
8582
/>

client/src/tabs/UserRoles.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ export const UserRoles = ({role, guests}) => {
339339
key: "endDate",
340340
header: I18n.t("roles.endDate"),
341341
toolTip: I18n.t("tooltips.roleExpiryDateTooltip"),
342+
hasLink: true,
342343
mapper: userRole => displayEndDate(userRole)
343344
},
344345
{
@@ -349,6 +350,7 @@ export const UserRoles = ({role, guests}) => {
349350
{
350351
key: "adminIcons",
351352
nonSortable: true,
353+
hasLink: true,
352354
header: "",
353355
mapper: userRole => actionIcons(userRole)
354356
},

0 commit comments

Comments
 (0)