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

Improve copy client credentials switch #1023

Merged
merged 7 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions resources/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
"test": "Test",
"live": "Live",
"status_alert": "Approval from publiq is necessary for the live integration of this project. All information to smoothly go live can be found",
"link": "here",
"uitid_alert": "Client credentials have not yet been requested for this integration.",
"uitid_alert": "You can switch to authentication with client credentials. Check <0>here</0> whether this method of authentication is suitable for your application. Once you have requested client credentials, your API key remains valid for another 6 months.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the backend the 6 months (180 days) is configurable via config. Should this copy also depend on a config value in the frontend?

"uitid_alert_link": "https://docs.publiq.be/docs/authentication/methods/overview",
"action_status": "Request activation",
"action_uitid": "Request client credentials",
"info": "These credentials remain valid for another {{amount}} and will be permanently deleted on {{date}}"
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@
"test": "Test",
"live": "Live",
"in_progress": "Je aanvraag tot activatie is in behandeling.",
"link": "here",
"uitid_alert": "Voor deze integratie zijn nog geen Client credentials aangevraagd.",
"uitid_alert": "Je kan de overstap maken naar authenticatie met client credentials. Bekijk <0>hier</0> of deze manier van authenticatie geschikt is voor jouw applicatie. Eens je client credentials aangevraagd hebt, blijft je API key nog 6 maanden geldig.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

"uitid_alert_link": "https://docs.publiq.be/docs/authentication/methods/overview",
"action_uitid": "Client credentials aanvragen",
"client_id": "Client id",
"client_secret": "Client secret",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Heading } from "../../Heading";
import { useTranslation } from "react-i18next";
import { Trans, useTranslation } from "react-i18next";
import { StatusLight } from "../../StatusLight";
import { ButtonPrimary } from "../../ButtonPrimary";
import { CopyText } from "../../CopyText";
Expand All @@ -10,6 +10,7 @@ import type { Credentials } from "./Credentials";
import type { Integration } from "../../../types/Integration";
import { KeyVisibility } from "../../../types/KeyVisibility";
import { router } from "@inertiajs/react";
import { Link } from "../../Link";

type Props = Pick<
Integration,
Expand Down Expand Up @@ -63,7 +64,18 @@ export const CredentialsAuthClients = ({
</Heading>
{keyVisibility === KeyVisibility.v1 ? (
<div className="flex flex-col flex-1 gap-4">
<p>{t("details.credentials.uitid_alert")}</p>
<div>
<Trans
i18nKey="details.credentials.uitid_alert"
components={[
<Link
key={t("details.credentials.uitid_alert")}
vhande marked this conversation as resolved.
Show resolved Hide resolved
href={t("details.credentials.uitid_alert_link")}
className="text-publiq-blue-dark hover:underline mb-3"
/>,
]}
/>
</div>
<ButtonPrimary
className="self-start"
onClick={handleKeyVisibilityUpgrade}
Expand Down
4 changes: 2 additions & 2 deletions resources/ts/Components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export const Link = ({
<>
{isExternal ? (
<a
className={classNames("inline-flex gap-2 items-center", className)}
className={className}
href={href}
target="_blank"
rel="noreferrer"
{...props}
>
<span className="hover:underline">{children}</span>
{hasExternalIcon && (
<FontAwesomeIcon icon={faArrowUpRightFromSquare} />
<FontAwesomeIcon icon={faArrowUpRightFromSquare} className="mx-1" />
)}
</a>
) : (
Expand Down
Loading