@paro.io/expert-shared-components 1.4.7 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,7 @@ type RatingCardProps = {
20
20
  isInternal?: boolean;
21
21
  createOrUpdateRating?: any;
22
22
  getparoProjectsByClientIdDocument?: any;
23
+ projectIdToShow?: number;
23
24
  };
24
- declare const ProjectRatingCard: ({ expertName, legacyFreelancerId, project, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, updatedProjectDetails, projectsEligibleForRating, projectsWithRecentRating, completeProjectsWithDaysSinceLastRating, projectsWithFinalRating, projectsWithRatingRequested, projectsEndedWayBack, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, }: RatingCardProps) => JSX.Element;
25
+ declare const ProjectRatingCard: ({ expertName, legacyFreelancerId, project, index, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, updatedProjectDetails, projectsEligibleForRating, projectsWithRecentRating, completeProjectsWithDaysSinceLastRating, projectsWithFinalRating, projectsWithRatingRequested, projectsEndedWayBack, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, projectIdToShow, }: RatingCardProps) => JSX.Element;
25
26
  export default ProjectRatingCard;
@@ -57,7 +57,7 @@ const sortProjects = (projects) => {
57
57
  return valueB - valueA;
58
58
  });
59
59
  };
60
- const ProjectRatingCard = ({ expertName, legacyFreelancerId, project, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, updatedProjectDetails, projectsEligibleForRating, projectsWithRecentRating, completeProjectsWithDaysSinceLastRating, projectsWithFinalRating, projectsWithRatingRequested, projectsEndedWayBack, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, }) => {
60
+ const ProjectRatingCard = ({ expertName, legacyFreelancerId, project, index, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, updatedProjectDetails, projectsEligibleForRating, projectsWithRecentRating, completeProjectsWithDaysSinceLastRating, projectsWithFinalRating, projectsWithRatingRequested, projectsEndedWayBack, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, projectIdToShow, }) => {
61
61
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
62
62
  const [requestStatus, setRequestStatus] = (0, react_1.useState)(((0, dayjs_1.default)((_b = (_a = project === null || project === void 0 ? void 0 : project.rating) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.createdAt).isBefore((0, dayjs_1.default)((_d = (_c = project === null || project === void 0 ? void 0 : project.ratingRequest) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.createdAt)) &&
63
63
  ((_f = (_e = project === null || project === void 0 ? void 0 : project.ratingRequest) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.status) === 'Requested') ||
@@ -89,7 +89,7 @@ const ProjectRatingCard = ({ expertName, legacyFreelancerId, project, getParoPro
89
89
  };
90
90
  const sortedProjectRatings = sortProjects(project.rating);
91
91
  return (react_1.default.createElement(react_1.default.Fragment, null,
92
- ((_l = project === null || project === void 0 ? void 0 : project.rating) === null || _l === void 0 ? void 0 : _l.length) > 0 ? (react_1.default.createElement(RatingHeader_1.default, { ratings: sortedProjectRatings, project: project, highlightedRatings: highlightedRatings, requestStatus: requestStatus, handleRatingRequest: handleRatingRequest, loadingSubmitId: loadingSubmitId, handleAddToProfile: handleAddToProfile, isClientPortal: isClientPortal, isInternal: isInternal, getParoProjectsDocument: getParoProjectsDocument, ratingReviewButtonlabel: ratingReviewButtonlabel, setOpenClientReviewModal: setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects: setShowReviewModelWithRecentlyRatedProjects, enableReviewModal: enableReviewModal, disableReviewModal: disableReviewModal, createOrUpdateRating: createOrUpdateRating })) : (react_1.default.createElement(RatingHeader_1.default, { ratings: sortedProjectRatings, project: project, highlightedRatings: highlightedRatings, requestStatus: requestStatus, handleRatingRequest: handleRatingRequest, loadingSubmitId: loadingSubmitId, handleAddToProfile: handleAddToProfile, isClientPortal: isClientPortal, isInternal: isInternal, getParoProjectsDocument: getParoProjectsDocument, ratingReviewButtonlabel: ratingReviewButtonlabel, setOpenClientReviewModal: setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects: setShowReviewModelWithRecentlyRatedProjects, enableReviewModal: enableReviewModal, disableReviewModal: disableReviewModal, createOrUpdateRating: createOrUpdateRating })),
92
+ ((_l = project === null || project === void 0 ? void 0 : project.rating) === null || _l === void 0 ? void 0 : _l.length) > 0 ? (react_1.default.createElement(RatingHeader_1.default, { ratings: sortedProjectRatings, project: project, index: index, highlightedRatings: highlightedRatings, requestStatus: requestStatus, handleRatingRequest: handleRatingRequest, loadingSubmitId: loadingSubmitId, handleAddToProfile: handleAddToProfile, isClientPortal: isClientPortal, isInternal: isInternal, getParoProjectsDocument: getParoProjectsDocument, ratingReviewButtonlabel: ratingReviewButtonlabel, setOpenClientReviewModal: setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects: setShowReviewModelWithRecentlyRatedProjects, enableReviewModal: enableReviewModal, disableReviewModal: disableReviewModal, createOrUpdateRating: createOrUpdateRating, projectIdToShow: projectIdToShow })) : (react_1.default.createElement(RatingHeader_1.default, { ratings: sortedProjectRatings, project: project, index: index, highlightedRatings: highlightedRatings, requestStatus: requestStatus, handleRatingRequest: handleRatingRequest, loadingSubmitId: loadingSubmitId, handleAddToProfile: handleAddToProfile, isClientPortal: isClientPortal, isInternal: isInternal, getParoProjectsDocument: getParoProjectsDocument, ratingReviewButtonlabel: ratingReviewButtonlabel, setOpenClientReviewModal: setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects: setShowReviewModelWithRecentlyRatedProjects, enableReviewModal: enableReviewModal, disableReviewModal: disableReviewModal, createOrUpdateRating: createOrUpdateRating, projectIdToShow: projectIdToShow })),
93
93
  openExpertReviewModal && (react_1.default.createElement(reviewRequestModal_1.default, { project: project, clientId: (_m = project === null || project === void 0 ? void 0 : project.client) === null || _m === void 0 ? void 0 : _m.id, requestModal: openExpertReviewModal, setRequestModal: setOpenExpertReviewModal, expertName: expertName, freelancerId: String(legacyFreelancerId), setRequestStatus: setRequestStatus, selectedProject: selectedProject, setSelectedProject: setSelectedProject, getParoProjectsDocument: getParoProjectsDocument, setHighlightedRatings: setHighlightedRatings, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation })),
94
94
  openClientReviewModal && (react_1.default.createElement(ReviewModal_1.default, { openReviewModal: openClientReviewModal, setOpenReviewModal: setOpenClientReviewModal, freelancer: highlightedRatings === null || highlightedRatings === void 0 ? void 0 : highlightedRatings.freelancer, projects: [project], projectsWithRecentRating: projectsWithRecentRating, projectsEligibleForRating: [project], editIcon: showReviewModelWithRecentlyRatedProjects, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, createOrUpdateRating: createOrUpdateRating, getparoProjectsByClientIdDocument: getparoProjectsByClientIdDocument, clientId: (_o = project === null || project === void 0 ? void 0 : project.client) === null || _o === void 0 ? void 0 : _o.id }))));
95
95
  };
@@ -17,6 +17,7 @@ type ProjectReviewsSectionProps = {
17
17
  isInternal?: boolean;
18
18
  createOrUpdateRating?: any;
19
19
  getparoProjectsByClientIdDocument?: any;
20
+ projectIdToShow?: string;
20
21
  };
21
22
  export declare const calculateAverageRatings: (paroProjectsData: any[]) => {
22
23
  overallRating: number;
@@ -25,5 +26,5 @@ export declare const calculateAverageRatings: (paroProjectsData: any[]) => {
25
26
  professionalismRating: number;
26
27
  executionOfDeliverablesRating: number;
27
28
  };
28
- declare const ProjectReviewsSection: ({ uniqueClients, paroProjectsData, openRowId, openAllRows, toggleOpen, expertName, legacyFreelancerId, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, selectedButton, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, }: ProjectReviewsSectionProps) => JSX.Element;
29
+ declare const ProjectReviewsSection: ({ uniqueClients, paroProjectsData, openRowId, openAllRows, toggleOpen, expertName, legacyFreelancerId, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, selectedButton, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, projectIdToShow, }: ProjectReviewsSectionProps) => JSX.Element;
29
30
  export default ProjectReviewsSection;
@@ -64,7 +64,7 @@ const getSOWDates = (projects) => {
64
64
  const dates = { oldestStartDate, newestEndDate };
65
65
  return dates;
66
66
  };
67
- const ProjectReviewsSection = ({ uniqueClients, paroProjectsData, openRowId, openAllRows, toggleOpen, expertName, legacyFreelancerId, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, selectedButton, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, }) => {
67
+ const ProjectReviewsSection = ({ uniqueClients, paroProjectsData, openRowId, openAllRows, toggleOpen, expertName, legacyFreelancerId, getParoProjectsDocument, handleAddToProfile, highlightedRatings, setHighlightedRatings, loadingSubmitId, createOrUpdateRatingRequestMutation, selectedButton, isClientPortal, isInternal, createOrUpdateRating, getparoProjectsByClientIdDocument, projectIdToShow, }) => {
68
68
  let [projectsWithRecentRating, projectsEligibleForRating, projectsWithFinalRating, projectsWithRatingRequested, projectsEndedWayBack, completeProjectsWithDaysSinceLastRating] = [[], [], [], [], [], [], []];
69
69
  let time = '';
70
70
  const getProjectType = (projects) => {
@@ -121,6 +121,8 @@ const ProjectReviewsSection = ({ uniqueClients, paroProjectsData, openRowId, ope
121
121
  const { overallRating } = (0, exports.calculateAverageRatings)(projectsWithSameSOW);
122
122
  const totalRatingsGiven = projectsWithSameSOW === null || projectsWithSameSOW === void 0 ? void 0 : projectsWithSameSOW.reduce((sum, obj) => { var _a; return sum + ((_a = obj === null || obj === void 0 ? void 0 : obj.rating) === null || _a === void 0 ? void 0 : _a.length); }, 0);
123
123
  const { oldestStartDate, newestEndDate } = getSOWDates(projectsWithSameSOW);
124
+ const sortedProjects = sortProjects(projectsWithSameSOW);
125
+ const projectIndexToShow = projectIdToShow ? sortedProjects.findIndex((project) => project.id === Number(projectIdToShow)) : -1;
124
126
  return (react_1.default.createElement(react_1.default.Fragment, null,
125
127
  react_1.default.createElement("div", { className: "flex flex-row justify-between mt-4 items-center" },
126
128
  react_1.default.createElement("div", { className: "flex flex-row gap-x-4 items-center" },
@@ -145,9 +147,9 @@ const ProjectReviewsSection = ({ uniqueClients, paroProjectsData, openRowId, ope
145
147
  react_1.default.createElement(core_1.IconButton, { "aria-label": "expand row", size: "small", onClick: () => toggleOpen(index) }, openRowId.includes(index) || openAllRows ? react_1.default.createElement(KeyboardArrowUp_1.default, null) : react_1.default.createElement(KeyboardArrowDown_1.default, null)))),
146
148
  react_1.default.createElement(core_1.Box, { pt: 3 },
147
149
  react_1.default.createElement(core_1.Divider, null)),
148
- (openRowId.includes(index) || openAllRows) && (react_1.default.createElement("div", { className: "p-6" }, sortProjects(projectsWithSameSOW)
150
+ (openRowId.includes(index) || openAllRows) && (react_1.default.createElement("div", { className: "p-6" }, sortedProjects
149
151
  .map((project, index) => {
150
- return (react_1.default.createElement(ProjectRatingCard_1.default, { expertName: expertName, legacyFreelancerId: legacyFreelancerId, project: project, index: index, getParoProjectsDocument: getParoProjectsDocument, handleAddToProfile: handleAddToProfile, highlightedRatings: highlightedRatings, setHighlightedRatings: setHighlightedRatings, loadingSubmitId: loadingSubmitId, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, updatedProjectDetails: updatedProjectDetails, projectsEligibleForRating: projectsEligibleForRating, projectsWithRecentRating: projectsWithRecentRating, completeProjectsWithDaysSinceLastRating: completeProjectsWithDaysSinceLastRating, projectsWithFinalRating: projectsWithFinalRating, projectsWithRatingRequested: projectsWithRatingRequested, projectsEndedWayBack: projectsEndedWayBack, isClientPortal: isClientPortal, isInternal: isInternal, createOrUpdateRating: createOrUpdateRating, getparoProjectsByClientIdDocument: getparoProjectsByClientIdDocument }));
152
+ return (react_1.default.createElement(ProjectRatingCard_1.default, { expertName: expertName, legacyFreelancerId: legacyFreelancerId, project: project, index: index, getParoProjectsDocument: getParoProjectsDocument, handleAddToProfile: handleAddToProfile, highlightedRatings: highlightedRatings, setHighlightedRatings: setHighlightedRatings, loadingSubmitId: loadingSubmitId, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, updatedProjectDetails: updatedProjectDetails, projectsEligibleForRating: projectsEligibleForRating, projectsWithRecentRating: projectsWithRecentRating, completeProjectsWithDaysSinceLastRating: completeProjectsWithDaysSinceLastRating, projectsWithFinalRating: projectsWithFinalRating, projectsWithRatingRequested: projectsWithRatingRequested, projectsEndedWayBack: projectsEndedWayBack, isClientPortal: isClientPortal, isInternal: isInternal, createOrUpdateRating: createOrUpdateRating, getparoProjectsByClientIdDocument: getparoProjectsByClientIdDocument, projectIdToShow: projectIndexToShow }));
151
153
  })))));
152
154
  })));
153
155
  };
@@ -1,6 +1,7 @@
1
1
  type RatingSectionProps = {
2
2
  ratings: Partial<any>;
3
3
  project: any;
4
+ index: number;
4
5
  highlightedRatings: any;
5
6
  requestStatus: string;
6
7
  handleRatingRequest: (projectId: any) => void;
@@ -15,7 +16,8 @@ type RatingSectionProps = {
15
16
  isInternal?: boolean;
16
17
  createOrUpdateRating?: any;
17
18
  getParoProjectsDocument?: any;
19
+ projectIdToShow?: number;
18
20
  };
19
21
  export declare const isRatingExists: (rating: Partial<any> | any[]) => boolean;
20
- declare const RatingHeader: ({ ratings, project, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, }: RatingSectionProps) => JSX.Element;
22
+ declare const RatingHeader: ({ ratings, project, index, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, projectIdToShow, }: RatingSectionProps) => JSX.Element;
21
23
  export default RatingHeader;
@@ -58,12 +58,12 @@ const StyledButton = (0, styled_components_1.default)(core_2.Button) `
58
58
  color: #248384 !important
59
59
  }
60
60
  `;
61
- const RatingHeader = ({ ratings, project, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, }) => {
61
+ const RatingHeader = ({ ratings, project, index, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, projectIdToShow, }) => {
62
62
  var _a, _b, _c, _d;
63
63
  const sortedRatings = ratings.slice().sort((a, b) => new Date(b === null || b === void 0 ? void 0 : b.createdAt).getTime() - new Date(a === null || a === void 0 ? void 0 : a.createdAt).getTime());
64
64
  const mostRecentRating = sortedRatings && sortedRatings[0];
65
65
  const [openRowId, setOpenRowId] = (0, react_1.useState)(null);
66
- const [rowIndex, setRowIndex] = (0, react_1.useState)(0);
66
+ const rowIndex = index;
67
67
  const isWithinDays = (date, days) => (0, dayjs_1.default)((0, dayjs_1.default)().tz('America/Los_Angeles').format('YYYY-MM-DD HH:mm:ss')).diff((0, dayjs_1.default)(date).format('YYYY-MM-DD HH:mm:ss'), 'day') < days;
68
68
  const isWithinHours = (date, hours) => (0, dayjs_1.default)((0, dayjs_1.default)().tz('America/Los_Angeles').format('YYYY-MM-DD HH:mm:ss')).diff((0, dayjs_1.default)(date).format('YYYY-MM-DD HH:mm:ss'), 'hours') < hours;
69
69
  const currentHost = window.location.hostname === 'localhost' ? 'paro.io' : window.location.hostname.split(".").slice(1).join('.');
@@ -101,9 +101,16 @@ const RatingHeader = ({ ratings, project, highlightedRatings, requestStatus, han
101
101
  setOpenRowId(null);
102
102
  }
103
103
  };
104
+ (0, react_1.useEffect)(() => {
105
+ if (projectIdToShow) {
106
+ const headerToScrollTo = document.getElementById(`header_${projectIdToShow}`);
107
+ headerToScrollTo === null || headerToScrollTo === void 0 ? void 0 : headerToScrollTo.scrollIntoView({ behavior: 'smooth' });
108
+ toggleOpen(projectIdToShow);
109
+ }
110
+ }, [projectIdToShow]);
104
111
  const HeaderText = isClientPortal ? `${(_a = project === null || project === void 0 ? void 0 : project.freelancer) === null || _a === void 0 ? void 0 : _a.name} - ${project === null || project === void 0 ? void 0 : project.name}` : project === null || project === void 0 ? void 0 : project.name;
105
112
  return (react_1.default.createElement(react_1.default.Fragment, null,
106
- react_1.default.createElement("div", { className: "flex flex-row justify-between mt-4 items-center max-w-full" },
113
+ react_1.default.createElement("div", { className: "flex flex-row justify-between mt-4 items-center max-w-full", id: `header_${index}` },
107
114
  react_1.default.createElement("b", { className: "flex-grow" }, HeaderText),
108
115
  react_1.default.createElement("div", { className: "flex flex-row justify-evenly items-center gap-x-4" },
109
116
  react_1.default.createElement("div", { className: "flex flex-row justify-between gap-x-2 bg-[#F1F5F9] p-2 rounded-md" },
@@ -96,7 +96,7 @@ const RatingSection = ({ rating, ratingIndex, handleAddToProfile, highlightedRat
96
96
  react_1.default.createElement("span", { className: 'mr-20 bg-[#F1F5F9] p-2 rounded-md' },
97
97
  " Date Given: ",
98
98
  (0, dayjs_1.default)(rating === null || rating === void 0 ? void 0 : rating.createdAt).format('MM/DD/YYYY')),
99
- (!isClientPortal || (rating === null || rating === void 0 ? void 0 : rating.review)) && react_1.default.createElement(AddToProfileButton, { handleAddToProfile: handleAddToProfile, disableAddToProfile: disableAddToProfile, isLoading: isLoading, label: ratingButtonText(), rating: rating })),
99
+ (!isClientPortal && (rating === null || rating === void 0 ? void 0 : rating.review)) && react_1.default.createElement(AddToProfileButton, { handleAddToProfile: handleAddToProfile, disableAddToProfile: disableAddToProfile, isLoading: isLoading, label: ratingButtonText(), rating: rating })),
100
100
  react_1.default.createElement("div", { className: 'flex flex-row items-start gap-x-6 p-4 ml-6' },
101
101
  react_1.default.createElement("div", { className: "flex flex-col gap-y-4 w-1/3" },
102
102
  react_1.default.createElement(core_1.Box, null,
@@ -106,7 +106,7 @@ const RatingSection = ({ rating, ratingIndex, handleAddToProfile, highlightedRat
106
106
  RenderRatingRow(react_1.default.createElement(base_icons_1.IconPresentationPitch, null), 'Execution of Deliverables', rating === null || rating === void 0 ? void 0 : rating.executionOfDeliverablesRating),
107
107
  RenderRatingRow(react_1.default.createElement(base_icons_1.IconClock, null), 'Timeliness of Deliverables', rating === null || rating === void 0 ? void 0 : rating.timelinessRating)),
108
108
  react_1.default.createElement("div", { className: "w-2/3 flex flex-col align-center relative" },
109
- react_1.default.createElement("p", { className: `w-4/5 ${(rating === null || rating === void 0 ? void 0 : rating.response) ? 'text-left' : 'center'} ml-16 mb-8` },
109
+ react_1.default.createElement("p", { className: `w-4/5 ${(rating === null || rating === void 0 ? void 0 : rating.response) ? 'text-left' : 'center'} ml-10 mb-8` },
110
110
  react_1.default.createElement(TruncateText_1.default, { text: reviewText, limit: 250 })),
111
111
  react_1.default.createElement("div", { className: "flex flex-col justify-end" },
112
112
  (rating === null || rating === void 0 ? void 0 : rating.response) && (react_1.default.createElement("p", { className: "w-4/5 text-left ml-auto" },
@@ -9,6 +9,7 @@ interface ReviewsTabProps {
9
9
  isClientPortal?: boolean;
10
10
  isInternal?: boolean;
11
11
  getparoProjectsByClientIdDocument?: any;
12
+ projectIdToShow?: string;
12
13
  }
13
14
  interface ToastNotificationProps {
14
15
  color?: 'success' | 'info' | 'warning' | 'danger';
@@ -20,5 +21,5 @@ interface ToastNotificationProps {
20
21
  }
21
22
  export declare const RatingsBar: (data: any) => JSX.Element;
22
23
  export declare const toastNotification: ({ className, color, icon, message, position, style, }: ToastNotificationProps) => string;
23
- export declare const ReviewsTab: ({ paroProjectsData, legacyFreelancerId, expertName, getParoProjectsDocument, createOrUpdateRating, createOrUpdateRatingRequestMutation, isClientPortal, isInternal, getparoProjectsByClientIdDocument, }: ReviewsTabProps) => JSX.Element;
24
+ export declare const ReviewsTab: ({ paroProjectsData, legacyFreelancerId, expertName, getParoProjectsDocument, createOrUpdateRating, createOrUpdateRatingRequestMutation, isClientPortal, isInternal, getparoProjectsByClientIdDocument, projectIdToShow, }: ReviewsTabProps) => JSX.Element;
24
25
  export {};
@@ -199,11 +199,11 @@ const toastNotification = ({ className, color = 'success', icon = 'success', mes
199
199
  });
200
200
  };
201
201
  exports.toastNotification = toastNotification;
202
- const ReviewsTab = ({ paroProjectsData, legacyFreelancerId, expertName, getParoProjectsDocument, createOrUpdateRating, createOrUpdateRatingRequestMutation, isClientPortal = false, isInternal = false, getparoProjectsByClientIdDocument, }) => {
202
+ const ReviewsTab = ({ paroProjectsData, legacyFreelancerId, expertName, getParoProjectsDocument, createOrUpdateRating, createOrUpdateRatingRequestMutation, isClientPortal = false, isInternal = false, getparoProjectsByClientIdDocument, projectIdToShow, }) => {
203
203
  const [loadingSubmitId, setLoadingSubmitId] = (0, react_1.useState)(null);
204
204
  const [orderBy, setOrderBy] = react_1.default.useState('');
205
205
  const [highlightedRatings, setHighlightedRatings] = (0, react_1.useState)(paroProjectsData);
206
- const [openRowId, setOpenRowId] = (0, react_1.useState)([]);
206
+ const [openRowId, setOpenRowId] = (0, react_1.useState)(isClientPortal && projectIdToShow ? [0] : []);
207
207
  const [selectedButton, setSelectedButton] = (0, react_1.useState)('');
208
208
  const [searchText, setSearchText] = (0, react_1.useState)('');
209
209
  const [openAllRows, setOpenAllRows] = (0, react_1.useState)(true);
@@ -333,6 +333,6 @@ const ReviewsTab = ({ paroProjectsData, legacyFreelancerId, expertName, getParoP
333
333
  react_1.default.createElement(SortButtons, { selectedButton: selectedButton, handleSelectableButton: handleSelectableButton, isClientPortal: isClientPortal !== null && isClientPortal !== void 0 ? isClientPortal : false }),
334
334
  react_1.default.createElement(core_1.Box, { pt: 3 },
335
335
  react_1.default.createElement(core_1.Divider, null)),
336
- react_1.default.createElement(ProjectReviewsSection_1.default, { uniqueClients: uniqueClients, paroProjectsData: isClientPortal ? highlightedRatings : paroProjectsData, openRowId: openRowId, openAllRows: openAllRows, toggleOpen: toggleOpen, expertName: expertName, legacyFreelancerId: legacyFreelancerId, getParoProjectsDocument: getParoProjectsDocument, handleAddToProfile: handleAddToProfile, highlightedRatings: highlightedRatings, setHighlightedRatings: setHighlightedRatings, loadingSubmitId: loadingSubmitId, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, selectedButton: selectedButton, isClientPortal: isClientPortal, isInternal: isInternal, createOrUpdateRating: createOrUpdateRating, getparoProjectsByClientIdDocument: getparoProjectsByClientIdDocument })));
336
+ react_1.default.createElement(ProjectReviewsSection_1.default, { uniqueClients: uniqueClients, paroProjectsData: isClientPortal ? highlightedRatings : paroProjectsData, openRowId: openRowId, openAllRows: openAllRows, toggleOpen: toggleOpen, expertName: expertName, legacyFreelancerId: legacyFreelancerId, getParoProjectsDocument: getParoProjectsDocument, handleAddToProfile: handleAddToProfile, highlightedRatings: highlightedRatings, setHighlightedRatings: setHighlightedRatings, loadingSubmitId: loadingSubmitId, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, selectedButton: selectedButton, isClientPortal: isClientPortal, isInternal: isInternal, createOrUpdateRating: createOrUpdateRating, getparoProjectsByClientIdDocument: getparoProjectsByClientIdDocument, projectIdToShow: projectIdToShow })));
337
337
  };
338
338
  exports.ReviewsTab = ReviewsTab;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {