@paro.io/expert-shared-components 1.9.10 → 1.9.12
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.
|
@@ -104,7 +104,7 @@ const getDays = (oldValue, newValue) => {
|
|
|
104
104
|
return newDate.diff(oldDate, 'day');
|
|
105
105
|
};
|
|
106
106
|
const ActiveProjectCard = ({ project, projectsData, expertName, freelancerId, freelancerEmail, isAuthenticated, activeProject, adhocProject, upcomingProject, selectedTab, projectTagsMap, updateProjectStatusMutation, GetAllProjectIrprDetailsForFreelancerDocument, updateParoProjectTagsMutation, GetParoProjectsDocument, updateProjectTagReviewStatusMutation, updateProjectStatus, updateProjectTags, getSowLazyQuery, sendParoSupportEmail, createChangeRequestMutation, createChangeRequest, createOrUpdateRatingRequestMutation, updateProjectTaskMutation, updateProjectTask, submitProjectHoursMutation, getAuth0Roles, submitProjectHoursLambda, createOrUpdateRating, getParoProjectsByClientIdDocument, user, internalPortal = false, csmUserGroup = false, clientPortal = false, signedSow = false, isStageProd, isRequestReviewEnabled = false, changeRequests, GetAllChangeRequestsForFreelancerDocument, updateProjectRequestStatus, updateDBProjectRequestStatus, }) => {
|
|
107
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
107
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
108
108
|
const [editEndDate, setEditEndDate] = (0, react_1.useState)(false);
|
|
109
109
|
const [editStartDate, setEditStartDate] = (0, react_1.useState)(false);
|
|
110
110
|
const [showTimeModal, setShowTimeModal] = (0, react_1.useState)(false);
|
|
@@ -116,23 +116,22 @@ const ActiveProjectCard = ({ project, projectsData, expertName, freelancerId, fr
|
|
|
116
116
|
const checkStartDate = (0, dayjs_1.default)(project === null || project === void 0 ? void 0 : project.startDate).isSame((0, dayjs_1.default)(), 'day') || (0, dayjs_1.default)(project === null || project === void 0 ? void 0 : project.startDate).isAfter((0, dayjs_1.default)());
|
|
117
117
|
const classes = (0, exports.useStyles)();
|
|
118
118
|
let sumOfRatingValuesOfSingleProject = 0;
|
|
119
|
-
project === null || project === void 0 ? void 0 : project.rating.forEach((rating) => sumOfRatingValuesOfSingleProject += rating.overallRating);
|
|
120
|
-
const [ratingValue, setRatingValue] = (0, react_1.useState)((sumOfRatingValuesOfSingleProject / ((
|
|
119
|
+
(_d = project === null || project === void 0 ? void 0 : project.rating) === null || _d === void 0 ? void 0 : _d.forEach((rating) => sumOfRatingValuesOfSingleProject += rating.overallRating);
|
|
120
|
+
const [ratingValue, setRatingValue] = (0, react_1.useState)((sumOfRatingValuesOfSingleProject / ((_e = project === null || project === void 0 ? void 0 : project.rating) === null || _e === void 0 ? void 0 : _e.length)).toFixed(1));
|
|
121
121
|
(0, react_1.useEffect)(() => {
|
|
122
122
|
setSingleProjectData(projectsData.find((projectData) => projectData.id === (project === null || project === void 0 ? void 0 : project.id)));
|
|
123
123
|
}, [projectsData, project]);
|
|
124
124
|
const sortRatingsAndRequests = (data) => {
|
|
125
125
|
return [...data].sort((a, b) => (0, dayjs_1.default)(b === null || b === void 0 ? void 0 : b.createdAt).diff((0, dayjs_1.default)(a === null || a === void 0 ? void 0 : a.createdAt), 'days'));
|
|
126
126
|
};
|
|
127
|
-
if ((project === null || project === void 0 ? void 0 : project.rating.length) > 1) {
|
|
127
|
+
if ((project === null || project === void 0 ? void 0 : project.rating) && (project === null || project === void 0 ? void 0 : project.rating.length) > 1) {
|
|
128
128
|
project.rating = sortRatingsAndRequests(project.rating);
|
|
129
129
|
}
|
|
130
|
-
if ((project === null || project === void 0 ? void 0 : project.ratingRequest.length) > 1) {
|
|
130
|
+
if ((project === null || project === void 0 ? void 0 : project.ratingRequest) && (project === null || project === void 0 ? void 0 : project.ratingRequest.length) > 1) {
|
|
131
131
|
project.ratingRequest = sortRatingsAndRequests(project.ratingRequest);
|
|
132
132
|
}
|
|
133
|
-
const showRating = ratingValue && (0, dayjs_1.default)((0, dayjs_1.default)().tz('America/Los_Angeles').format('YYYY-MM-DD HH:mm:ss')).diff((0, dayjs_1.default)((
|
|
134
|
-
const
|
|
135
|
-
const displayName = clientPortal ? freelancerName : (_r = project === null || project === void 0 ? void 0 : project.client) === null || _r === void 0 ? void 0 : _r.name;
|
|
133
|
+
const showRating = ratingValue && (0, dayjs_1.default)((0, dayjs_1.default)().tz('America/Los_Angeles').format('YYYY-MM-DD HH:mm:ss')).diff((0, dayjs_1.default)((_g = (_f = project === null || project === void 0 ? void 0 : project.rating) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.createdAt.replace('Z', '')).format('YYYY-MM-DD HH:mm:ss'), 'hours') > 48;
|
|
134
|
+
const displayName = clientPortal ? expertName : (_h = project === null || project === void 0 ? void 0 : project.client) === null || _h === void 0 ? void 0 : _h.name;
|
|
136
135
|
return (react_1.default.createElement("div", { className: "w-full mb-8" },
|
|
137
136
|
internalPortal && changeRequests && changeRequests.length > 0 && (react_1.default.createElement("div", null, changeRequests
|
|
138
137
|
.filter((cr) => cr.entityId === project.id)
|
|
@@ -160,7 +159,7 @@ const ActiveProjectCard = ({ project, projectsData, expertName, freelancerId, fr
|
|
|
160
159
|
react_1.default.createElement("div", { className: "flex flex-col-reverse justify-between w-full mt-3 md:flex-row gap-y-4" },
|
|
161
160
|
react_1.default.createElement("div", { className: "flex flex-col" },
|
|
162
161
|
react_1.default.createElement("h1", null, displayName),
|
|
163
|
-
react_1.default.createElement("p", { className: "font-bold text-md mt-1" }, `${(
|
|
162
|
+
react_1.default.createElement("p", { className: "font-bold text-md mt-1" }, `${(_j = project === null || project === void 0 ? void 0 : project.name) !== null && _j !== void 0 ? _j : "Project"} ${(singleProjectData === null || singleProjectData === void 0 ? void 0 : singleProjectData.minFloorHours) ? "WITH" : "WITHOUT"} a min floor.`)),
|
|
164
163
|
react_1.default.createElement("div", { className: "flex flex-row gap-x-2 items-center ml-auto" },
|
|
165
164
|
showRating && react_1.default.createElement("div", { className: "flex flex-auto items-center justify-between" },
|
|
166
165
|
react_1.default.createElement(lab_1.Rating, { name: "read-only", value: Number(ratingValue), precision: 0.5, size: "large", readOnly: true, emptyIcon: react_1.default.createElement(Star_1.default, { fontSize: "inherit" }) })),
|
|
@@ -213,9 +213,9 @@ const RightCardUI = ({ project, expertName, freelancerId, freelancerEmail, isAut
|
|
|
213
213
|
}, isLoading: sowLoading }),
|
|
214
214
|
signedSow &&
|
|
215
215
|
react_1.default.createElement(base_ui_1.Button, { label: "SUBMIT REVIEW", size: "sm", className: "w-full", onClick: () => setOpenReviewModal(true) })),
|
|
216
|
-
react_1.default.createElement("div", { className: "gap-y-1 mt-4" },
|
|
216
|
+
!clientPortal && react_1.default.createElement("div", { className: "gap-y-1 mt-4" },
|
|
217
217
|
react_1.default.createElement("div", { className: "flex flex-row justify-between" },
|
|
218
|
-
react_1.default.createElement("h1", { className: "font-bold text-lg mb-2" },
|
|
218
|
+
react_1.default.createElement("h1", { className: "font-bold text-lg mb-2" }, "Client Contact"),
|
|
219
219
|
react_1.default.createElement("button", { onClick: () => { setExpandClient(!expandClient); }, className: "font-bold text-md mb-2" }, expandClient ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null))),
|
|
220
220
|
expandClient && react_1.default.createElement("div", { className: "m-1 overflow-auto" },
|
|
221
221
|
react_1.default.createElement("p", null, (_g = project === null || project === void 0 ? void 0 : project.client) === null || _g === void 0 ? void 0 : _g.name),
|