Rename shared packages for portal
Move helpers, emails, and coredata exports to Compliance Portal names so frontend apps and workers share one vocabulary. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -18,11 +18,11 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
export const trustCenterDocumentAccessStatus = {
|
export const compliancePortalDocumentAccessStatus = {
|
||||||
REQUESTED: "REQUESTED",
|
REQUESTED: "REQUESTED",
|
||||||
GRANTED: "GRANTED",
|
GRANTED: "GRANTED",
|
||||||
REJECTED: "REJECTED",
|
REJECTED: "REJECTED",
|
||||||
REVOKED: "REVOKED",
|
REVOKED: "REVOKED",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type TrustCenterDocumentAccessStatus = (typeof trustCenterDocumentAccessStatus)[keyof typeof trustCenterDocumentAccessStatus];
|
export type CompliancePortalDocumentAccessStatus = (typeof compliancePortalDocumentAccessStatus)[keyof typeof compliancePortalDocumentAccessStatus];
|
||||||
@@ -19,5 +19,5 @@
|
|||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
TrustCenterDocumentAccessStatus,
|
CompliancePortalDocumentAccessStatus,
|
||||||
} from "./TrustCenterDocumentAccess";
|
} from "./CompliancePortalDocumentAccess";
|
||||||
|
|||||||
@@ -100,50 +100,50 @@ func NewPresenter(baseURL string, fullName string) *Presenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
subjectConfirmEmail = "Confirm your email address"
|
subjectConfirmEmail = "Confirm your email address"
|
||||||
subjectPasswordReset = "Reset your password"
|
subjectPasswordReset = "Reset your password"
|
||||||
subjectInvitation = "Invitation to join %s on Probo"
|
subjectInvitation = "Invitation to join %s on Probo"
|
||||||
subjectDocumentApproval = "Action Required – Please review and approve %s compliance documents"
|
subjectDocumentApproval = "Action Required – Please review and approve %s compliance documents"
|
||||||
subjectDocumentSigning = "Action Required – Please review and sign %s compliance documents"
|
subjectDocumentSigning = "Action Required – Please review and sign %s compliance documents"
|
||||||
subjectDocumentExport = "Your document export is ready"
|
subjectDocumentExport = "Your document export is ready"
|
||||||
subjectFrameworkExport = "Your framework export is ready"
|
subjectFrameworkExport = "Your framework export is ready"
|
||||||
subjectTrustCenterAccess = "Compliance Page Access Invitation - %s"
|
subjectCompliancePortalAccess = "Compliance Page Access Invitation - %s"
|
||||||
subjectTrustCenterDocumentAccessRejected = "Compliance Page Document Access Rejected - %s"
|
subjectCompliancePortalDocumentAccessRejected = "Compliance Page Document Access Rejected - %s"
|
||||||
subjectMagicLink = "Connect to %s"
|
subjectMagicLink = "Connect to %s"
|
||||||
subjectMailingListSubscription = "%s – Confirm Your Compliance Updates Subscription"
|
subjectMailingListSubscription = "%s – Confirm Your Compliance Updates Subscription"
|
||||||
subjectMailingListUnsubscription = "%s – You've been unsubscribed"
|
subjectMailingListUnsubscription = "%s – You've been unsubscribed"
|
||||||
subjectMailingListUpdates = "%s – %s"
|
subjectMailingListUpdates = "%s – %s"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
confirmEmailHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/confirm-email.html.tmpl"))
|
confirmEmailHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/confirm-email.html.tmpl"))
|
||||||
confirmEmailTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/confirm-email.txt.tmpl"))
|
confirmEmailTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/confirm-email.txt.tmpl"))
|
||||||
passwordResetHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/password-reset.html.tmpl"))
|
passwordResetHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/password-reset.html.tmpl"))
|
||||||
passwordResetTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/password-reset.txt.tmpl"))
|
passwordResetTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/password-reset.txt.tmpl"))
|
||||||
invitationHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/invitation.html.tmpl"))
|
invitationHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/invitation.html.tmpl"))
|
||||||
invitationTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/invitation.txt.tmpl"))
|
invitationTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/invitation.txt.tmpl"))
|
||||||
documentApprovalHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-approval.html.tmpl"))
|
documentApprovalHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-approval.html.tmpl"))
|
||||||
documentApprovalTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-approval.txt.tmpl"))
|
documentApprovalTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-approval.txt.tmpl"))
|
||||||
documentSigningHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-signing.html.tmpl"))
|
documentSigningHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-signing.html.tmpl"))
|
||||||
documentSigningTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-signing.txt.tmpl"))
|
documentSigningTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-signing.txt.tmpl"))
|
||||||
documentExportHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-export.html.tmpl"))
|
documentExportHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/document-export.html.tmpl"))
|
||||||
documentExportTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-export.txt.tmpl"))
|
documentExportTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/document-export.txt.tmpl"))
|
||||||
frameworkExportHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/framework-export.html.tmpl"))
|
frameworkExportHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/framework-export.html.tmpl"))
|
||||||
frameworkExportTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/framework-export.txt.tmpl"))
|
frameworkExportTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/framework-export.txt.tmpl"))
|
||||||
trustCenterAccessHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/trust-center-access.html.tmpl"))
|
compliancePortalAccessHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/compliance-portal-access.html.tmpl"))
|
||||||
trustCenterAccessTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/trust-center-access.txt.tmpl"))
|
compliancePortalAccessTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/compliance-portal-access.txt.tmpl"))
|
||||||
trustCenterDocumentAccessRejectedHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/trust-center-document-access-rejected.html.tmpl"))
|
compliancePortalDocumentAccessRejectedHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/compliance-portal-document-access-rejected.html.tmpl"))
|
||||||
trustCenterDocumentAccessRejectedTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/trust-center-document-access-rejected.txt.tmpl"))
|
compliancePortalDocumentAccessRejectedTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/compliance-portal-document-access-rejected.txt.tmpl"))
|
||||||
magicLinkHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/magic-link.html.tmpl"))
|
magicLinkHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/magic-link.html.tmpl"))
|
||||||
magicLinkTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/magic-link.txt.tmpl"))
|
magicLinkTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/magic-link.txt.tmpl"))
|
||||||
electronicSignatureCertificateHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/electronic-signature-certificate.html.tmpl"))
|
electronicSignatureCertificateHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/electronic-signature-certificate.html.tmpl"))
|
||||||
electronicSignatureCertificateTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/electronic-signature-certificate.txt.tmpl"))
|
electronicSignatureCertificateTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/electronic-signature-certificate.txt.tmpl"))
|
||||||
mailingListSubscriptionHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-subscription.html.tmpl"))
|
mailingListSubscriptionHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-subscription.html.tmpl"))
|
||||||
mailingListSubscriptionTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-subscription.txt.tmpl"))
|
mailingListSubscriptionTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-subscription.txt.tmpl"))
|
||||||
mailingListUnsubscriptionHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-unsubscription.html.tmpl"))
|
mailingListUnsubscriptionHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-unsubscription.html.tmpl"))
|
||||||
mailingListUnsubscriptionTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-unsubscription.txt.tmpl"))
|
mailingListUnsubscriptionTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-unsubscription.txt.tmpl"))
|
||||||
mailingListUpdatesHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-updates.html.tmpl"))
|
mailingListUpdatesHTMLTemplate = htmltemplate.Must(htmltemplate.ParseFS(Templates, "dist/mailing-list-updates.html.tmpl"))
|
||||||
mailingListUpdatesTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-updates.txt.tmpl"))
|
mailingListUpdatesTextTemplate = texttemplate.Must(texttemplate.ParseFS(Templates, "dist/mailing-list-updates.txt.tmpl"))
|
||||||
)
|
)
|
||||||
|
|
||||||
func (p *Presenter) getCommonVariables() (*CommonVariables, error) {
|
func (p *Presenter) getCommonVariables() (*CommonVariables, error) {
|
||||||
@@ -334,7 +334,7 @@ func (p *Presenter) RenderFrameworkExport(ctx context.Context, downloadUrl strin
|
|||||||
return subjectFrameworkExport, textBody, htmlBody, err
|
return subjectFrameworkExport, textBody, htmlBody, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Presenter) RenderTrustCenterAccess(ctx context.Context, organizationName string) (subject string, textBody string, htmlBody *string, err error) {
|
func (p *Presenter) RenderCompliancePortalAccess(ctx context.Context, organizationName string) (subject string, textBody string, htmlBody *string, err error) {
|
||||||
vars, err := p.getCommonVariables()
|
vars, err := p.getCommonVariables()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", nil, fmt.Errorf("cannot get common variables: %w", err)
|
return "", "", nil, fmt.Errorf("cannot get common variables: %w", err)
|
||||||
@@ -348,12 +348,12 @@ func (p *Presenter) RenderTrustCenterAccess(ctx context.Context, organizationNam
|
|||||||
OrganizationName: organizationName,
|
OrganizationName: organizationName,
|
||||||
}
|
}
|
||||||
|
|
||||||
textBody, htmlBody, err = renderEmail(trustCenterAccessTextTemplate, trustCenterAccessHTMLTemplate, data)
|
textBody, htmlBody, err = renderEmail(compliancePortalAccessTextTemplate, compliancePortalAccessHTMLTemplate, data)
|
||||||
|
|
||||||
return fmt.Sprintf(subjectTrustCenterAccess, organizationName), textBody, htmlBody, err
|
return fmt.Sprintf(subjectCompliancePortalAccess, organizationName), textBody, htmlBody, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Presenter) RenderTrustCenterDocumentAccessRejected(
|
func (p *Presenter) RenderCompliancePortalDocumentAccessRejected(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
fileNames []string,
|
fileNames []string,
|
||||||
organizationName string,
|
organizationName string,
|
||||||
@@ -373,9 +373,9 @@ func (p *Presenter) RenderTrustCenterDocumentAccessRejected(
|
|||||||
OrganizationName: organizationName,
|
OrganizationName: organizationName,
|
||||||
}
|
}
|
||||||
|
|
||||||
textBody, htmlBody, err = renderEmail(trustCenterDocumentAccessRejectedTextTemplate, trustCenterDocumentAccessRejectedHTMLTemplate, data)
|
textBody, htmlBody, err = renderEmail(compliancePortalDocumentAccessRejectedTextTemplate, compliancePortalDocumentAccessRejectedHTMLTemplate, data)
|
||||||
|
|
||||||
return fmt.Sprintf(subjectTrustCenterDocumentAccessRejected, organizationName), textBody, htmlBody, err
|
return fmt.Sprintf(subjectCompliancePortalDocumentAccessRejected, organizationName), textBody, htmlBody, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Presenter) RenderMagicLink(ctx context.Context, magicLinkUrlPath string, tokenString string, tokenDuration time.Duration, organizationName string) (subject string, textBody string, htmlBody *string, err error) {
|
func (p *Presenter) RenderMagicLink(ctx context.Context, magicLinkUrlPath string, tokenString string, tokenDuration time.Duration, organizationName string) (subject string, textBody string, htmlBody *string, err error) {
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ import DocumentSigning from "../src/DocumentSigning";
|
|||||||
import FrameworkExport from "../src/FrameworkExport";
|
import FrameworkExport from "../src/FrameworkExport";
|
||||||
import Invitation from "../src/Invitation";
|
import Invitation from "../src/Invitation";
|
||||||
import PasswordReset from "../src/PasswordReset";
|
import PasswordReset from "../src/PasswordReset";
|
||||||
import TrustCenterAccess from "../src/TrustCenterAccess";
|
import CompliancePortalAccess from "../src/CompliancePortalAccess";
|
||||||
import TrustCenterDocumentAccessRejected from "../src/TrustCenterDocumentAccessRejected";
|
import CompliancePortalDocumentAccessRejected from "../src/CompliancePortalDocumentAccessRejected";
|
||||||
import ElectronicSignatureCertificate from "../src/ElectronicSignatureCertificate";
|
import ElectronicSignatureCertificate from "../src/ElectronicSignatureCertificate";
|
||||||
import MailingListSubscription from "../src/MailingListSubscription";
|
import MailingListSubscription from "../src/MailingListSubscription";
|
||||||
import MailingListUnsubscription from "../src/MailingListUnsubscription";
|
import MailingListUnsubscription from "../src/MailingListUnsubscription";
|
||||||
@@ -77,12 +77,12 @@ const templates: TemplateConfig[] = [
|
|||||||
render: () => FrameworkExport(),
|
render: () => FrameworkExport(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "trust-center-access",
|
name: "compliance-portal-access",
|
||||||
render: () => TrustCenterAccess(),
|
render: () => CompliancePortalAccess(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "trust-center-document-access-rejected",
|
name: "compliance-portal-document-access-rejected",
|
||||||
render: () => TrustCenterDocumentAccessRejected(),
|
render: () => CompliancePortalDocumentAccessRejected(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "magic-link",
|
name: "magic-link",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import EmailLayout, {
|
|||||||
buttonContainer,
|
buttonContainer,
|
||||||
} from "./components/EmailLayout";
|
} from "./components/EmailLayout";
|
||||||
|
|
||||||
export const TrustCenterAccess = () => {
|
export const CompliancePortalAccess = () => {
|
||||||
return (
|
return (
|
||||||
<EmailLayout
|
<EmailLayout
|
||||||
subject={`Compliance Page Access Invitation - ${"{{.OrganizationName}}"}`}
|
subject={`Compliance Page Access Invitation - ${"{{.OrganizationName}}"}`}
|
||||||
@@ -46,4 +46,4 @@ export const TrustCenterAccess = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TrustCenterAccess;
|
export default CompliancePortalAccess;
|
||||||
@@ -22,7 +22,7 @@ import { Text } from 'react-email';
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import EmailLayout, { bodyText } from './components/EmailLayout';
|
import EmailLayout, { bodyText } from './components/EmailLayout';
|
||||||
|
|
||||||
export const TrustCenterDocumentAccessRejected = () => {
|
export const CompliancePortalDocumentAccessRejected = () => {
|
||||||
return (
|
return (
|
||||||
<EmailLayout subject={`Compliance Page Document Access Rejected - ${'{{.OrganizationName}}'}`}>
|
<EmailLayout subject={`Compliance Page Document Access Rejected - ${'{{.OrganizationName}}'}`}>
|
||||||
<Text style={bodyText}>
|
<Text style={bodyText}>
|
||||||
@@ -38,4 +38,4 @@ export const TrustCenterDocumentAccessRejected = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TrustCenterDocumentAccessRejected;
|
export default CompliancePortalDocumentAccessRejected;
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
import type { TrustCenterDocumentAccessStatus } from "@probo/coredata";
|
import type { CompliancePortalDocumentAccessStatus } from "@probo/coredata";
|
||||||
|
|
||||||
export function getTrustCenterDocumentAccessStatusBadgeVariant(status: TrustCenterDocumentAccessStatus) {
|
export function getCompliancePortalDocumentAccessStatusBadgeVariant(status: CompliancePortalDocumentAccessStatus) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case "REQUESTED":
|
case "REQUESTED":
|
||||||
return "warning" as const;
|
return "warning" as const;
|
||||||
@@ -32,7 +32,7 @@ export function getTrustCenterDocumentAccessStatusBadgeVariant(status: TrustCent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTrustCenterDocumentAccessStatusLabel(status: TrustCenterDocumentAccessStatus, __: (key: string) => string) {
|
export function getCompliancePortalDocumentAccessStatusLabel(status: CompliancePortalDocumentAccessStatus, __: (key: string) => string) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case "REQUESTED":
|
case "REQUESTED":
|
||||||
return __("requested");
|
return __("requested");
|
||||||
@@ -45,7 +45,7 @@ export function getTrustCenterDocumentAccessStatusLabel(status: TrustCenterDocum
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ITrustCenterDocumentAccessInfo {
|
interface ICompliancePortalDocumentAccessInfo {
|
||||||
variant: string;
|
variant: string;
|
||||||
type: string;
|
type: string;
|
||||||
persisted: boolean;
|
persisted: boolean;
|
||||||
@@ -53,10 +53,10 @@ interface ITrustCenterDocumentAccessInfo {
|
|||||||
typeLabel: string,
|
typeLabel: string,
|
||||||
category: string;
|
category: string;
|
||||||
id: string;
|
id: string;
|
||||||
status: TrustCenterDocumentAccessStatus;
|
status: CompliancePortalDocumentAccessStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TrustCenterDocumentAccessInfo = ITrustCenterDocumentAccessInfo & (
|
export type CompliancePortalDocumentAccessInfo = ICompliancePortalDocumentAccessInfo & (
|
||||||
{
|
{
|
||||||
variant: "info",
|
variant: "info",
|
||||||
type: "document",
|
type: "document",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
export function getTrustCenterUrl(path: string): string {
|
export function getCompliancePortalUrl(path: string): string {
|
||||||
const currentPath = window.location.pathname;
|
const currentPath = window.location.pathname;
|
||||||
const trustMatch = currentPath.match(/^\/trust\/([^/]+)/);
|
const trustMatch = currentPath.match(/^\/trust\/([^/]+)/);
|
||||||
|
|
||||||
@@ -20,15 +20,15 @@
|
|||||||
|
|
||||||
type Translator = (s: string) => string;
|
type Translator = (s: string) => string;
|
||||||
|
|
||||||
export type TrustCenterVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
export type CompliancePortalVisibility = "NONE" | "PRIVATE" | "PUBLIC";
|
||||||
|
|
||||||
export const trustCenterVisibilities = [
|
export const compliancePortalVisibilities = [
|
||||||
"NONE",
|
"NONE",
|
||||||
"PRIVATE",
|
"PRIVATE",
|
||||||
"PUBLIC",
|
"PUBLIC",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const getTrustCenterVisibilityVariant = (visibility: TrustCenterVisibility) => {
|
export const getCompliancePortalVisibilityVariant = (visibility: CompliancePortalVisibility) => {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case "NONE":
|
case "NONE":
|
||||||
return "danger" as const;
|
return "danger" as const;
|
||||||
@@ -41,7 +41,7 @@ export const getTrustCenterVisibilityVariant = (visibility: TrustCenterVisibilit
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getTrustCenterVisibilityLabel = (visibility: TrustCenterVisibility) => {
|
export const getCompliancePortalVisibilityLabel = (visibility: CompliancePortalVisibility) => {
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case "NONE":
|
case "NONE":
|
||||||
return "None";
|
return "None";
|
||||||
@@ -54,14 +54,14 @@ export const getTrustCenterVisibilityLabel = (visibility: TrustCenterVisibility)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getTrustCenterVisibilityOptions(__: Translator) {
|
export function getCompliancePortalVisibilityOptions(__: Translator) {
|
||||||
return trustCenterVisibilities.map((visibility) => ({
|
return compliancePortalVisibilities.map((visibility) => ({
|
||||||
value: visibility,
|
value: visibility,
|
||||||
label: __({
|
label: __({
|
||||||
"NONE": "None",
|
"NONE": "None",
|
||||||
"PRIVATE": "Private",
|
"PRIVATE": "Private",
|
||||||
"PUBLIC": "Public",
|
"PUBLIC": "Public",
|
||||||
}[visibility]),
|
}[visibility]),
|
||||||
variant: getTrustCenterVisibilityVariant(visibility),
|
variant: getCompliancePortalVisibilityVariant(visibility),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -83,17 +83,17 @@ export {
|
|||||||
getObligationTypeOptions,
|
getObligationTypeOptions,
|
||||||
} from "./obligationType";
|
} from "./obligationType";
|
||||||
export {
|
export {
|
||||||
getTrustCenterVisibilityVariant,
|
getCompliancePortalVisibilityVariant,
|
||||||
getTrustCenterVisibilityLabel,
|
getCompliancePortalVisibilityLabel,
|
||||||
getTrustCenterVisibilityOptions,
|
getCompliancePortalVisibilityOptions,
|
||||||
getTrustCenterVisibilityVariant as getCompliancePageVisibilityVariant,
|
getCompliancePortalVisibilityVariant as getCompliancePageVisibilityVariant,
|
||||||
getTrustCenterVisibilityLabel as getCompliancePageVisibilityLabel,
|
getCompliancePortalVisibilityLabel as getCompliancePageVisibilityLabel,
|
||||||
getTrustCenterVisibilityOptions as getCompliancePageVisibilityOptions,
|
getCompliancePortalVisibilityOptions as getCompliancePageVisibilityOptions,
|
||||||
trustCenterVisibilities,
|
compliancePortalVisibilities,
|
||||||
trustCenterVisibilities as compliancePageVisibilities,
|
compliancePortalVisibilities as compliancePageVisibilities,
|
||||||
type TrustCenterVisibility,
|
type CompliancePortalVisibility,
|
||||||
type TrustCenterVisibility as CompliancePageVisibility,
|
type CompliancePortalVisibility as CompliancePageVisibility,
|
||||||
} from "./trustCenterVisibility";
|
} from "./compliancePortalVisibility";
|
||||||
export { promisifyMutation } from "./relay";
|
export { promisifyMutation } from "./relay";
|
||||||
export { fileType, fileSize } from "./file";
|
export { fileType, fileSize } from "./file";
|
||||||
export {
|
export {
|
||||||
@@ -121,18 +121,18 @@ export {
|
|||||||
fromMaxAgeSeconds,
|
fromMaxAgeSeconds,
|
||||||
} from "./duration";
|
} from "./duration";
|
||||||
export { getTrackerTypeBadge, getTrackerSourceBadge } from "./tracker";
|
export { getTrackerTypeBadge, getTrackerSourceBadge } from "./tracker";
|
||||||
export { getTrustCenterUrl } from "./trustCenter";
|
export { getCompliancePortalUrl } from "./compliancePortalUrl";
|
||||||
export { detectSocialName } from "./socialUrl";
|
export { detectSocialName } from "./socialUrl";
|
||||||
export { formatError, type GraphQLError } from "./error";
|
export { formatError, type GraphQLError } from "./error";
|
||||||
export { Role, roles, getAssignableRoles } from "./roles";
|
export { Role, roles, getAssignableRoles } from "./roles";
|
||||||
export {
|
export {
|
||||||
getTrustCenterDocumentAccessStatusBadgeVariant,
|
getCompliancePortalDocumentAccessStatusBadgeVariant,
|
||||||
getTrustCenterDocumentAccessStatusLabel,
|
getCompliancePortalDocumentAccessStatusLabel,
|
||||||
getTrustCenterDocumentAccessStatusBadgeVariant as getCompliancePageDocumentAccessStatusBadgeVariant,
|
getCompliancePortalDocumentAccessStatusBadgeVariant as getCompliancePageDocumentAccessStatusBadgeVariant,
|
||||||
getTrustCenterDocumentAccessStatusLabel as getCompliancePageDocumentAccessStatusLabel,
|
getCompliancePortalDocumentAccessStatusLabel as getCompliancePageDocumentAccessStatusLabel,
|
||||||
type TrustCenterDocumentAccessInfo,
|
type CompliancePortalDocumentAccessInfo,
|
||||||
type TrustCenterDocumentAccessInfo as CompliancePageDocumentAccessInfo,
|
type CompliancePortalDocumentAccessInfo as CompliancePageDocumentAccessInfo,
|
||||||
} from "./trustCenterDocumentAccess";
|
} from "./compliancePortalDocumentAccess";
|
||||||
export {
|
export {
|
||||||
getRightsRequestTypeLabel,
|
getRightsRequestTypeLabel,
|
||||||
getRightsRequestTypeOptions,
|
getRightsRequestTypeOptions,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ type Story = StoryObj<typeof Link>;
|
|||||||
|
|
||||||
export const Playground: Story = {};
|
export const Playground: Story = {};
|
||||||
|
|
||||||
// Mirrors the Trust Center top-bar nav: ghost links with a persistent active
|
// Mirrors the Compliance Portal top-bar nav: ghost links with a persistent active
|
||||||
// pill on the selected item.
|
// pill on the selected item.
|
||||||
export const Nav: Story = {
|
export const Nav: Story = {
|
||||||
render: () => (
|
render: () => (
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { ErrorState } from "./ErrorState";
|
|||||||
|
|
||||||
const actions = (
|
const actions = (
|
||||||
<>
|
<>
|
||||||
<Button size={2} color="neutral" highContrast>Back to trust center</Button>
|
<Button size={2} color="neutral" highContrast>Back to compliance portal</Button>
|
||||||
<Button size={2} variant="soft" color="neutral">Contact support</Button>
|
<Button size={2} variant="soft" color="neutral">Contact support</Button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user