Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ophan status as nothing async happens #320

Merged
merged 4 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a comment or update the field description to mark the property as deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great idea. Thanks

),
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
Loading