Skip to content

Commit

Permalink
Do not allow for migrations without applications
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 7, 2023
1 parent 211446a commit c4be9a9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion teams-gui/src/components/MigrateTeamForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ReactComponent as BackIcon} from "../icons/arrow-left-1.svg";
import {teamInviteAppDetails} from "../api";
import {SpinnerField} from "./SpinnerField";
import {Button} from "./Button";
import {isEmpty} from "../utils/utils";

export const MigrateTeamForm = ({migrateTeam, team, setShowForm}) => {

Expand All @@ -23,6 +24,7 @@ export const MigrateTeamForm = ({migrateTeam, team, setShowForm}) => {
return <SpinnerField/>;
}

let noApplications = isEmpty(teamDetails.applications);
return (
<div className="migrate-teams-form-container">
<button className="back" onClick={() => {
Expand Down Expand Up @@ -84,7 +86,9 @@ export const MigrateTeamForm = ({migrateTeam, team, setShowForm}) => {
</tbody>
</table>
<div className={"actions"}>
<Button onClick={migrateTeam} txt={I18n.t("migrateTeam.migrate")}/>
{noApplications &&
<p className={"error"}>{I18n.t("migrateTeam.missingApplications")}</p>}
<Button onClick={migrateTeam} txt={I18n.t("migrateTeam.migrate")} disabled={noApplications}/>
</div>


Expand Down
9 changes: 8 additions & 1 deletion teams-gui/src/components/MigrateTeamForm.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ div.migrate-teams-form-container {
div.actions {
display: flex;
margin-bottom: 25px;
align-items: center;

p.error {
color: $primary-red;
font-weight: 600;
margin: 0;
}

a {
a, label {
margin: 0 25px 25px auto;
}
}
Expand Down
1 change: 1 addition & 0 deletions teams-gui/src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ I18n.translations.en = {
migrateTeam: {
header: "Migration",
info: "Review the applications and schacHome values of the persons and hit 'Migrate' to transfer this team to the invite application. The team will be deleted after an successful migration.",
missingApplications: "This team can not be migrated, as there are no applications linked.",
migrate: "Migrate",
success: "Team {{name}} has been migrated to the invite-database and has been deleted in teams.",
error: "An error occurred while migrating this team. {{error}}",
Expand Down
1 change: 1 addition & 0 deletions teams-gui/src/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ I18n.translations.nl = {
migrateTeam: {
header: "Migration",
info: "Review the applications and schacHome values of the persons and hit 'Migrate' to transfer this team to the invite application. The team will be deleted after an successful migration.",
missingApplications: "This team can not be migrated, as there are no applications linked.",
migrate: "Migrate",
success: "Team {{name}} has been migrated to the invite-database and has been deleted in teams.",
error: "An error occurred while migrating this team. {{error}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class MockShibbolethFilter extends GenericFilterBean {

private final boolean test;

// private final String userUrn = "urn:collab:person:surfnet.nl:super_admin";
private final String userUrn = "urn:collab:person:surfnet.nl:jdoe";
//"urn:collab:person:surfnet.nl:super_admin"

public MockShibbolethFilter(boolean test) {
this.test = test;
Expand Down

0 comments on commit c4be9a9

Please sign in to comment.