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

Make orphan jobs idempotent #621

Merged
merged 27 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bf0a5c7
Fix activity dates for suspend user tests.
baszoetekouw Mar 31, 2023
c2136c4
flake8
baszoetekouw Mar 31, 2023
b44031f
Updated translation: change account to profile
FlorisFokkinga Mar 31, 2023
4871a69
Don't send user notification of deletion after suspend
baszoetekouw Mar 31, 2023
3096bf4
Fix mails for when suspended accounts are deleted
baszoetekouw Mar 31, 2023
78f7f32
add test for reentrant behaviour of user suspension
baszoetekouw Mar 31, 2023
35080ca
Make suspending/deletion of orphaned user idempotent.
baszoetekouw Apr 4, 2023
1152909
Additional suspension tests
baszoetekouw Apr 4, 2023
d2f170b
flake8
baszoetekouw Apr 4, 2023
72477f3
Update translation: no access to service error messages
FlorisFokkinga Mar 30, 2023
3e8a72a
Fixes #612
oharsta Mar 31, 2023
c1dd2b9
Upgraded to redis 4.5.4
oharsta Mar 31, 2023
93eb3c3
Fixes #610
oharsta Mar 31, 2023
312d47d
Fixes #552
oharsta Mar 31, 2023
2df58ad
Fixes #466
oharsta Mar 31, 2023
f9199d9
Fixes #607
oharsta Mar 31, 2023
f2f0fdb
Fixes #362
oharsta Mar 31, 2023
e8e86d4
Backward compatible mail environment
oharsta Mar 31, 2023
aec2a82
Modified footer
FlorisFokkinga Mar 31, 2023
a3ffb86
Partial fix for #614
oharsta Apr 3, 2023
b48185e
Fixes #616
oharsta Apr 3, 2023
2193bbc
Fixes #615
oharsta Apr 3, 2023
6ada889
Fixes #617
oharsta Apr 3, 2023
8700eed
Update translation: download profile button
FlorisFokkinga Apr 3, 2023
2216dc2
Fixes #618
oharsta Apr 4, 2023
4189940
Fixes #620
oharsta Apr 4, 2023
812c23f
Migrated to SDS Chip
oharsta Apr 4, 2023
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
2 changes: 1 addition & 1 deletion client/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ export function clearMockScimStatistics() {

//SCIM
export function sweep(service) {
return postPutJson(`/api/scim/v2/sweep?service_id=${service.id}`, {}, "PUT")
return postPutJson(`/api/scim/v2/sweep?service_id=${service.id}`, {}, "PUT", false);
}


27 changes: 15 additions & 12 deletions client/src/components/DateField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,32 @@ export default class DateField extends React.Component {

toggle = () => this.component.setOpen(true);

invalidValue = (onChange) => {
setTimeout(() => onChange(moment().add(16, "days").toDate()), 250);
}

validateOnBlur = e => {
const {onChange, maxDate = null, minDate = null, allowNull = false, performValidateOnBlur = true,
pastDatesAllowed = false} = this.props;
const {
onChange, maxDate = null, minDate = null, allowNull = false, performValidateOnBlur = true,
pastDatesAllowed = false
} = this.props;
if (!performValidateOnBlur) {
stopEvent(e);
return;
}

if (e && e.target) {
const minimalDate = minDate || moment().add(1, "day").toDate();
const maximalDate = maxDate || moment().add(31, "day").toDate();
minimalDate.setHours(0,0,0,0);
const value = e.target.value;
if (value) {
const m = moment(value, "dd/MM/yyyy");
const m = moment(value, "DD/MM/YYYY");
const d = m.toDate();
if (!pastDatesAllowed && (!m.isValid() || d > maximalDate || d < minimalDate)) {
setTimeout(() => onChange(moment().add(16, "days").toDate()), 250);
}
} else {
if (!allowNull) {
setTimeout(() => onChange(moment().add(16, "days").toDate()), 250);
if (!m.isValid() || (!pastDatesAllowed && d < minimalDate) || (maxDate && d > maxDate)) {
this.invalidValue(onChange);
}

} else if (!allowNull) {
this.invalidValue(onChange);
}
}
}
Expand All @@ -58,7 +61,7 @@ export default class DateField extends React.Component {
return (
<div className="date-field">
{name && <label className="date-field-label" htmlFor={name}>{name}
{toolTip && <Tooltip tip={toolTip} />}
{toolTip && <Tooltip tip={toolTip}/>}
</label>}
<label className={"date-picker-container"} htmlFor={name}>
<DatePicker
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/EmailField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function EmailField({
if (!["Enter", "Spacebar", "Backspace", "Tab"].includes(e.key)) {
setEmailErrors([]);
}
setValue(e.target.state);
setValue(e.target.value);
}

const displayEmail = email => {
Expand Down
1 change: 1 addition & 0 deletions client/src/components/redesign/AboutService.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ div.service-about-mod {

@media (max-width: $tablet-max) {
flex-direction: column;
padding: 32px 15px;
}

span.role {
Expand Down
10 changes: 4 additions & 6 deletions client/src/components/redesign/JoinRequests.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import {joinRequestAccept, joinRequestDecline, joinRequestDelete} from "../../ap
import UserColumn from "./UserColumn";
import moment from "moment";
import {ReactComponent as MembersIcon} from "../../icons/single-neutral.svg";
import {Tooltip} from "@surfnet/sds";
import {Chip, Tooltip} from "@surfnet/sds";
import Select from "react-select";
import InstituteColumn from "./InstituteColumn";
import {chipTypeForStatus} from "../../utils/UserRole";
import {Chip} from "@surfnet/sds";

const allValue = "all";

Expand Down Expand Up @@ -204,9 +203,8 @@ class JoinRequests extends React.Component {
date: moment(joinRequest.created_at * 1000).format("LL"),
name: joinRequest.user.name
})}</h2>
{<span className={`status ${joinRequest.status}`}>
{I18n.t(`collaborationRequest.statuses.${joinRequest.status}`)}
</span>}
{<Chip label={I18n.t(`collaborationRequest.statuses.${joinRequest.status}`)}
type={chipTypeForStatus(joinRequest)}/>}
</div>
{joinRequest.reference && <InputField name={I18n.t("joinRequest.reference")}
value={joinRequest.reference}
Expand Down Expand Up @@ -281,7 +279,7 @@ class JoinRequests extends React.Component {
key: "status",
header: I18n.t("collaborationRequest.status"),
mapper: entity => <Chip type={chipTypeForStatus(entity)}
label={I18n.t(`collaborationRequest.statuses.${entity.status}`)} />
label={I18n.t(`collaborationRequest.statuses.${entity.status}`)}/>
},
]
const filteredJoinRequests = filterValue.value === allValue ? collaboration.join_requests :
Expand Down
9 changes: 6 additions & 3 deletions client/src/components/redesign/JoinRequests.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "../../stylesheets/vars";
@import "../../stylesheets/forms";
@import "../../stylesheets/unit_header";
@import "../../stylesheets/entity_status";

table.joinRequests {

Expand Down Expand Up @@ -91,9 +90,13 @@ table.joinRequests {
}

.join-request-header {
display: flex;
display: flex;
align-items: center;

@include entity-status;
button.sds--chips {
margin-left: 25px;
max-height: 34px;
}
}

display: flex;
Expand Down
8 changes: 1 addition & 7 deletions client/src/components/redesign/MemberJoinRequests.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "../../stylesheets/vars";
@import "../../stylesheets/unit_header";
@import "../../stylesheets/entity_status";

table.memberJoinRequests, table.systemJoinRequests, table.deletedJoinRequests {

Expand All @@ -14,6 +13,7 @@ table.memberJoinRequests, table.systemJoinRequests, table.deletedJoinRequests {
&.user__name {
width: 35%;
}

&.user__schac_home_organisation {
width: 20%;
}
Expand Down Expand Up @@ -96,12 +96,6 @@ table.memberJoinRequests, table.systemJoinRequests, table.deletedJoinRequests {
padding: 15px 15px 0 15px;
}

.join-request-header {
display: flex;

@include entity-status;
}

display: flex;
flex-direction: column;

Expand Down
12 changes: 8 additions & 4 deletions client/src/components/redesign/OrganisationServices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class OrganisationServices extends React.Component {
serviceSortProperty = (service, organisation) => {
const tooltip = this.deductTooltip(service, organisation);
const connected = organisation.services.some(s => s.id === service.id);
return (connected && !tooltip) ? 0 : tooltip ? 2 : 1;
return (connected && !tooltip) ? 0 : tooltip ? 2 : 1;
}

deductTooltip = (service, organisation) => {
Expand All @@ -121,10 +121,14 @@ class OrganisationServices extends React.Component {
const allowed_org = service.allowed_organisations.some(org => org.id === organisation.id) || trusted_org;
if (!service.allow_restricted_orgs && organisation.services_restricted) {
tooltip = I18n.t("organisationServices.serviceRestrictedOrganisation");
} else if (!service.access_allowed_for_all && !allowed_org) {
tooltip = I18n.t("organisationServices.notEnabledOrganisation");
} else if (!service.automatic_connection_allowed && !trusted_org) {
} else if (service.non_member_users_access_allowed) {
tooltip = I18n.t("organisationServices.accessForNonMembersOrganisation");
} else if (service.access_allowed_for_all && !service.automatic_connection_allowed
&& !trusted_org && !service.non_member_users_access_allowed) {
tooltip = I18n.t("organisationServices.notAllowedOrganisation");
} else if (!service.access_allowed_for_all && !service.automatic_connection_allowed
&& !allowed_org && !service.non_member_users_access_allowed) {
tooltip = I18n.t("organisationServices.notEnabledOrganisation");
}
return tooltip;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ServiceConnectionRequests extends React.Component {
<h2>{I18n.t("models.serviceConnectionRequests.details",
{
date: moment(serviceConnectionRequest.created_at * 1000).format("LL"),
name: serviceConnectionRequest.requester.name,
name: serviceConnectionRequest.requester.name || serviceConnectionRequest.requester.uid,
collaborationName: serviceConnectionRequest.collaboration.name
})}</h2>

Expand Down
4 changes: 3 additions & 1 deletion client/src/components/redesign/UsedServices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class UsedServices extends React.Component {
.filter(service => {
return (service.allowed_organisations.some(org => org.id === collaboration.organisation_id)
|| service.access_allowed_for_all
|| service.automatic_connection_allowed
|| service.non_member_users_access_allowed
|| service.automatic_connection_allowed_organisations.some(org => org.id === collaboration.organisation_id))
&& servicesInUse.indexOf(service.id) === -1
&& (service.allow_restricted_orgs || !collaboration.organisation.services_restricted);
Expand Down Expand Up @@ -275,7 +277,7 @@ class UsedServices extends React.Component {
<h3>{I18n.t("models.serviceConnectionRequests.details",
{
date: moment(serviceConnectionRequest.created_at * 1000).format("LL"),
name: serviceConnectionRequest.requester.name,
name: serviceConnectionRequest.requester.name || serviceConnectionRequest.requester.uid,
collaborationName: collaboration.name
})}</h3>
<Logo src={serviceConnectionRequest.service.logo}/>
Expand Down
11 changes: 6 additions & 5 deletions client/src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ I18n.translations.en = {
sshKeyError: "This SSH cipher isn't recognized. Please refer to the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://edu.nl/87btm\">documentation</a> for supported formats.",
sshConvertInfo: "Public key will be converted to the <code>OpenSSH</code> format when saving the profile",
update: "Update",
download: "Download",
download: "Download profile",
flash: {
updated: "Your profile has been updated"
},
Expand Down Expand Up @@ -1376,6 +1376,7 @@ I18n.translations.en = {
noServices: "This organisation has no services connected.",
searchServices: "Search, select and add services to the available services within organisation {{name}}.",
deleteServiceTooltip: "Make this service unavailable in the organisation {{name}}. <strong>Note</strong>: the service itself is NOT deleted. It is only not available anymore for the members of the collaborations on this organisation",
accessForNonMembersOrganisation: "This service cannot be enabled for all collaborations, because all users of the platform can access this service, regardless of any collaboration membership.",
notAllowedOrganisation: "This service cannot be enabled for all collaborations, because it does not allow automatic connections. Connections can still be requested by individual collaborations in your organisation.",
notEnabledOrganisation: "This service cannot be enabled for all collaborations, because the service does not allow access for this organisation.",
serviceRestrictedOrganisation: "This service cannot be made mandatory for all collaborations, because this organisation can only link SURF services.",
Expand Down Expand Up @@ -1996,11 +1997,11 @@ I18n.translations.en = {
sfo: {
title: "You do not have access to <i>{{name}}</i>",
info: "Bad luck...",
info1: "You are not logged into SURF Research Access Management, and therefore you don't have access to <i>{{name}}</i>.",
info2: "<p>You are not logged into SURF Research Access Management as your profile is suspended, and therefore you don't have access to <i>{{name}}</i>.<p>Contact your admin(s) to enable access to this service.</p>",
info3: "You are logged into SURF Research Access Management, but the service <i>{{name}}</i> is unknown.",
info1: "<p>Access to <i>{{name}}</i> requires membership of a collaboration in SURF Research Access Management.</p><p>Contact your admin(s) to invite you to a collaboration that grants access to this service.</p>",
info2: "<p>Your profile in SURF Research Access Management is suspended, and therefore you don't have access to <i>{{name}}</i>.<p>Contact your admin(s) to enable access to this service.</p>",
info3: "You are logged in, but the service <i>{{name}}</i> is unknown to SURF Research Access Management.",
info4: "<p>You are logged into SURF Research Access Management, but none of the collaborations you are member of grant you access to <i>{{name}}</i>.</p><p>Contact your admin(s) to enable access to this service.</p>",
info5: "<p>You are logged into SURF Research Access Management, but you don't have access to <i>{{name}}</i>. The collaboration which is connected to service <i>{{name}}</i> is not active.</p><p>Contact your admin(s) to enable access to this service.</p>",
info5: "<p>You are logged into SURF Research Access Management, but you don't have access to <i>{{name}}</i>. The collaboration which is connected to service <i>{{name}}</i> is inactive.</p><p>Contact your admin(s) to enable access to this service.</p>",
info6: "<p>You are logged into SURF Research Access Management, but you don't have access to <i>{{name}}</i>. Your collaboration membership which grants you access to <i>{{name}}</i> is expired.</p><p>Contact your admin(s) to enable access to this service.</p>",
ticket: "Copy & paste the following information if you contact <a href='mailto:sram-support@surf.nl'>sram-support@surf.nl</a>",
entityId: "Entity ID",
Expand Down
11 changes: 6 additions & 5 deletions client/src/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ I18n.translations.nl = {
sshKeyError: "Deze SSH cipher wordt niet herkend. In de <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://edu.nl/87btm\">documentatie</a> staan de ondersteunde formaten.",
sshConvertInfo: "Je publieke SSH-sleutel wordt geconverteerd naar het bestandsformaat <code>OpenSSH-key</code> bij het opslaan van het profiel",
update: "Opslaan",
download: "Download",
download: "Download profiel",
flash: {
updated: "Je profiel is bijgewerkt"
},
Expand Down Expand Up @@ -1376,6 +1376,7 @@ I18n.translations.nl = {
noServices: "Deze organisatie heeft geen gekoppelde diensten.",
searchServices: "Zoek, kies en voeg diensten toe aan organisatie {{name}}",
deleteServiceTooltip: "Maak deze dienst ontoegankelijk voor samenwerking {{name}}. <strong>Let op</strong>: de dienst wordt niet verwijderd, alleen onbeschikbaar voor de samenwerkingen van deze organisatie.",
accessForNonMembersOrganisation: "Deze dienst kan niet worden verplicht voor alle samenwerkingen omdat alle gebruikers van het platform hebben toegang tot deze dienst, ongeacht lidmaatschap van en koppelingen met samenwerkingen\n",
notAllowedOrganisation: "Deze dienst kan niet worden verplicht voor alle samenwerkingen omdat deze dienst automatische verbindingen niet toestaat. Aansluitingen kunnen nog steeds worden aangevraagd door individuele samenwerkingen in je organisatie.",
notEnabledOrganisation: "Deze dienst kan niet worden verplicht voor alle samenwerkingen omdat deze dienst toegang voor deze organisatie niet toestaat.",
serviceRestrictedOrganisation: "Deze dienst kan niet worden verplicht voor alle samenwerkingen omdat deze organisatie alleen SURF-diensten mag koppelen.",
Expand Down Expand Up @@ -1996,10 +1997,10 @@ I18n.translations.nl = {
sfo: {
title: "Je hebt geen toegang tot <i>{{name}}</i>",
info: "Pech gehad...",
info1: "Je bent niet ingelogd bij SURF Research Access Management, daarom heb je geen toegang tot <i>{{name}}</i>.",
info2: "<p>Je bent niet ingelogd bij SURF Research Access Management omdat je profiel is geschorst. Daarom heb je geen toegang tot <i>{{name}}</i>.</p><p>Neem contact op met de beheerder(s) van jouw samenwerking(en) voor toegang tot deze dienst.</p>",
info3: "Je bent ingelogd bij SURF Research Access Management, maar de dienst <i>{{name}}</i> is onbekend.",
info4: "<p>Je bent ingelogd via SURF Research Access Management, maar de samenwerking(en) waar je lid van bent, geven geen toegang tot <i>{{name}}</i>.</p><p>Neem contact op met de beheerder(s) van jouw samenwerking(en) voor toegang tot deze dienst.</p>",
info1: "<p>Toegang tot <i>{{name}}</i> vereist lidmaatschap van een samenwerking in SURF Research Access Management.</p><p>Vraag de beheerder(s) om je uit te nodigen voor een samenwerking die toegang geeft tot deze dienst.</p>",
info2: "<p>Je profiel in SURF Research Access Management is geschorst. Daarom heb je geen toegang tot <i>{{name}}</i>.</p><p>Neem contact op met de beheerder(s) voor toegang tot deze dienst.</p>",
info3: "Je bent ingelogd bij, maar de dienst <i>{{name}}</i> is onbekend bij SURF Research Access Management.",
info4: "<p>Je bent ingelogd via SURF Research Access Management, maar geen van de samenwerking(en) waar je lid van bent geven toegang tot <i>{{name}}</i>.</p><p>Neem contact op met de beheerder(s) voor toegang tot deze dienst.</p>",
info5: "<p>Je bent ingelogd via SURF Research Access Management, maar je hebt geen toegang tot <i>{{name}}</i> omdat de samenwerking(en) waarvan je lid bent niet actief zijn.</p><p>Neem contact op met de beheerder(s) van jouw samenwerking(en) voor toegang tot deze dienst.</p>",
info6: "<p>Je bent ingelogd via SURF Research Access Management, maar je hebt geen toegang tot <i>{{name}}</i>. Je lidmaatschap van de samenwerking(en) waar je momenteel lid van bent zijn verlopen.</p><p>Neem contact op met de beheerder(s) van jouw samenwerking(en) voor toegang tot deze dienst.</p>",
ticket: "Copy & paste de volgende informatie als je contact opneemt met <a href='mailto:sram-support@surf.nl'>sram-support@surf.nl</a>",
Expand Down
Loading