@paro.io/expert-shared-components 1.9.10 → 1.9.11
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, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
107
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
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,8 +116,8 @@ 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]);
|
|
@@ -130,9 +130,9 @@ const ActiveProjectCard = ({ project, projectsData, expertName, freelancerId, fr
|
|
|
130
130
|
if ((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 freelancerName = (
|
|
135
|
-
const displayName = clientPortal ? freelancerName : (
|
|
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 freelancerName = (_k = (_j = (_h = project === null || project === void 0 ? void 0 : project.projectScope) === null || _h === void 0 ? void 0 : _h.freelancer) === null || _j === void 0 ? void 0 : _j.name) !== null && _k !== void 0 ? _k : ((_o = (_m = (_l = project === null || project === void 0 ? void 0 : project.projectScope) === null || _l === void 0 ? void 0 : _l.freelancer) === null || _m === void 0 ? void 0 : _m.freelancerProfile) === null || _o === void 0 ? void 0 : _o.firstName) + ' ' + ((_r = (_q = (_p = project === null || project === void 0 ? void 0 : project.projectScope) === null || _p === void 0 ? void 0 : _p.freelancer) === null || _q === void 0 ? void 0 : _q.freelancerProfile) === null || _r === void 0 ? void 0 : _r.lastName);
|
|
135
|
+
const displayName = clientPortal ? freelancerName : (_s = project === null || project === void 0 ? void 0 : project.client) === null || _s === void 0 ? void 0 : _s.name;
|
|
136
136
|
return (react_1.default.createElement("div", { className: "w-full mb-8" },
|
|
137
137
|
internalPortal && changeRequests && changeRequests.length > 0 && (react_1.default.createElement("div", null, changeRequests
|
|
138
138
|
.filter((cr) => cr.entityId === project.id)
|
|
@@ -160,7 +160,7 @@ const ActiveProjectCard = ({ project, projectsData, expertName, freelancerId, fr
|
|
|
160
160
|
react_1.default.createElement("div", { className: "flex flex-col-reverse justify-between w-full mt-3 md:flex-row gap-y-4" },
|
|
161
161
|
react_1.default.createElement("div", { className: "flex flex-col" },
|
|
162
162
|
react_1.default.createElement("h1", null, displayName),
|
|
163
|
-
react_1.default.createElement("p", { className: "font-bold text-md mt-1" }, `${(
|
|
163
|
+
react_1.default.createElement("p", { className: "font-bold text-md mt-1" }, `${(_t = project === null || project === void 0 ? void 0 : project.name) !== null && _t !== void 0 ? _t : "Project"} ${(singleProjectData === null || singleProjectData === void 0 ? void 0 : singleProjectData.minFloorHours) ? "WITH" : "WITHOUT"} a min floor.`)),
|
|
164
164
|
react_1.default.createElement("div", { className: "flex flex-row gap-x-2 items-center ml-auto" },
|
|
165
165
|
showRating && react_1.default.createElement("div", { className: "flex flex-auto items-center justify-between" },
|
|
166
166
|
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),
|