Skip to content

Commit

Permalink
Remove ophan status as nothing async happens (#320)
Browse files Browse the repository at this point in the history
* remove ophan status and nothing async happens

* remove ophan from launch wizard
  • Loading branch information
phillipbarron authored Jun 16, 2024
1 parent 2341b8e commit f6f3c77
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 146 deletions.
3 changes: 0 additions & 3 deletions apps/newsletters-ui/src/app/components/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ export const formatStatusCell = ({
}: Cell<string>) => {
const {
brazeCampaignCreationStatus,
ophanCampaignCreationStatus,
signupPageCreationStatus,
tagCreationStatus,
} = original;

const statuses = `Braze status: ${formatStatus(
brazeCampaignCreationStatus,
)}, Ophan status: ${formatStatus(
ophanCampaignCreationStatus,
)}, Signup page status: ${formatStatus(
signupPageCreationStatus,
)}, Tag status: ${formatStatus(tagCreationStatus)}`;
Expand Down
1 change: 0 additions & 1 deletion libs/email-builder/src/fixtures/sample-newsletters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { NewsletterData } from '@newsletters-nx/newsletters-data-client';

export const ART_WEEKLY_FIXTURE: Readonly<NewsletterData> = {
brazeCampaignCreationStatus: 'COMPLETED',
ophanCampaignCreationStatus: 'COMPLETED',
signupPageCreationStatus: 'COMPLETED',
tagCreationStatus: 'COMPLETED',
identityName: 'art-weekly',
Expand Down
6 changes: 2 additions & 4 deletions libs/newsletter-workflow/src/lib/executeCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import type { AsyncExecution } from '@newsletters-nx/state-machine';

const defaultDraftNewsletterValues: DraftNewsletterData = {
brazeCampaignCreationStatus: 'NOT_REQUESTED',
ophanCampaignCreationStatus: 'NOT_REQUESTED',
tagCreationStatus: 'NOT_REQUESTED',
signupPageCreationStatus: 'NOT_REQUESTED',
} as const;
Expand Down Expand Up @@ -48,9 +47,8 @@ export const executeCreate: AsyncExecution<DraftService> = async (
if (!parseResult.success) {
return {
isFailure: true,
message: `Form data is invalid for schema: ${
schema.description ?? '[no description]'
}`,
message: `Form data is invalid for schema: ${schema.description ?? '[no description]'
}`,
details: { zodIssues: parseResult.error.issues },
};
}
Expand Down
2 changes: 0 additions & 2 deletions libs/newsletter-workflow/src/lib/executeLaunch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const sendOutEmailsAndUpdateStatus = async (
);

const [
launchEmailResult,
brazeRequestEmailResult,
tagAndSignUpPageCreationEmailResult,
] = await Promise.all([
Expand All @@ -64,7 +63,6 @@ const sendOutEmailsAndUpdateStatus = async (
]);

return launchService.updateCreationStatus(newsletter, {
ophanCampaignCreationStatus: outputToStatus(launchEmailResult),
brazeCampaignCreationStatus: outputToStatus(brazeRequestEmailResult),
tagCreationStatus: outputToStatus(tagAndSignUpPageCreationEmailResult),
signupPageCreationStatus: outputToStatus(
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import { cancelLayout } from './cancelLayout';
import { doLaunchLayout } from './doLaunchLayout';
import { editBrazeLayout } from './editBrazeLayout';
import { editIdentityNameLayout } from './editIdentityNameLayout';
import { editOphanLayout } from './editOphanLayout';
import { finishLayout } from './finishLayout';
import { identityNameLayout } from './identityNameLayout';
import { isDataCompleteLayout } from './isDataCompleteLayout';
import { launchNewsletterLayout } from './launchNewsletterLayout';
import { noItemLayout } from './noItem';
import { ophanLayout } from './ophanLayout';

export const launchLayout: WizardLayout<LaunchService> = {
launchNewsletter: launchNewsletterLayout,
Expand All @@ -20,8 +18,6 @@ export const launchLayout: WizardLayout<LaunchService> = {
editIdentityName: editIdentityNameLayout,
braze: brazeLayout,
editBraze: editBrazeLayout,
ophan: ophanLayout,
editOphan: editOphanLayout,
doLaunch: doLaunchLayout,
noItem: noItemLayout,
cancel: cancelLayout,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class LaunchService {
creationStatuses: Pick<
NewsletterData,
| 'brazeCampaignCreationStatus'
| 'ophanCampaignCreationStatus'
| 'signupPageCreationStatus'
| 'tagCreationStatus'
>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ export const newsletterDataSchema = z.object({
brazeCampaignCreationStatus: workflowStatusEnumSchema.describe(
'Braze campaign creation status',
),
ophanCampaignCreationStatus: workflowStatusEnumSchema.describe(
'Ophan campaign creation status',
),
ophanCampaignCreationStatus: workflowStatusEnumSchema
.optional()
.describe(
'Ophan campaign creation status',
),
signupPageCreationStatus: workflowStatusEnumSchema.describe(
'Sign up creation status',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { UserPermissions } from '../user-profile';
export const getUserEditSchema = (
permissions: UserPermissions,
): ZodObject<ZodRawShape> => {
const { editBraze, editOphan, editTags, editSignUpPage, editNewsletters } =
const { editBraze, editTags, editSignUpPage, editNewsletters } =
permissions;
if (editNewsletters) {
return newsletterDataSchema.pick({
Expand All @@ -20,7 +20,6 @@ export const getUserEditSchema = (
seriesTag: true,
composerTag: true,
composerCampaignTag: true,
ophanCampaignCreationStatus: true,
signupPageCreationStatus: true,
signupPage: true,
signUpDescription: true,
Expand All @@ -40,11 +39,6 @@ export const getUserEditSchema = (
brazeCampaignCreationStatus: true,
});
}
if (editOphan) {
return newsletterDataSchema.pick({
ophanCampaignCreationStatus: true,
});
}
if (editTags && editSignUpPage) {
return newsletterDataSchema.pick({
tagCreationStatus: true,
Expand Down

0 comments on commit f6f3c77

Please sign in to comment.