Extract shared types and add Regulation type with parsing methods
Move cookie banner types (CookieItem, Category, Regulation, BannerConfig, etc.) into a dedicated types.ts file. Add a coredata.Regulation type with parsing, JSON marshaling, and database scanning methods. Hardcode the geoloc-import data directory since the submodule path is fixed. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -57,6 +57,7 @@ export const cookieBannerConsentRecordPageQuery = graphql`
|
||||
ipAddress
|
||||
userAgent
|
||||
sdkVersion
|
||||
regulation
|
||||
consentData
|
||||
createdAt
|
||||
}
|
||||
@@ -152,6 +153,11 @@ export default function CookieBannerConsentRecordPage({
|
||||
<PropertyRow label={__("SDK Version")}>
|
||||
<span className="font-mono text-sm">{record.sdkVersion}</span>
|
||||
</PropertyRow>
|
||||
<PropertyRow label={__("Regulation")}>
|
||||
<span className="font-mono text-sm">
|
||||
{record.regulation || "-"}
|
||||
</span>
|
||||
</PropertyRow>
|
||||
<PropertyRow label={__("Date")}>
|
||||
<time dateTime={record.createdAt}>
|
||||
{formatDate(record.createdAt)}
|
||||
|
||||
@@ -216,6 +216,7 @@ export default function CookieBannerConsentRecordsPage({
|
||||
<Th>{__("Banner Version")}</Th>
|
||||
<Th>{__("IP Address")}</Th>
|
||||
<Th>{__("SDK Version")}</Th>
|
||||
<Th>{__("Regulation")}</Th>
|
||||
<SortableTh field="CREATED_AT">{__("Date")}</SortableTh>
|
||||
</Tr>
|
||||
</Thead>
|
||||
|
||||
@@ -35,6 +35,7 @@ const consentRecordFragment = graphql`
|
||||
}
|
||||
ipAddress
|
||||
sdkVersion
|
||||
regulation
|
||||
createdAt
|
||||
}
|
||||
`;
|
||||
@@ -74,6 +75,11 @@ export function ConsentRecordRow({ recordKey }: ConsentRecordRowProps) {
|
||||
<Td>
|
||||
<span className="font-mono text-sm">{record.sdkVersion}</span>
|
||||
</Td>
|
||||
<Td>
|
||||
<span className="font-mono text-sm">
|
||||
{record.regulation || "-"}
|
||||
</span>
|
||||
</Td>
|
||||
<Td>
|
||||
<time dateTime={record.createdAt}>
|
||||
{formatDate(record.createdAt)}
|
||||
|
||||
Reference in New Issue
Block a user