Skip to content

Commit acc19d8

Browse files
authored
Merge pull request #1466 from AppQuality/UN-1998
Un 1998
2 parents ee4ba8c + 17fb03d commit acc19d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1930
-37
lines changed

src/assets/icons/email-icon.svg

Lines changed: 3 additions & 0 deletions
Loading

src/assets/icons/eye-icon-fill.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

src/assets/icons/eye-icon.svg

Lines changed: 3 additions & 0 deletions
Loading

src/assets/icons/save-icon.svg

Lines changed: 3 additions & 0 deletions
Loading

src/features/api/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const apiSlice = createApi({
2626
'Tags',
2727
'CustomStatuses',
2828
'Bug',
29+
'PlanWatchers',
2930
'BugComments',
3031
'Preferences',
3132
'VideoTags',

src/features/api/apiTags.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ unguessApi.enhanceEndpoints({
330330
getPlansByPidRulesEvaluation: {
331331
providesTags: ['EvaluationRules'],
332332
},
333+
getPlansByPidWatchers: {
334+
providesTags: ['PlanWatchers'],
335+
},
336+
postPlansByPidWatchers: {
337+
invalidatesTags: ['PlanWatchers'],
338+
},
339+
putPlansByPidWatchers: {
340+
invalidatesTags: ['PlanWatchers'],
341+
},
342+
deletePlansByPidWatchersAndProfileId: {
343+
invalidatesTags: ['PlanWatchers'],
344+
},
333345
},
334346
});
335347

src/features/api/index.ts

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,32 @@ const injectedRtkApi = api.injectEndpoints({
786786
params: { limit: queryArg.limit, start: queryArg.start },
787787
}),
788788
}),
789+
getPlansByPidWatchers: build.query<
790+
GetPlansByPidWatchersApiResponse,
791+
GetPlansByPidWatchersApiArg
792+
>({
793+
query: (queryArg) => ({ url: `/plans/${queryArg.pid}/watchers` }),
794+
}),
795+
postPlansByPidWatchers: build.mutation<
796+
PostPlansByPidWatchersApiResponse,
797+
PostPlansByPidWatchersApiArg
798+
>({
799+
query: (queryArg) => ({
800+
url: `/plans/${queryArg.pid}/watchers`,
801+
method: 'POST',
802+
body: queryArg.body,
803+
}),
804+
}),
805+
putPlansByPidWatchers: build.mutation<
806+
PutPlansByPidWatchersApiResponse,
807+
PutPlansByPidWatchersApiArg
808+
>({
809+
query: (queryArg) => ({
810+
url: `/plans/${queryArg.pid}/watchers`,
811+
method: 'PUT',
812+
body: queryArg.body,
813+
}),
814+
}),
789815
getWorkspacesByWidTemplates: build.query<
790816
GetWorkspacesByWidTemplatesApiResponse,
791817
GetWorkspacesByWidTemplatesApiArg
@@ -862,6 +888,15 @@ const injectedRtkApi = api.injectEndpoints({
862888
body: queryArg.body,
863889
}),
864890
}),
891+
deletePlansByPidWatchersAndProfileId: build.mutation<
892+
DeletePlansByPidWatchersAndProfileIdApiResponse,
893+
DeletePlansByPidWatchersAndProfileIdApiArg
894+
>({
895+
query: (queryArg) => ({
896+
url: `/plans/${queryArg.pid}/watchers/${queryArg.profileId}`,
897+
method: 'DELETE',
898+
}),
899+
}),
865900
}),
866901
overrideExisting: false,
867902
});
@@ -896,12 +931,15 @@ export type PostBuyApiArg = {
896931
key: string;
897932
tag: string;
898933
};
934+
payment_status?: 'paid' | 'unpaid';
899935
};
900936
};
901937
type:
902-
| 'checkout.session.completed'
938+
| 'checkout.session.async_payment_succeeded'
903939
| 'checkout.session.async_payment_failed'
904-
| 'checkout.session.expired';
940+
| 'checkout.session.completed'
941+
| 'checkout.session.expired'
942+
| 'charge.refunded';
905943
};
906944
};
907945
export type GetCampaignsByCidApiResponse =
@@ -2005,6 +2043,37 @@ export type GetWorkspacesByWidProjectsAndPidCampaignsApiArg = {
20052043
/** Start pagination parameter */
20062044
start?: number;
20072045
};
2046+
export type GetPlansByPidWatchersApiResponse = /** status 200 OK */ {
2047+
items: {
2048+
id: number;
2049+
name: string;
2050+
surname: string;
2051+
email: string;
2052+
image?: string;
2053+
isInternal: boolean;
2054+
}[];
2055+
};
2056+
export type GetPlansByPidWatchersApiArg = {
2057+
pid: string;
2058+
};
2059+
export type PostPlansByPidWatchersApiResponse = /** status 200 OK */ void;
2060+
export type PostPlansByPidWatchersApiArg = {
2061+
pid: string;
2062+
body: {
2063+
users: {
2064+
id: number;
2065+
}[];
2066+
};
2067+
};
2068+
export type PutPlansByPidWatchersApiResponse = /** status 200 OK */ void;
2069+
export type PutPlansByPidWatchersApiArg = {
2070+
pid: string;
2071+
body: {
2072+
users: {
2073+
id: number;
2074+
}[];
2075+
};
2076+
};
20082077
export type GetWorkspacesByWidTemplatesApiResponse = /** status 200 OK */ {
20092078
items: CpReqTemplate[];
20102079
} & PaginationData;
@@ -2104,6 +2173,14 @@ export type PostWorkspacesByWidUsersApiArg = {
21042173
surname?: string;
21052174
};
21062175
};
2176+
export type DeletePlansByPidWatchersAndProfileIdApiResponse =
2177+
/** status 200 OK */ {
2178+
success?: boolean;
2179+
};
2180+
export type DeletePlansByPidWatchersAndProfileIdApiArg = {
2181+
pid: string;
2182+
profileId: string;
2183+
};
21072184
export type Error = {
21082185
code: number;
21092186
error: boolean;
@@ -3050,11 +3127,15 @@ export const {
30503127
useGetWorkspacesByWidProjectsQuery,
30513128
useGetWorkspacesByWidProjectsAndPidQuery,
30523129
useGetWorkspacesByWidProjectsAndPidCampaignsQuery,
3130+
useGetPlansByPidWatchersQuery,
3131+
usePostPlansByPidWatchersMutation,
3132+
usePutPlansByPidWatchersMutation,
30533133
useGetWorkspacesByWidTemplatesQuery,
30543134
usePostWorkspacesByWidTemplatesMutation,
30553135
useDeleteWorkspacesByWidTemplatesAndTidMutation,
30563136
useGetWorkspacesByWidTemplatesAndTidQuery,
30573137
useDeleteWorkspacesByWidUsersMutation,
30583138
useGetWorkspacesByWidUsersQuery,
30593139
usePostWorkspacesByWidUsersMutation,
3140+
useDeletePlansByPidWatchersAndProfileIdMutation,
30603141
} = injectedRtkApi;

src/hooks/usePlan.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,14 @@ const usePlanIsPurchasable = (planId?: string) => {
135135
return isPurchasable;
136136
};
137137

138-
export { usePlan, usePlanIsDraft, usePlanIsPurchasable };
138+
const usePlanIsApproved = (planId?: string) => {
139+
const { planComposedStatus } = usePlan(planId);
140+
141+
const isApproved =
142+
!!planComposedStatus &&
143+
['PurchasedPlan', 'Accepted'].includes(planComposedStatus);
144+
145+
return isApproved;
146+
};
147+
148+
export { usePlan, usePlanIsDraft, usePlanIsPurchasable, usePlanIsApproved };

src/locales/en/translation.json

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,11 @@
849849
"__PLAN_PAGE_MODAL_SEND_REQUEST_TITLE_LABEL": "Activity title",
850850
"__PLAN_PAGE_MODAL_SEND_REQUEST_TOAST_ERROR": "Something went wrong while requesting the activity",
851851
"__PLAN_PAGE_MODAL_SEND_REQUEST_WAIT": "<XL>Setting up your request</XL><LG>We're preparing everything for our experts to review. This will take just a few seconds.</LG>",
852+
"__PLAN_PAGE_MODAL_SEND_REQUEST_WATCHERS_DESCRIPTION": "They’ll receive email updates at every stage",
853+
"__PLAN_PAGE_MODAL_SEND_REQUEST_WATCHERS_ERROR": "Please add at least one team member to continue",
854+
"__PLAN_PAGE_MODAL_SEND_REQUEST_WATCHERS_HINT": "You can add only workspace members in this phase",
855+
"__PLAN_PAGE_MODAL_SEND_REQUEST_WATCHERS_LABEL": "Involve your team in this activity",
856+
"__PLAN_PAGE_MODAL_SEND_REQUEST_WATCHERS_PLACEHOLDER": "Search for team members...",
852857
"__PLAN_PAGE_MODUL_GENERAL_REMOVE_MODAL_CANCEL": "Cancel",
853858
"__PLAN_PAGE_MODUL_GENERAL_REMOVE_MODAL_CONFIRM": "Confirm",
854859
"__PLAN_PAGE_MODUL_GENERAL_REMOVE_MODAL_DESCRIPTION": "If you delete the item, the entered information will no longer be recoverable.",
@@ -1168,7 +1173,35 @@
11681173
"__PLAN_PAGE_TAB_SUMMARY_TAB_TITLE": "Get expert feedback",
11691174
"__PLAN_PAGE_TAB_TARGET_TAB_TITLE": "Screen participants",
11701175
"__PLAN_PAGE_TITLE": "Plan your activity",
1171-
"__PLAN_REQUEST_QUOTATION_CTA": "Submit Request",
1176+
"__PLAN_PAGE_WATCHER_LIST_ADD_SELF_TOAST_ERROR_MESSAGE": "Ops! Something went wrong. Please try again",
1177+
"__PLAN_PAGE_WATCHER_LIST_ADD_SELF_TOAST_MESSAGE": "You’ve started following this activity",
1178+
"__PLAN_PAGE_WATCHER_LIST_ADD_USER_ERROR_TOAST_MESSAGE": "Error while adding user",
1179+
"__PLAN_PAGE_WATCHER_LIST_APPROVED_ALERT_TEXT": "Add or remove followers from the dashboard",
1180+
"__PLAN_PAGE_WATCHER_LIST_APPROVED_ALERT_TITLE": "You’ll keep receiving notifications while the activity is in progress",
1181+
"__PLAN_PAGE_WATCHER_LIST_MODAL_ADD_MEMBERS_INFO_TOOLTIP": "Only workspace members can be added during the setup phase",
1182+
"__PLAN_PAGE_WATCHER_LIST_MODAL_FOLLOW_BUTTON": "Follow this activity",
1183+
"__PLAN_PAGE_WATCHER_LIST_MODAL_FOLLOW_BUTTON_DISABLED_TOOLTIP": "Become a workspace member to be included in updates",
1184+
"__PLAN_PAGE_WATCHER_LIST_MODAL_NO_WATCHERS_DESCRIPTION": "Add your team so they stay updated too",
1185+
"__PLAN_PAGE_WATCHER_LIST_MODAL_NO_WATCHERS_TITLE": "Add yourself as a workspace member",
1186+
"__PLAN_PAGE_WATCHER_LIST_MODAL_ONLY_ONE_WATCHER_DESCRIPTION": "Add your team so they stay updated too",
1187+
"__PLAN_PAGE_WATCHER_LIST_MODAL_ONLY_ONE_WATCHER_TITLE": "Only one person is following this activity!",
1188+
"__PLAN_PAGE_WATCHER_LIST_MODAL_REMOVE_BUTTON_DISABLED_TOOLTIP": "At least one person must follow this activity ",
1189+
"__PLAN_PAGE_WATCHER_LIST_MODAL_REMOVE_BUTTON_TOOLTIP": "If you remove this person, they will no longer receive email updates about this activity",
1190+
"__PLAN_PAGE_WATCHER_LIST_MODAL_SUGGESTIONS_TITLE": "Add members from your workspace",
1191+
"__PLAN_PAGE_WATCHER_LIST_MODAL_TITLE": "Stay updated on the activity setup",
1192+
"__PLAN_PAGE_WATCHER_LIST_MODAL_TITLE_DESCRIPTION": "Follow this activity and <span>turn on notifications</span> to receive important email updates",
1193+
"__PLAN_PAGE_WATCHER_LIST_MODAL_TITLE_DESCRIPTION_APPROVED": "Great job! You’ve completed the setup phase",
1194+
"__PLAN_PAGE_WATCHER_LIST_MODAL_UNFOLLOW_BUTTON": "Unfollow this activity",
1195+
"__PLAN_PAGE_WATCHER_LIST_MODAL_UNFOLLOW_BUTTON_DISABLED_TOOLTIP": "At least one person must follow this activity ",
1196+
"__PLAN_PAGE_WATCHER_LIST_MODAL_WATCHERS_TITLE": "People following this activity",
1197+
"__PLAN_PAGE_WATCHER_LIST_MODAL_WATCHERS_TITLE_APPROVED": "People followed setup phase",
1198+
"__PLAN_PAGE_WATCHER_LIST_REMOVE_LAST_USER_ERROR_TOAST_MESSAGE": "At least one person must follow this activity",
1199+
"__PLAN_PAGE_WATCHER_LIST_REMOVE_SELF_TOAST_MESSAGE": "You’ve unfollowed this activity",
1200+
"__PLAN_PAGE_WATCHER_LIST_REMOVE_USER_ERROR_TOAST_MESSAGE": "Error while removing user",
1201+
"__PLAN_PAGE_WATCHER_LIST_SELECT_ADD_MEMBERS_PLACEHOLDER": "Search by name or email",
1202+
"__PLAN_PAGE_WATCHER_LIST_TOOLTIP": "Follow this activity",
1203+
"__PLAN_PAGE_WATCHER_LIST_TOOLTIP_DESCRIPTION": "Stay updated with important email notifications",
1204+
"__PLAN_REQUEST_QUOTATION_CTA": "Submit",
11721205
"__PLAN_RULE_DUPLICATE_TOUCHPOINT_FORM_FACTORS": "Multiple touchpoints of the same type",
11731206
"__PLAN_RULE_MODULE_TYPE": "Custom features added",
11741207
"__PLAN_RULE_NUMBER_OF_MODULES": "Extra modules added",
@@ -1180,7 +1213,8 @@
11801213
"__PLAN_RULES_WHAT_MEANS_DESCRIPTION_1": "2-day expert review",
11811214
"__PLAN_RULES_WHAT_MEANS_DESCRIPTION_2": "Custom quote via email",
11821215
"__PLAN_RULES_WHAT_MEANS_DESCRIPTION_3": "Personalised support",
1183-
"__PLAN_SAVE_CONFIGURATION_CTA": "Save Draft",
1216+
"__PLAN_SAVE_CONFIGURATION_CTA": "Save",
1217+
"__PLAN_SAVE_CONFIGURATION_TOOLTIP": "Save draft",
11841218
"__PLAN_SAVE_DRAFT_TOAST_ERROR": "We couldn't save your draft: please try again later.",
11851219
"__PLAN_SAVE_DRAFT_TOAST_SUCCESS": "Activity draft saved! You can safely continue editing.",
11861220
"__PLAN_SAVE_TEMPLATE_CTA": "Save as template",
@@ -1212,10 +1246,35 @@
12121246
"__PROFILE_PAGE_COMPANY_SIZE_REQUIRED_ERROR": "Company size is required",
12131247
"__PROFILE_PAGE_CONFIRM_PASSWORD_MUST_MATCH_NEW_PASSWORD": "The confirmation password must match the new password",
12141248
"__PROFILE_PAGE_NAME_REQUIRED_ERROR": "Name is required",
1249+
"__PROFILE_PAGE_NAV_ITEM_NOTIFICATION_SETTINGS": "Notification settings",
12151250
"__PROFILE_PAGE_NAV_ITEM_PASSWORD": "Password settings",
12161251
"__PROFILE_PAGE_NAV_ITEM_PROFILE": "Profile settings",
12171252
"__PROFILE_PAGE_NAV_SECTION_PASSWORD": "PASSWORD",
12181253
"__PROFILE_PAGE_NEW_PASSWORD_REQUIRED_ERROR": "New password is required",
1254+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_ITEM_1": "When a quote is ready",
1255+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_ITEM_2": "When a payment is confirmed",
1256+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_ITEM_3": "When an activity is scheduled",
1257+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_ITEM_4": "When an activity is completed",
1258+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_ITEM_5": "When you’re mentioned in a comment",
1259+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_ALERT_TITLE": "You’ll always receive:",
1260+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_CHECKBOX_HINT": "From execution to completion, including comments in threads you participate in",
1261+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_CHECKBOX_LABEL": "Activity progress",
1262+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_UPDATES_FORM_LABEL": "Receive updates for:",
1263+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_UPDATES_HINT": "Choose which progress notifications you’d like to receive by email for the activities you follow",
1264+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_UPDATES_LABEL": "Activity progress updates",
1265+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_PROGRESS_UPDATES_TAG": "Recommended to keep enabled",
1266+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_SETUP_CHECKBOX_HINT": "From configuration through planning",
1267+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_ACTIVITY_SETUP_CHECKBOX_LABEL": "Activity setup",
1268+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_DESCRIPTION": "Manage which email updates you want to receive",
1269+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_BUTTON_TEXT": "Unfollow",
1270+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_HINT": "You’ll receive updates for activities only for these activities",
1271+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_HINT_TEXT": "Your changes are saved automatically",
1272+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_LABEL": "Activities you’re following",
1273+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_PROGRESS_DESCRIPTION": "Activity progress ",
1274+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_SETUP_DESCRIPTION": "Activity setup ",
1275+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_FOLLOW_ACTIVITIES_TAG": "tot.",
1276+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_LABEL": "Notification settings",
1277+
"__PROFILE_PAGE_NOTIFICATIONS_CARD_SAVE_BUTTON_LABEL": "Save changes",
12191278
"__PROFILE_PAGE_PASSWORD_ACCORDION_LABEL": "Password settings",
12201279
"__PROFILE_PAGE_ROLE_REQUIRED_ERROR": "Role is required",
12211280
"__PROFILE_PAGE_SURNAME_REQUIRED_ERROR": "Surname is required",
@@ -1414,6 +1473,7 @@
14141473
"_TOAST_UNPUBLISHED_MESSAGE": "successfully unpublished",
14151474
"{{count}} bugs_one": "{{count}} bug",
14161475
"{{count}} bugs_other": "{{count}} bugs",
1476+
"{{name}} (you)": "",
14171477
"INSIGHT_PAGE_COLLECTION_OBSERVATIONS_LABEL": "Observations: <1>{{counter}}</1>",
14181478
"INSIGHT_PAGE_COLLECTION_THEMES_LABEL": "Themes: <1>{{counter}}</1>",
14191479
"INSIGHT_PAGE_COLLECTION_UNGROUPED_USECASE_SUBTITTLE": "Isolated Observations",

0 commit comments

Comments
 (0)