Skip to content

Commit

Permalink
feat #728: Change validUntil in front to number and remove the badge …
Browse files Browse the repository at this point in the history
…of validationDate
  • Loading branch information
helakaraa committed Sep 16, 2024
1 parent c48de17 commit ec6d195
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interface IApiSubscriptionGql extends ISubscriptionCustomization {
type: string;
};
createdAt: string;
validUntil: string;
validUntil: number;
api: {
_id: string;
};
Expand All @@ -77,7 +77,7 @@ interface IApiSubscriptionGql extends ISubscriptionCustomization {
_id: string;
adminCustomName: string;
enabled: boolean;
validUntil: string;
validUntil: number;
api: {
_id: string;
name: string;
Expand Down Expand Up @@ -224,10 +224,6 @@ export const TeamApiSubscriptions = ({
sortingFn: "basic",
cell: (info) => {
const sub = info.row.original;
let titleDate = `<div>
<strong>${translate("validationDate.apikey.badge.title")}</strong> :
${sub.validUntil ? formatDate(sub.validUntil, language) : "N/A"}
</div>`;
if (sub.parent) {
const title = `<div>
<strong>${translate("aggregated.apikey.badge.title")}</strong>
Expand All @@ -237,33 +233,18 @@ export const TeamApiSubscriptions = ({
<li>${translate("aggregated.apikey.badge.apikey.name")}: ${sub.parent.adminCustomName}</li>
</ul>
</div>`;
titleDate = `<div>
<strong>${translate("validationDate.apikey.badge.title")}</strong> :
${sub.parent.validUntil ? formatDate(sub.parent.validUntil, language) : "N/A"}
</div>`;
return (
<div className="d-flex flex-row justify-content-between">
<span>{info.getValue()}</span>
<div>
<BeautifulTitle title={titleDate} html>
<div className="badge badge-custom me-1">V</div>
</BeautifulTitle>

<BeautifulTitle title={title} html>
<div className="badge badge-custom">A</div>
</BeautifulTitle>
</div>
</div>
);
}

return (
<div className="d-flex flex-row justify-content-between">
<span>{info.getValue()}</span>
<BeautifulTitle title={titleDate} html>
<div className="badge badge-custom">V</div>
</BeautifulTitle>
</div>
);
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type CustomSubscriptionData = {
customMaxPerMonth: number;
customReadOnly: boolean;
adminCustomName: string;
validUntil: Date;
validUntil: number;
};

export const SubscriptionMetadataModal = <T extends IWithTesting>(
Expand Down Expand Up @@ -66,7 +66,7 @@ export const SubscriptionMetadataModal = <T extends IWithTesting>(
customMaxPerMonth: formData.customQuotas.customMaxPerMonth,
customReadOnly: formData.customReadOnly,
adminCustomName: formData.adminCustomName,
validUntil: formData.validUntil,
validUntil: Date.parse(formData.validUntil),
};

const res = props.save(subProps);
Expand Down
1 change: 0 additions & 1 deletion daikoku/javascript/src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,6 @@
"aggregated.apikey.badge.apikey.name": "API key custom name",
"apisubscription.lastUsage.label": "Last usage",
"N/A": "N/A",
"validationDate.apikey.badge.title": "Valid Until",
"semver.error.message": "Can't create a version with special characters : %s",
"version.creation.success.message": "New version of API created successfully",
"error.message.creation.security.enabled": "You're not authorized to create an API, please contact your administrator.",
Expand Down
1 change: 0 additions & 1 deletion daikoku/javascript/src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,6 @@
"aggregated.apikey.badge.apikey.name": "Nom personnalisée de la clé",
"apisubscription.lastUsage.label": "Dernier usage",
"N/A": "N/A",
"validationDate.apikey.badge.title": "Date de validation",
"semver.error.message": "Une version ne peut pas être créée avec des caractères spéciaux : %s",
"version.creation.success.message": "La nouvelle version de l'API a été créée avec succès",
"error.message.creation.security.enabled": "Vous n'êtes pas autorisé à créer d'API, merci de contacter votre administrateur.",
Expand Down

0 comments on commit ec6d195

Please sign in to comment.