Skip to content

Commit

Permalink
Merge pull request #8 from TeskaLabs/feature/implement-registration-i…
Browse files Browse the repository at this point in the history
…nvitation

Feature/implement registration and invitation
  • Loading branch information
Pe5h4 authored Jan 25, 2023
2 parents d390a8c + aca217a commit d0a33cc
Show file tree
Hide file tree
Showing 30 changed files with 276 additions and 128 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@

## Release Candidate

## v23.4

### Compatibility

- [x] **SeaCat Auth UI `v23.4` or newer**
- [x] **SeaCat Auth `v23.3` or newer**

⚠️ Due to implementation of new features, invitation will not work with SeaCat Auth service versions older than `v23.3`

### Features

- ASAB WebUI submodule version bump [[0b97139](https://github.com/TeskaLabs/asab-webui/commit/0b97139df1c2dc0e4e82dd97fd5593334efc5d38)] commit (INDIGO Sprint 230106, [!13](https://github.com/TeskaLabs/seacat-admin-webui/pull/13))
- ASAB WebUI submodule version bump [[25d5a5c](https://github.com/TeskaLabs/asab-webui/commit/25d5a5ce97c6f2286525127cc3a31531b03312f3)] commit (INDIGO Sprint 230106, [!8](https://github.com/TeskaLabs/seacat-admin-webui/pull/8))

- Create invitation components (INDIGO Sprint 230106, [!8](https://github.com/TeskaLabs/seacat-admin-webui/pull/8))

### Refactoring

- Add new input `preferred_client_id` to ClientCreateContainer (INDIGO Sprint 221209, [!7](https://github.com/TeskaLabs/seacat-admin-webui/pull/7))

- Replace `phone_number` with `phone` and `preferred_username` with `username` (INDIGO Sprint 221209, [!10](https://github.com/TeskaLabs/seacat-admin-webui/pull/10))

- Update alert responses with full message from the service and prolong the time of the error message to 30s (INDIGO Sprint 230106, [!8](https://github.com/TeskaLabs/seacat-admin-webui/pull/8))

- Refactorization of CustomDataContainer to prevent passing invalid format of `uri` prop. Added documentation. (INDIGO Sprint 221209, [!11](https://github.com/TeskaLabs/seacat-admin-webui/pull/11))

## v22.48
Expand Down
2 changes: 1 addition & 1 deletion asab-webui
23 changes: 15 additions & 8 deletions public/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@
"Create credentials": "Vytvořit údaje",
"Credentials have been created successfully": "Údaje byly úspěšně vytvořeny",
"Something went wrong, failed to create credentials": "Něco je špatně, údaje nebyly vytvořeny",
"Something went wrong, failed to fetch providers": "Něco je špatně, získání providerů selhalo"
"Something went wrong, failed to fetch providers": "Něco je špatně, získání providerů selhalo",
"Create": "Vytvořit",
"Invite": "Pozvat",
"Invite user": "Pozvat uživatele",
"Invitation sent successfully": "Pozvánka úspěšně odeslána",
"Something went wrong, failed to send invitation": "Něco je špatně, pozvánka nebyla odeslána"
},
"CredentialsDetailContainer": {
"Credentials": "Uživatelské údaje",
Expand Down Expand Up @@ -177,7 +182,11 @@
"Phone number already in use": "Telefonní číslo je již použito",
"Email address already in use": "Emailová adresa je již použita",
"Something went wrong, failed to fetch provider data": "Něco je špatně, nepodařilo se získat data provideru",
"Information editing is not allowed within this credentials": "V rámci těchto uživatelských údajů není povolena úprava informací"
"Information editing is not allowed within this credentials": "V rámci těchto uživatelských údajů není povolena úprava informací",
"Invited": "Pozván",
"Resend invitation": "Přeposlat pozvánku",
"Something went wrong, failed to resend invitation": "Něco je špatně, pozvánka nebyla odeslána",
"Invitation sent successfully": "Pozvánka úspěšně odeslána"
},
"CredentialsRolesCard": {
"Assigned roles": "Přiřazené role",
Expand All @@ -200,7 +209,6 @@
},
"CredentialsSessionCard": {
"Sessions": "Relace",
"User sessions": "Relace uživatele",
"No active sessions": "Žádné aktivní relace",
"Terminate user sessions": "Ukončit relace uživatele",
"Terminate sessions": "Ukončit relace",
Expand All @@ -220,7 +228,8 @@
"Tenants": "Tenanti",
"Roles": "Role",
"Something went wrong, failed to fetch data": "Něco je špatně, nepodařilo se získat data",
"Can't fetch the data, you don't have rights to display it": "Nepodařilo se získat data, nemáte dostatečná oprávnění k jejich zobrazení"
"Can't fetch the data, you don't have rights to display it": "Nepodařilo se získat data, nemáte dostatečná oprávnění k jejich zobrazení",
"Credentials invited": "Uživatel pozván"
},
"FormFields": {
"Phone": "Telefon",
Expand Down Expand Up @@ -347,7 +356,7 @@
},
"SessionListContainer": {
"Credentials": "Uživ. Identifikace",
"Failed to fetch the object": "Nepodařilo se načíst objekt.",
"Failed to fetch the object": "Nepodařilo se načíst objekt",
"Sessions": "Relace",
"Expected expiration": "Očekávané vypršení platnosti",
"Terminate session": "Ukončit relaci",
Expand All @@ -365,7 +374,6 @@
"Session": "Relace"
},
"SessionDetailContainer": {
"Something went wrong when fetching details": "Něco se pokazilo při načítání detailu relace",
"Failed to fetch details": "Nepodařilo se načíst relace",
"Do you want to terminate this session?": "Opravdu chcete ukončit tuto relaci?",
"Session successfully terminated": "Relace úspěšně ukončena",
Expand Down Expand Up @@ -411,8 +419,7 @@
"Something went wrong, failed to fetch tenant detail": "Něco je špatně, nepodařilo se získat detail tenanta",
"Assigned credentials": "Přiřazené uživatelské údaje",
"Assign credentials": "Přiřadit uživatelské údaje",
"Something went wrong, failed to fetch assigned credentials": "Něco je špatně, nepodařilo se získat přiřazené uživatelské údaje",
"Something went wrong, failed to update credentials": "Něco je špatně, nepodařilo se upravit uživatelské údaje",
"Something went wrong, failed to fetch assigned credentials": "Něco je špatně, nepodařilo se načíst přiřazené uživatelské údaje",
"Something went wrong, the credentials cannot be assigned": "Něco je špatně, nepodařilo se přiřadit uživatele",
"Something went wrong, the credentials cannot be unassigned": "Něco je špatně, nepodařilo se odebrat uživatele",
"Something went wrong, failed to fetch data": "Něco je špatně, nepodařilo se získat data",
Expand Down
20 changes: 14 additions & 6 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@
"Create credentials": "Create credentials",
"Credentials have been created successfully": "Credentials have been created successfully",
"Something went wrong, failed to create credentials": "Something went wrong, failed to create credentials",
"Something went wrong, failed to fetch providers": "Something went wrong, failed to fetch providers"
"Something went wrong, failed to fetch providers": "Something went wrong, failed to fetch providers",
"Create": "Create",
"Invite": "Invite",
"Invite user": "Invite user",
"Invitation sent successfully": "Invitation sent successfully",
"Something went wrong, failed to send invitation": "Something went wrong, failed to send invitation"
},
"CredentialsDetailContainer": {
"Credentials": "Credentials",
Expand Down Expand Up @@ -177,7 +182,11 @@
"Phone number already in use": "Phone number already in use",
"Email address already in use": "Email address already in use",
"Something went wrong, failed to fetch provider data": "Something went wrong, failed to fetch provider data",
"Information editing is not allowed within this credentials": "Information editing is not allowed within this credentials"
"Information editing is not allowed within this credentials": "Information editing is not allowed within this credentials",
"Invited": "Invited",
"Resend invitation": "Resend invitation",
"Something went wrong, failed to resend invitation": "Something went wrong, failed to resend invitation",
"Invitation sent successfully": "Invitation sent successfully"
},
"CredentialsRolesCard": {
"Assigned roles": "Assigned roles",
Expand Down Expand Up @@ -219,7 +228,8 @@
"Tenants": "Tenants",
"Roles": "Roles",
"Something went wrong, failed to fetch data": "Something went wrong, failed to fetch data",
"Can't fetch the data, you don't have rights to display it": "Can't fetch the data, you don't have rights to display it"
"Can't fetch the data, you don't have rights to display it": "Can't fetch the data, you don't have rights to display it",
"Credentials invited": "Credentials invited"
},
"FormFields": {
"Phone": "Phone",
Expand Down Expand Up @@ -346,7 +356,7 @@
},
"SessionListContainer": {
"Credentials": "Credentials",
"Failed to fetch the object": "Failed to fetch the object.",
"Failed to fetch the object": "Failed to fetch the object",
"Sessions": "Sessions",
"Expected expiration": "Expected expiration",
"Terminate session": "Terminate session",
Expand All @@ -364,7 +374,6 @@
"Session": "Session"
},
"SessionDetailContainer": {
"Something went wrong when fetching details": "Something went wrong when fetching details",
"Failed to fetch details": "Failed to fetch details",
"Do you want to terminate this session?": "Do you want to terminate this session?",
"Session successfully terminated": "Session successfully terminated",
Expand Down Expand Up @@ -411,7 +420,6 @@
"Assigned credentials": "Assigned credentials",
"Assign credentials": "Assign credentials",
"Something went wrong, failed to fetch assigned credentials": "Something went wrong, failed to fetch assigned credentials",
"Something went wrong, failed to update credentials": "Something went wrong, failed to update credentials",
"Something went wrong, the credentials cannot be assigned": "Something went wrong, the credentials cannot be assigned",
"Something went wrong, the credentials cannot be unassigned": "Something went wrong, the credentials cannot be unassigned",
"Something went wrong, failed to fetch data": "Something went wrong, failed to fetch data",
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let ConfigDefaults = {
fallbackLng: 'en',
supportedLngs: ['en', 'cs'],
debug: false,
nsSeparator: false
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/modules/auth/clients/ClientCreateContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const ClientCreateContainer = (props) => {
setTemplate(response.data["templates"]);
} catch (e) {
console.error("Failed to retrieve providers from server: ", e);
props.app.addAlert("warning", t("ClientCreateContainer|Something went wrong, failed to fetch clients"));
props.app.addAlert("warning", `${t("ClientCreateContainer|Something went wrong, failed to fetch clients")}. ${e?.response?.data?.message}`, 30);
}
};

Expand Down Expand Up @@ -124,7 +124,7 @@ const ClientCreateContainer = (props) => {

} catch (e) {
console.error(e);
props.app.addAlert("warning", t("ClientCreateContainer|Something went wrong, client has not been created"));
props.app.addAlert("warning", `${t("ClientCreateContainer|Something went wrong, client has not been created")}. ${e?.response?.data?.message}`, 30);
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/modules/auth/clients/ClientDetailContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ClientDetailContainer = (props) => {
setClient(response.data);
} catch (e) {
console.error(e);
props.app.addAlert("warning", t("ClientDetailContainer|Something went wrong, failed to fetch client details"));
props.app.addAlert("warning", `${t("ClientDetailContainer|Something went wrong, failed to fetch client details")}. ${e?.response?.data?.message}`, 30);
}
}

Expand All @@ -78,7 +78,7 @@ const ClientDetailContainer = (props) => {
getClientDetail();
} catch (e) {
console.error(e);
props.app.addAlert("warning", t('ClientDetailContainer|Something went wrong, failed to reset secret'));
props.app.addAlert("warning", `${t("ClientDetailContainer|Something went wrong, failed to reset secret")}. ${e?.response?.data?.message}`, 30);
}
}

Expand Down Expand Up @@ -128,7 +128,7 @@ const ClientDetailContainer = (props) => {
setDisabled(false);
setEditMode(true);
console.error(e);
props.app.addAlert("warning", t("ClientDetailContainer|Something went wrong, failed to update client"));
props.app.addAlert("warning", `${t("ClientDetailContainer|Something went wrong, failed to update client")}. ${e?.response?.data?.message}`, 30);
}
}

Expand All @@ -152,7 +152,7 @@ const ClientDetailContainer = (props) => {
props.history.push("/auth/clients"); // Redirect to the Client list page
} catch(e) {
console.error(e); // log the error to the browser's console
props.app.addAlert("warning", t('ClientDetailContainer|Something went wrong, failed to remove client'));
props.app.addAlert("warning", `${t("ClientDetailContainer|Something went wrong, failed to remove client")}. ${e?.response?.data?.message}`, 30);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth/clients/ClientListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function ClientListContainer(props) {
} catch (e) {
console.error(e);
setLoading(false);
props.app.addAlert("warning", t("ClientListContainer|Failed to fetch clients"));
props.app.addAlert("warning", `${t("ClientListContainer|Failed to fetch clients")}. ${e?.response?.data?.message}`, 30);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth/components/CustomDataContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function CustomDataContainer({app, resources, customData, setCustomData,
setEdit(false);
app.addAlert("success", t("CustomDataContainer|Data updated successfully"));
} catch (e) {
app.addAlert("warning", t("CustomDataContainer|Something went wrong, failed to update data"));
app.addAlert("warning", `${t("CustomDataContainer|Something went wrong, failed to update data")}. ${e?.response?.data?.message}`, 30);
console.error(e);
}
}
Expand Down
Loading

0 comments on commit d0a33cc

Please sign in to comment.