Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(frontend): add joined at date to org select

Scott Wilson76cc43e5be02
diff --git a/backend/src/server/routes/v1/organization-router.ts b/backend/src/server/routes/v1/organization-router.ts
index a56fdcfed4..bfd0e92bc5 100644
--- a/backend/src/server/routes/v1/organization-router.ts
+++ b/backend/src/server/routes/v1/organization-router.ts
@@ -35,7 +35,8 @@ export const registerOrgRouter = async (server: FastifyZodProvider) => {
organizations: sanitizedOrganizationSchema
.extend({
orgAuthMethod: z.string(),
- userRole: z.string()
+ userRole: z.string(),
+ userJoinedAt: z.date()
})
.array()
})
diff --git a/backend/src/services/org/org-dal.ts b/backend/src/services/org/org-dal.ts
index c2565f36b6..53dfc33555 100644
--- a/backend/src/services/org/org-dal.ts
+++ b/backend/src/services/org/org-dal.ts
@@ -299,6 +299,7 @@ export const orgDALFactory = (db: TDbClient) => {
.select(selectAllTableCols(TableName.Organization))
.select(db.ref("role").withSchema(TableName.MembershipRole).as("userRole"))
.select(db.ref("status").withSchema(TableName.Membership).as("userStatus"))
+ .select(db.ref("createdAt").withSchema(TableName.Membership).as("userJoinedAt"))
.select(
db.raw(`
CASE
diff --git a/frontend/src/hooks/api/organization/types.ts b/frontend/src/hooks/api/organization/types.ts
index 45870176fc..c4c5615007 100644
--- a/frontend/src/hooks/api/organization/types.ts
+++ b/frontend/src/hooks/api/organization/types.ts
@@ -21,6 +21,7 @@ export type Organization = {
allowSecretSharingOutsideOrganization?: boolean;
userTokenExpiration?: string;
userRole: string;
+ userJoinedAt: string;
secretsProductEnabled: boolean;
pkiProductEnabled: boolean;
kmsProductEnabled: boolean;
diff --git a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
index 98633e390a..5561562196 100644
--- a/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
+++ b/frontend/src/pages/auth/SelectOrgPage/SelectOrgSection.tsx
@@ -5,7 +5,7 @@ import { faArrowRight } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { Link, useNavigate, useRouter } from "@tanstack/react-router";
import axios from "axios";
-import { addSeconds, formatISO } from "date-fns";
+import { addSeconds, format, formatISO } from "date-fns";
import { jwtDecode } from "jwt-decode";
import { Mfa } from "@app/components/auth/Mfa";
@@ -321,13 +321,18 @@ export const SelectOrganizationSection = () => {
<div
onClick={() => handleSelectOrganization(org)}
key={org.id}
- className="group flex cursor-pointer items-center justify-between rounded-md bg-mineshaft-700 px-4 py-3 text-gray-200 capitalize shadow-md transition-colors hover:bg-mineshaft-600"
+ className="group flex cursor-pointer items-center justify-between rounded-md border border-border bg-mineshaft-700 px-4 py-3 text-gray-200 capitalize shadow-md transition-colors hover:bg-mineshaft-600"
>
- <p className="truncate transition-colors">{org.name}</p>
+ <div className="flex flex-col items-start">
+ <p className="truncate transition-colors">{org.name}</p>
+ <p className="text-xs text-mineshaft-400">
+ Member since {format(new Date(org.userJoinedAt), "MMM d yyyy")}
+ </p>
+ </div>
<FontAwesomeIcon
icon={faArrowRight}
- className="text-gray-400 transition-all group-hover:translate-x-2 group-hover:text-primary-500"
+ className="text-gray-400 transition-all group-hover:translate-x-1 group-hover:text-primary-500"
/>
</div>
))