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

upcoming: [M3-8012] - Fix PG event text formatting #10420

Merged
merged 8 commits into from
May 2, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/api-v4": Upcoming Features
---

Updated Placement Group event types ([#10420](https://github.com/linode/manager/pull/10420))
carrillo-erik marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions packages/api-v4/src/account/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ export type EventAction =
| 'nodebalancer_update'
| 'password_reset'
| 'placement_group_assign'
| 'placement_group_created'
| 'placement_group_create'
| 'placement_group_assigned'
| 'placement_group_unassigned'
| 'placement_group_updated'
| 'placement_group_deleted'
| 'placement_group_unassign'
| 'placement_group_update'
| 'placement_group_delete'
| 'profile_update'
| 'stackscript_create'
| 'stackscript_delete'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Fixed Placement Group action event formatting ([#10420](https://github.com/linode/manager/pull/10420))
carrillo-erik marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 4 additions & 4 deletions packages/manager/src/features/Events/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export const EVENT_ACTIONS: Event['action'][] = [
'nodebalancer_update',
'password_reset',
'placement_group_assign',
'placement_group_created',
'placement_group_create',
'placement_group_assigned',
'placement_group_unassigned',
'placement_group_updated',
'placement_group_deleted',
'placement_group_unassign',
'placement_group_update',
'placement_group_delete',
'profile_update',
'stackscript_create',
'stackscript_delete',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,18 +717,18 @@ export const eventMessageCreators: { [index: string]: CreatorsForStatus } = {
notification: (e) =>
carrillo-erik marked this conversation as resolved.
Show resolved Hide resolved
`Linode ${e.secondary_entity?.label} has been assigned to Placement Group ${e.entity?.label}.`,
},
placement_group_created: {
placement_group_create: {
notification: (e) =>
`Placement Group ${e.entity?.label} has been successfully created.`,
},
placement_group_deleted: {
placement_group_delete: {
notification: (e) => `Placement Group ${e.entity?.label} has been deleted.`,
},
placement_group_unassigned: {
placement_group_unassign: {
notification: (e) =>
`Linode ${e.secondary_entity?.label} has been unassigned from Placement Group ${e.entity?.label}.`,
},
placement_group_updated: {
placement_group_update: {
notification: (e) => `Placement Group ${e.entity?.label} has been updated.`,
},
profile_update: {
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/src/mocks/serverHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1609,14 +1609,14 @@ export const handlers = [
status: 'notification',
});
const placementGroupCreateEvent = eventFactory.buildList(1, {
action: 'placement_group_created',
action: 'placement_group_create',
entity: { id: 999, label: 'PG-1', type: 'placement_group' },
message: 'Placement Group successfully created.',
percent_complete: 100,
status: 'notification',
});
const placementGroupAssignedEvent = eventFactory.buildList(1, {
action: 'placement_group_assigned',
action: 'placement_group_assign',
entity: { id: 990, label: 'PG-2', type: 'placement_group' },
message: 'Placement Group successfully assigned.',
percent_complete: 100,
Expand Down
Loading