Skip to content

Commit

Permalink
Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 12, 2023
1 parent 514680a commit 5595b0b
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 36 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@surfnet/sds": "^0.0.88",
"@surfnet/sds": "^0.0.93",
"dompurify": "^3.0.3",
"i18n-js": "^4.2.3",
"isomorphic-dompurify": "^1.5.0",
Expand Down
2 changes: 2 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {BrowserRouter,Routes, Route} from "react-router-dom";
//Always keep these two last
import './index.scss';
import '@surfnet/sds/styles/sds.css';
//Do not change the order of @surfnet.sds style imports
import '@surfnet/sds/cjs/index.css';

const root = ReactDOM.createRoot(document.getElementById("app"));
root.render(
Expand Down
4 changes: 4 additions & 0 deletions client/src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ const en = {
inviterRoles: "Select the roles for the new invitation",
rolesPlaceHolder: "Choose one or more roles",
expiryDate: "Invitation expiry date",
expiryDateQuestion: "Invitation acceptance period",
roleExpiryDate: "Role expiry date",
roleExpiryDateQuestion: "Use a user specific role expiry date?",
withinThreeMonths: "Within 1 month",
createdAt: "Sent",
message: "Message",
messagePlaceholder: "Personal message for the invitee included in the invitation",
Expand Down Expand Up @@ -233,6 +236,7 @@ const en = {
edit: "Edit",
cancel: "Cancel",
save: "Save",
specificDate: "Set specific date",
and: "and",
more: "More",
less: "Less",
Expand Down
4 changes: 4 additions & 0 deletions client/src/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ const nl = {
inviterRoles: "Selecteer de rollen voor de nieuwe uitnodiging",
rolesPlaceHolder: "Kies een of meer rollen",
expiryDate: "Verloopdatum uitnodiging",
expiryDateQuestion: "Uitnodiging acceptatie periode",
roleExpiryDate: "Verloopdatum rol",
roleExpiryDateQuestion: "Zet een specifieke gebruikers verloopdatum?",
withinThreeMonths: "Binnen 1 maand",
createdAt: "Verstuurd",
message: "Bericht",
messagePlaceholder: "Persoonlijk bericht voor de genodigde dat wordt opgenomen in de uitnodiging",
Expand Down Expand Up @@ -233,6 +236,7 @@ const nl = {
edit: "Bewerken",
cancel: "Annuleren",
save: "Opslaan",
specificDate: "Zet specifieke datum",
and: "en",
more: "Meer",
less: "Minder",
Expand Down
61 changes: 41 additions & 20 deletions client/src/pages/InvitationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {ReactComponent as UserIcon} from "@surfnet/sds/icons/functional-icons/id
import {ReactComponent as UpIcon} from "@surfnet/sds/icons/functional-icons/arrow-up-2.svg";
import {ReactComponent as DownIcon} from "@surfnet/sds/icons/functional-icons/arrow-down-2.svg";
import {newInvitation, rolesByApplication} from "../api";
import {Button, ButtonType, Checkbox, Loader, Tooltip} from "@surfnet/sds";
import {Button, ButtonType, Checkbox, Loader, RadioOptions, Tooltip} from "@surfnet/sds";
import "./InvitationForm.scss";
import {UnitHeader} from "../components/UnitHeader";
import InputField from "../components/InputField";
Expand All @@ -28,6 +28,9 @@ import {RoleCard} from "../components/RoleCard";
export const InvitationForm = () => {
const location = useLocation();
const navigate = useNavigate();

const {user, setFlash, config} = useAppStore(state => state);

const [guest, setGuest] = useState(false);
const [roles, setRoles] = useState([]);
const [selectedRoles, setSelectedRoles] = useState([]);
Expand All @@ -39,8 +42,9 @@ export const InvitationForm = () => {
intendedAuthority: AUTHORITIES.GUEST
});
const [displayAdvancedSettings, setDisplayAdvancedSettings] = useState(false);
const {user, setFlash, config} = useAppStore(state => state);
const [loading, setLoading] = useState(true);
const [customExpiryDate, setCustomExpiryDate] = useState(false);
const [customRoleExpiryDate, setCustomRoleExpiryDate] = useState(false);
const [initial, setInitial] = useState(true);
const required = ["intendedAuthority", "invites"];

Expand Down Expand Up @@ -264,15 +268,6 @@ export const InvitationForm = () => {
{I18n.t("roles.hideAdvancedSettings")}
<UpIcon/>
</a>
<DateField value={invitation.expiryDate}
onChange={e => setInvitation({...invitation, expiryDate: e})}
showYearDropdown={true}
pastDatesAllowed={config.pastDateAllowed}
minDate={futureDate(1)}
maxDate={futureDate(30)}
name={I18n.t("invitations.expiryDate")}
toolTip={I18n.t("tooltips.expiryDateTooltip")}/>

<Checkbox name={I18n.t("invitations.enforceEmailEquality")}
value={invitation.enforceEmailEquality || false}
onChange={e => setInvitation({...invitation, enforceEmailEquality: e.target.checked})}
Expand All @@ -296,16 +291,42 @@ export const InvitationForm = () => {
readOnly={invitation.intendedAuthority === AUTHORITIES.GUEST}
tooltip={I18n.t("tooltips.guestRoleIncludedTooltip")}
/>
<RadioOptions name={"roleExpiryDate"}
value={customRoleExpiryDate}
onChange={e => setCustomRoleExpiryDate(!customRoleExpiryDate)}
label={I18n.t("invitations.roleExpiryDateQuestion")}
falseLabel={I18n.t("forms.no")}
reverse={false}
trueLabel={I18n.t("forms.specificDate")}
/>
{customRoleExpiryDate &&
<DateField value={invitation.roleExpiryDate}
onChange={e => setInvitation({...invitation, roleExpiryDate: e})}
showYearDropdown={true}
disabled={selectedRoles.some(role => !role.overrideSettingsAllowed)}
pastDatesAllowed={config.pastDateAllowed}
allowNull={selectedRoles.every(role => role.overrideSettingsAllowed) && invitation.intendedAuthority !== AUTHORITIES.GUEST}
minDate={futureDate(1, invitation.expiryDate)}
name={I18n.t("invitations.roleExpiryDate")}
toolTip={I18n.t("tooltips.roleExpiryDateTooltip")}/>}

<DateField value={invitation.roleExpiryDate}
onChange={e => setInvitation({...invitation, roleExpiryDate: e})}
showYearDropdown={true}
disabled={selectedRoles.some(role => !role.overrideSettingsAllowed)}
pastDatesAllowed={config.pastDateAllowed}
allowNull={selectedRoles.every(role => role.overrideSettingsAllowed) && invitation.intendedAuthority !== AUTHORITIES.GUEST}
minDate={futureDate(1, invitation.expiryDate)}
name={I18n.t("invitations.roleExpiryDate")}
toolTip={I18n.t("tooltips.roleExpiryDateTooltip")}/>
<RadioOptions name={"expiryDate"}
value={customExpiryDate}
onChange={e => setCustomExpiryDate(!customExpiryDate)}
label={I18n.t("invitations.expiryDateQuestion")}
falseLabel={I18n.t("invitations.withinThreeMonths")}
reverse={false}
trueLabel={I18n.t("forms.specificDate")}
/>
{customExpiryDate &&
<DateField value={invitation.expiryDate}
onChange={e => setInvitation({...invitation, expiryDate: e})}
showYearDropdown={true}
pastDatesAllowed={config.pastDateAllowed}
minDate={futureDate(1)}
maxDate={futureDate(30)}
name={I18n.t("invitations.expiryDate")}
toolTip={I18n.t("tooltips.expiryDateTooltip")}/>}

</div>}
<section className="actions">
Expand Down
7 changes: 7 additions & 0 deletions client/src/pages/InvitationForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
margin-left: 15px;
}
}
.sds--radio-options {
width: 320px;

.sds--text-field-container div:last-child {
margin-left: auto;
}
}
}


Expand Down
8 changes: 4 additions & 4 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1876,10 +1876,10 @@
dependencies:
"@sinonjs/commons" "^1.7.0"

"@surfnet/sds@^0.0.88":
version "0.0.88"
resolved "https://registry.yarnpkg.com/@surfnet/sds/-/sds-0.0.88.tgz#721962e3e3d24f8488f74a9d3280df55ca1eb719"
integrity sha512-fU4DYt2ncwGr0IsC8DB0MHHPhmv4PB5qTj0Z544jtccpKeUqdoU7sz3JwYuFeqzUM2jWL7TQvJSpunQwR0b8Qw==
"@surfnet/sds@^0.0.93":
version "0.0.93"
resolved "https://registry.yarnpkg.com/@surfnet/sds/-/sds-0.0.93.tgz#68f0a4a7aa80ce6888a1e87e38bee19fb6238b21"
integrity sha512-KG4BqFFxhgASnJ4YbzTthH1BEh5Bkqe7z5pFPoLHb6sVhXt+Vz7OxqMoTzMZKkB7Q83O78R/GyCABSe85kQxXA==

"@surma/rollup-plugin-off-main-thread@^2.2.3":
version "2.2.3"
Expand Down
1 change: 1 addition & 0 deletions server/src/main/java/access/model/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class Role implements Serializable, Provisionable {
name = "roles_applications",
joinColumns = @JoinColumn(name = "role_id"),
inverseJoinColumns = @JoinColumn(name = "application_id"))
//TODO https://www.baeldung.com/hibernate-persisting-maps, store landingpage per applications
private Set<Application> applications = new HashSet<>();

@OneToMany(mappedBy = "role",
Expand Down
6 changes: 4 additions & 2 deletions server/src/main/resources/manage/oidc10_rp.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name:nl": "Calendar NL",
"OrganizationName:en": "SURF bv",
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png",
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a"
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a",
"coin:application_url": "https://default-url-from-manage.org"
}
}
},
Expand All @@ -24,7 +25,8 @@
"name:en": "Cloud EN",
"name:nl": "Cloud NL",
"OrganizationName:en": "SURF bv",
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png"
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png",
"coin:application_url": "https://default-url-from-manage.org"
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions server/src/main/resources/manage/saml20_sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"name:en": "Wiki EN",
"name:nl": "Wiki NL",
"OrganizationName:en": "SURF bv",
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a"
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a",
"coin:application_url": "https://default-url-from-manage.org"
}
}
},
Expand All @@ -24,7 +25,8 @@
"name:nl": "Network NL",
"OrganizationName:en": "SURF bv",
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png",
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a"
"coin:institution_guid": "ad93daef-0911-e511-80d0-005056956c1a",
"coin:application_url": "https://default-url-from-manage.org"
}
}
},
Expand All @@ -38,7 +40,8 @@
"name:en": "Storage EN",
"name:nl": "Storage NL",
"OrganizationName:en": "SURF bv",
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png"
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png",
"coin:application_url": "https://default-url-from-manage.org"
}
}
},
Expand All @@ -52,7 +55,8 @@
"name:en": "Research EN",
"name:nl": "Research NL",
"OrganizationName:en": "SURF bv",
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png"
"logo:0:url": "https://static.surfconext.nl/media/idp/surfconext.png",
"coin:application_url": "https://default-url-from-manage.org"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion welcome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@surfnet/sds": "^0.0.88",
"@surfnet/sds": "^0.0.93",
"dompurify": "^3.0.3",
"i18n-js": "^4.2.3",
"isomorphic-dompurify": "^1.5.0",
Expand Down
8 changes: 4 additions & 4 deletions welcome/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1860,10 +1860,10 @@
dependencies:
"@sinonjs/commons" "^1.7.0"

"@surfnet/sds@^0.0.88":
version "0.0.88"
resolved "https://registry.yarnpkg.com/@surfnet/sds/-/sds-0.0.88.tgz#721962e3e3d24f8488f74a9d3280df55ca1eb719"
integrity sha512-fU4DYt2ncwGr0IsC8DB0MHHPhmv4PB5qTj0Z544jtccpKeUqdoU7sz3JwYuFeqzUM2jWL7TQvJSpunQwR0b8Qw==
"@surfnet/sds@^0.0.93":
version "0.0.93"
resolved "https://registry.yarnpkg.com/@surfnet/sds/-/sds-0.0.93.tgz#68f0a4a7aa80ce6888a1e87e38bee19fb6238b21"
integrity sha512-KG4BqFFxhgASnJ4YbzTthH1BEh5Bkqe7z5pFPoLHb6sVhXt+Vz7OxqMoTzMZKkB7Q83O78R/GyCABSe85kQxXA==

"@surma/rollup-plugin-off-main-thread@^2.2.3":
version "2.2.3"
Expand Down

0 comments on commit 5595b0b

Please sign in to comment.