OrganizationsPage switch to MembershipCard and add membership session state

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-19 12:35:22 +01:00
committed by Bryan Frimin
parent ddf585fc18
commit 433c081d22
13 changed files with 422 additions and 88 deletions

View File

@@ -9,21 +9,21 @@ export function toDateInput(dateString?: string | null): string {
}
export function formatDate(dateInput?: string | null): string {
if (!dateInput) return '';
if (!dateInput) return "";
const date = parseDate(dateInput);
return date.toLocaleDateString();
}
function parseDate(dateString: string): Date {
if (dateString.includes('T')) {
export function parseDate(dateString: string): Date {
if (dateString.includes("T")) {
return new Date(dateString);
}
const parts = dateString.split('-');
const parts = dateString.split("-");
return new Date(
parseInt(parts[0], 10),
parts[1] ? parseInt(parts[1], 10) - 1 : 0,
parts[2] ? parseInt(parts[2], 10) : 1
parts[2] ? parseInt(parts[2], 10) : 1,
);
}

View File

@@ -1,16 +1,16 @@
export { objectKeys, objectEntries, cleanFormData } from "./object";
export { sprintf, faviconUrl, slugify, domain } from "./string";
export {
getTreatment,
getRiskImpacts,
getRiskLikelihoods,
getSeverity,
getTreatment,
getRiskImpacts,
getRiskLikelihoods,
getSeverity,
} from "./risk";
export {
withViewTransition,
downloadFile,
safeOpenUrl,
focusSiblingElement,
withViewTransition,
downloadFile,
safeOpenUrl,
focusSiblingElement,
} from "./dom";
export { times, groupBy, isEmpty } from "./array";
export { randomInt } from "./number";
@@ -18,39 +18,39 @@ export { getMeasureStateLabel, measureStates } from "./measure";
export { getRole, getRoles, peopleRoles } from "./people";
export { certificationCategoryLabel, certifications } from "./certifications";
export {
getCountryName,
getCountryOptions,
getCountryLabel,
countries,
type CountryCode,
getCountryName,
getCountryOptions,
getCountryLabel,
countries,
type CountryCode,
} from "./countries";
export {
getDocumentTypeLabel,
documentTypes,
getDocumentClassificationLabel,
documentClassifications,
getDocumentTypeLabel,
documentTypes,
getDocumentClassificationLabel,
documentClassifications,
} from "./documents";
export { getAssetTypeVariant } from "./assets";
export {
getSnapshotTypeLabel,
getSnapshotTypeUrlPath,
snapshotTypes,
validateSnapshotConsistency,
getSnapshotTypeLabel,
getSnapshotTypeUrlPath,
snapshotTypes,
validateSnapshotConsistency,
} from "./snapshots";
export {
getAuditStateLabel,
getAuditStateVariant,
auditStates,
getAuditStateLabel,
getAuditStateVariant,
auditStates,
} from "./audits";
export {
getStatusVariant,
getStatusLabel,
getStatusOptions,
getStatusVariant,
getStatusLabel,
getStatusOptions,
} from "./registryStatus";
export {
getObligationStatusVariant,
getObligationStatusLabel,
getObligationStatusOptions,
getObligationStatusVariant,
getObligationStatusLabel,
getObligationStatusOptions,
} from "./obligationStatus";
export {
getObligationTypeLabel,
@@ -65,24 +65,30 @@ export {
} from "./trustCenterVisibility";
export { promisifyMutation } from "./relay";
export { fileType, fileSize } from "./file";
export { formatDatetime, formatDate, toDateInput, formatDuration } from "./date";
export {
formatDatetime,
formatDate,
toDateInput,
formatDuration,
parseDate,
} from "./date";
export { getTrustCenterUrl } from "./trustCenter";
export { formatError, type GraphQLError } from "./error";
export { Role, getAssignableRoles } from "./roles";
export {
getTrustCenterDocumentAccessInfo,
getTrustCenterDocumentAccessStatusBadgeVariant,
getTrustCenterDocumentAccessStatusLabel,
type TrustCenterDocumentAccessInfo,
getTrustCenterDocumentAccessInfo,
getTrustCenterDocumentAccessStatusBadgeVariant,
getTrustCenterDocumentAccessStatusLabel,
type TrustCenterDocumentAccessInfo,
} from "./trustCenterDocumentAccess";
export {
getRightsRequestTypeLabel,
getRightsRequestTypeOptions,
getRightsRequestStateVariant,
getRightsRequestStateLabel,
getRightsRequestStateOptions,
rightsRequestTypes,
rightsRequestStates,
type RightsRequestType,
type RightsRequestState,
getRightsRequestTypeLabel,
getRightsRequestTypeOptions,
getRightsRequestStateVariant,
getRightsRequestStateLabel,
getRightsRequestStateOptions,
rightsRequestTypes,
rightsRequestStates,
type RightsRequestType,
type RightsRequestState,
} from "./rightsRequest";