@paro.io/expert-shared-components 1.14.10 → 1.14.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.
- package/LICENSE +21 -21
- package/README.md +2 -2
- package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
- package/lib/components/ClientReferencesSection/ParoError.js +10 -10
- package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
- package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
- package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
- package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
- package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
- package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
- package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
- package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
- package/lib/components/DiscussionThread/chat.d.ts +22 -22
- package/lib/components/DiscussionThread/chat.js +106 -106
- package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
- package/lib/components/DocumentCenter/DocumentTable.js +350 -350
- package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
- package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
- package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
- package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
- package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
- package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
- package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
- package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
- package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
- package/lib/components/EarningsTracker/EditDateModal.js +149 -149
- package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
- package/lib/components/EarningsTracker/EmailModal.js +79 -79
- package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
- package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
- package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
- package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
- package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
- package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
- package/lib/components/EarningsTracker/ProgressBar.js +66 -66
- package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
- package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
- package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
- package/lib/components/EarningsTracker/RightCardUI.js +231 -231
- package/lib/components/EarningsTracker/index.d.ts +1 -1
- package/lib/components/EarningsTracker/index.js +5 -5
- package/lib/components/Escalations/AccountSuspensionBanner.js +9 -4
- package/lib/components/Escalations/CustomTag.d.ts +3 -3
- package/lib/components/Escalations/CustomTag.js +25 -25
- package/lib/components/Escalations/ViewReponseModal.d.ts +8 -8
- package/lib/components/Escalations/ViewReponseModal.js +27 -27
- package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
- package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
- package/lib/components/Invoices/DiscussionSection.js +22 -2
- package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
- package/lib/components/Invoices/TestDecisionSection.js +126 -126
- package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
- package/lib/components/OrganizationChart/PersonCard.js +5 -5
- package/lib/components/OrganizationChart/utils.js +79 -79
- package/lib/components/ProjectCard/ProgressBar.js +4 -4
- package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
- package/lib/components/ProjectIntelligence/MissingInformation/index.js +1 -1
- package/lib/components/Reviews/Pagination.js +6 -6
- package/lib/components/ReviewsTab/RatingHeader.js +6 -6
- package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
- package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
- package/lib/components/shared/Image.js +13 -13
- package/lib/components/shared/ProfileTextField.d.ts +18 -18
- package/lib/components/shared/ProfileTextField.js +16 -16
- package/lib/components/shared/StyledActionButtons.d.ts +7 -7
- package/lib/components/shared/StyledActionButtons.js +15 -15
- package/lib/components/shared/ToastNotification.d.ts +10 -10
- package/lib/components/shared/ToastNotification.js +63 -63
- package/package.json +67 -67
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
interface UploadFilesButtonProps {
|
|
2
|
-
onFileSelect: (file: File) => void;
|
|
3
|
-
isLoading?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export declare const UploadFilesButton: ({ onFileSelect, isLoading, }: UploadFilesButtonProps) => JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
interface UploadFilesButtonProps {
|
|
2
|
+
onFileSelect: (file: File) => void;
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const UploadFilesButton: ({ onFileSelect, isLoading, }: UploadFilesButtonProps) => JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UploadFilesButton = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const base_ui_1 = require("@paro.io/base-ui");
|
|
9
|
-
const react_2 = require("react");
|
|
10
|
-
const UploadFilesButton = ({ onFileSelect, isLoading, }) => {
|
|
11
|
-
const fileInputRef = (0, react_2.useRef)(null);
|
|
12
|
-
const handleClick = () => {
|
|
13
|
-
var _a;
|
|
14
|
-
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
15
|
-
};
|
|
16
|
-
const handleFileChange = (event) => {
|
|
17
|
-
var _a;
|
|
18
|
-
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
19
|
-
if (file) {
|
|
20
|
-
onFileSelect(file);
|
|
21
|
-
}
|
|
22
|
-
// Reset input value to allow uploading the same file again
|
|
23
|
-
event.target.value = '';
|
|
24
|
-
};
|
|
25
|
-
return (react_1.default.createElement("div", null,
|
|
26
|
-
react_1.default.createElement("input", { type: "file", ref: fileInputRef, onChange: handleFileChange, className: "hidden", accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx" }),
|
|
27
|
-
react_1.default.createElement(base_ui_1.Button, { onClick: handleClick, disabled: isLoading })));
|
|
28
|
-
};
|
|
29
|
-
exports.UploadFilesButton = UploadFilesButton;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.UploadFilesButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const UploadFilesButton = ({ onFileSelect, isLoading, }) => {
|
|
11
|
+
const fileInputRef = (0, react_2.useRef)(null);
|
|
12
|
+
const handleClick = () => {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
15
|
+
};
|
|
16
|
+
const handleFileChange = (event) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
19
|
+
if (file) {
|
|
20
|
+
onFileSelect(file);
|
|
21
|
+
}
|
|
22
|
+
// Reset input value to allow uploading the same file again
|
|
23
|
+
event.target.value = '';
|
|
24
|
+
};
|
|
25
|
+
return (react_1.default.createElement("div", null,
|
|
26
|
+
react_1.default.createElement("input", { type: "file", ref: fileInputRef, onChange: handleFileChange, className: "hidden", accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx" }),
|
|
27
|
+
react_1.default.createElement(base_ui_1.Button, { onClick: handleClick, disabled: isLoading })));
|
|
28
|
+
};
|
|
29
|
+
exports.UploadFilesButton = UploadFilesButton;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"tooltip">;
|
|
3
|
-
interface ActiveProjectCardProps {
|
|
4
|
-
project: any;
|
|
5
|
-
projectsData: any;
|
|
6
|
-
expertName: string;
|
|
7
|
-
freelancerId: number;
|
|
8
|
-
freelancerEmail: string;
|
|
9
|
-
isAuthenticated: boolean;
|
|
10
|
-
activeProject?: boolean;
|
|
11
|
-
adhocProject?: boolean;
|
|
12
|
-
upcomingProject?: boolean;
|
|
13
|
-
selectedTab: number;
|
|
14
|
-
projectTagsMap?: any;
|
|
15
|
-
updateProjectStatusMutation: any;
|
|
16
|
-
GetAllProjectIrprDetailsForFreelancerDocument: any;
|
|
17
|
-
updateParoProjectTagsMutation: any;
|
|
18
|
-
GetParoProjectsDocument: any;
|
|
19
|
-
updateProjectTagReviewStatusMutation: any;
|
|
20
|
-
getSowLazyQuery: any;
|
|
21
|
-
createChangeRequestMutation: any;
|
|
22
|
-
createOrUpdateRatingRequestMutation: any;
|
|
23
|
-
updateProjectTaskMutation: any;
|
|
24
|
-
submitProjectHoursMutation: any;
|
|
25
|
-
getAuth0Roles: any;
|
|
26
|
-
user: any;
|
|
27
|
-
internalPortal?: boolean;
|
|
28
|
-
csmUserGroup?: boolean;
|
|
29
|
-
clientPortal?: boolean;
|
|
30
|
-
signedSow?: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface unAuthProps {
|
|
33
|
-
updateProjectStatus?: any;
|
|
34
|
-
updateProjectTags?: any;
|
|
35
|
-
sendParoSupportEmail?: any;
|
|
36
|
-
submitProjectHoursLambda?: any;
|
|
37
|
-
updateProjectTask?: any;
|
|
38
|
-
createChangeRequest?: any;
|
|
39
|
-
}
|
|
40
|
-
export declare const CheckItem: ({ checked, text }: any) => React.JSX.Element;
|
|
41
|
-
export declare const getAllProjectRecommendationData: ({ projectData }: any) => {
|
|
42
|
-
minFloorHours: any;
|
|
43
|
-
maxFloorHours: any;
|
|
44
|
-
loggedHours: string | number;
|
|
45
|
-
weeklyHoursLogged: any;
|
|
46
|
-
hoursPerWeek: number | false;
|
|
47
|
-
minFloorName: string;
|
|
48
|
-
hoursToComplete: number | false;
|
|
49
|
-
remainingWeeks: number;
|
|
50
|
-
};
|
|
51
|
-
export declare 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, user, internalPortal, csmUserGroup, clientPortal, signedSow, }: ActiveProjectCardProps & unAuthProps) => JSX.Element;
|
|
52
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const useStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"tooltip">;
|
|
3
|
+
interface ActiveProjectCardProps {
|
|
4
|
+
project: any;
|
|
5
|
+
projectsData: any;
|
|
6
|
+
expertName: string;
|
|
7
|
+
freelancerId: number;
|
|
8
|
+
freelancerEmail: string;
|
|
9
|
+
isAuthenticated: boolean;
|
|
10
|
+
activeProject?: boolean;
|
|
11
|
+
adhocProject?: boolean;
|
|
12
|
+
upcomingProject?: boolean;
|
|
13
|
+
selectedTab: number;
|
|
14
|
+
projectTagsMap?: any;
|
|
15
|
+
updateProjectStatusMutation: any;
|
|
16
|
+
GetAllProjectIrprDetailsForFreelancerDocument: any;
|
|
17
|
+
updateParoProjectTagsMutation: any;
|
|
18
|
+
GetParoProjectsDocument: any;
|
|
19
|
+
updateProjectTagReviewStatusMutation: any;
|
|
20
|
+
getSowLazyQuery: any;
|
|
21
|
+
createChangeRequestMutation: any;
|
|
22
|
+
createOrUpdateRatingRequestMutation: any;
|
|
23
|
+
updateProjectTaskMutation: any;
|
|
24
|
+
submitProjectHoursMutation: any;
|
|
25
|
+
getAuth0Roles: any;
|
|
26
|
+
user: any;
|
|
27
|
+
internalPortal?: boolean;
|
|
28
|
+
csmUserGroup?: boolean;
|
|
29
|
+
clientPortal?: boolean;
|
|
30
|
+
signedSow?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface unAuthProps {
|
|
33
|
+
updateProjectStatus?: any;
|
|
34
|
+
updateProjectTags?: any;
|
|
35
|
+
sendParoSupportEmail?: any;
|
|
36
|
+
submitProjectHoursLambda?: any;
|
|
37
|
+
updateProjectTask?: any;
|
|
38
|
+
createChangeRequest?: any;
|
|
39
|
+
}
|
|
40
|
+
export declare const CheckItem: ({ checked, text }: any) => React.JSX.Element;
|
|
41
|
+
export declare const getAllProjectRecommendationData: ({ projectData }: any) => {
|
|
42
|
+
minFloorHours: any;
|
|
43
|
+
maxFloorHours: any;
|
|
44
|
+
loggedHours: string | number;
|
|
45
|
+
weeklyHoursLogged: any;
|
|
46
|
+
hoursPerWeek: number | false;
|
|
47
|
+
minFloorName: string;
|
|
48
|
+
hoursToComplete: number | false;
|
|
49
|
+
remainingWeeks: number;
|
|
50
|
+
};
|
|
51
|
+
export declare 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, user, internalPortal, csmUserGroup, clientPortal, signedSow, }: ActiveProjectCardProps & unAuthProps) => JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ActiveProjectCard = exports.getAllProjectRecommendationData = exports.CheckItem = exports.useStyles = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const base_icons_1 = require("@paro.io/base-icons");
|
|
32
|
-
const base_ui_1 = require("@paro.io/base-ui");
|
|
33
|
-
const core_1 = require("@material-ui/core");
|
|
34
|
-
const lab_1 = require("@material-ui/lab");
|
|
35
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
36
|
-
const styles_1 = require("@material-ui/core/styles");
|
|
37
|
-
const moment_1 = __importDefault(require("moment"));
|
|
38
|
-
const Star_1 = __importDefault(require("@material-ui/icons/Star"));
|
|
39
|
-
const RightCardUI_1 = require("./RightCardUI");
|
|
40
|
-
const LeftCardUI_1 = require("./LeftCardUI");
|
|
41
|
-
const CenterCardUI_1 = require("./CenterCardUI");
|
|
42
|
-
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
43
|
-
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
44
|
-
dayjs_1.default.extend(utc_1.default);
|
|
45
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
46
|
-
exports.useStyles = (0, styles_1.makeStyles)({
|
|
47
|
-
tooltip: {
|
|
48
|
-
fontSize: ".9em",
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
const CheckItem = ({ checked, text }) => (react_1.default.createElement("div", { className: "p-2 w-full border-2 border-solid border-[#F1F5F9] rounded-md flex items-center" },
|
|
52
|
-
checked ? react_1.default.createElement(base_icons_1.IconCheck, { className: "mr-2 text-[#248384]" }) : react_1.default.createElement(base_icons_1.IconX, { className: "mr-2 text-[#A73A43]" }),
|
|
53
|
-
react_1.default.createElement("p", null, text)));
|
|
54
|
-
exports.CheckItem = CheckItem;
|
|
55
|
-
const getAllProjectRecommendationData = ({ projectData }) => {
|
|
56
|
-
var _a;
|
|
57
|
-
const date = (0, moment_1.default)();
|
|
58
|
-
const lastDayOfMonth = (0, moment_1.default)().endOf('month');
|
|
59
|
-
const daysLeftInProject = (0, moment_1.default)(projectData === null || projectData === void 0 ? void 0 : projectData.endDate).diff(date, 'day');
|
|
60
|
-
const checkDays = (0, moment_1.default)(projectData === null || projectData === void 0 ? void 0 : projectData.endDate).isBefore(lastDayOfMonth) ? lastDayOfMonth.date() : daysLeftInProject;
|
|
61
|
-
const remainingWeeks = Math.ceil(checkDays / 7);
|
|
62
|
-
const minFloorHours = (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== null && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== undefined && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== 0 ? projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours : projectData === null || projectData === void 0 ? void 0 : projectData.totalEstimatedMinHours;
|
|
63
|
-
const maxFloorHours = projectData === null || projectData === void 0 ? void 0 : projectData.maxHours;
|
|
64
|
-
const loggedHours = (projectData === null || projectData === void 0 ? void 0 : projectData.hoursInvoiced) ? (_a = Number(projectData === null || projectData === void 0 ? void 0 : projectData.hoursInvoiced)) === null || _a === void 0 ? void 0 : _a.toFixed(2) : 0;
|
|
65
|
-
const weeklyHoursLogged = projectData === null || projectData === void 0 ? void 0 : projectData.weeklyMinHoursLogged;
|
|
66
|
-
const hoursToComplete = minFloorHours > 0 && (loggedHours >= minFloorHours ? 0 : Number(minFloorHours) - Number(loggedHours));
|
|
67
|
-
const hoursPerWeek = (hoursToComplete && remainingWeeks) && hoursToComplete / remainingWeeks;
|
|
68
|
-
const minFloorName = (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== null && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== undefined && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== 0 ? "Min Floor Hours" : "Estimated Min Hours";
|
|
69
|
-
return {
|
|
70
|
-
minFloorHours,
|
|
71
|
-
maxFloorHours,
|
|
72
|
-
loggedHours,
|
|
73
|
-
weeklyHoursLogged,
|
|
74
|
-
hoursPerWeek,
|
|
75
|
-
minFloorName,
|
|
76
|
-
hoursToComplete,
|
|
77
|
-
remainingWeeks
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
exports.getAllProjectRecommendationData = getAllProjectRecommendationData;
|
|
81
|
-
const checkProjectFrequencyType = (projectFrequencyId) => {
|
|
82
|
-
let projectFrequencyType = '';
|
|
83
|
-
if (projectFrequencyId === 1 || projectFrequencyId === 2) {
|
|
84
|
-
projectFrequencyType = "Recurring";
|
|
85
|
-
}
|
|
86
|
-
else if (projectFrequencyId === 3) {
|
|
87
|
-
projectFrequencyType = "One-time";
|
|
88
|
-
}
|
|
89
|
-
return projectFrequencyType;
|
|
90
|
-
};
|
|
91
|
-
const checkProjectRateType = (freelanceRateTypeId) => {
|
|
92
|
-
let projectType = '';
|
|
93
|
-
if (freelanceRateTypeId === 1) {
|
|
94
|
-
projectType = "Hourly";
|
|
95
|
-
}
|
|
96
|
-
else if (freelanceRateTypeId === 2) {
|
|
97
|
-
projectType = "Fixed";
|
|
98
|
-
}
|
|
99
|
-
return projectType;
|
|
100
|
-
};
|
|
101
|
-
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, user, internalPortal = false, csmUserGroup = false, clientPortal = false, signedSow = false, }) => {
|
|
102
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
103
|
-
const [editEndDate, setEditEndDate] = (0, react_1.useState)(false);
|
|
104
|
-
const [editStartDate, setEditStartDate] = (0, react_1.useState)(false);
|
|
105
|
-
const [showTimeModal, setShowTimeModal] = (0, react_1.useState)(false);
|
|
106
|
-
const [singleProjectData, setSingleProjectData] = (0, react_1.useState)();
|
|
107
|
-
const projectHealth = (_a = project === null || project === void 0 ? void 0 : project.healthGrade) !== null && _a !== void 0 ? _a : "!";
|
|
108
|
-
const [expand, setExpand] = (0, react_1.useState)(projectHealth === "!" ? true : false);
|
|
109
|
-
const projectRateType = checkProjectRateType((_b = project === null || project === void 0 ? void 0 : project.projectScope) === null || _b === void 0 ? void 0 : _b.freelanceRateTypeId);
|
|
110
|
-
const projectFrequencyType = checkProjectFrequencyType((_c = project === null || project === void 0 ? void 0 : project.projectScope) === null || _c === void 0 ? void 0 : _c.projectFrequencyId);
|
|
111
|
-
const checkStartDate = (0, moment_1.default)(project === null || project === void 0 ? void 0 : project.startDate).isSameOrAfter((0, moment_1.default)());
|
|
112
|
-
const classes = (0, exports.useStyles)();
|
|
113
|
-
let sumOfRatingValuesOfSingleProject = 0;
|
|
114
|
-
project === null || project === void 0 ? void 0 : project.rating.forEach((rating) => sumOfRatingValuesOfSingleProject += rating.overallRating);
|
|
115
|
-
const [ratingValue, setRatingValue] = (0, react_1.useState)((sumOfRatingValuesOfSingleProject / ((_d = project === null || project === void 0 ? void 0 : project.rating) === null || _d === void 0 ? void 0 : _d.length)).toFixed(1));
|
|
116
|
-
(0, react_1.useEffect)(() => {
|
|
117
|
-
setSingleProjectData(projectsData.find((projectData) => projectData.id === (project === null || project === void 0 ? void 0 : project.id)));
|
|
118
|
-
}, [projectsData, project]);
|
|
119
|
-
const sortRatingsAndRequests = (data) => {
|
|
120
|
-
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'));
|
|
121
|
-
};
|
|
122
|
-
if ((project === null || project === void 0 ? void 0 : project.rating.length) > 1) {
|
|
123
|
-
project.rating = sortRatingsAndRequests(project.rating);
|
|
124
|
-
}
|
|
125
|
-
if ((project === null || project === void 0 ? void 0 : project.ratingRequest.length) > 1) {
|
|
126
|
-
project.ratingRequest = sortRatingsAndRequests(project.ratingRequest);
|
|
127
|
-
}
|
|
128
|
-
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)((_f = (_e = project === null || project === void 0 ? void 0 : project.rating) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.createdAt.replace('Z', '')).format('YYYY-MM-DD HH:mm:ss'), 'hours') > 48;
|
|
129
|
-
return (react_1.default.createElement("div", { className: "w-full mb-8" },
|
|
130
|
-
react_1.default.createElement("h1", { className: "font-bold text-lg m-2" }, (_g = project === null || project === void 0 ? void 0 : project.client) === null || _g === void 0 ? void 0 :
|
|
131
|
-
_g.name,
|
|
132
|
-
":",
|
|
133
|
-
" ", project === null || project === void 0 ? void 0 :
|
|
134
|
-
project.name),
|
|
135
|
-
react_1.default.createElement(core_1.Card, { style: { padding: '12px' } },
|
|
136
|
-
react_1.default.createElement("div", { className: "flex flex-col-reverse justify-between w-full mt-3 md:flex-row gap-y-4" },
|
|
137
|
-
react_1.default.createElement("div", { className: "flex flex-col" },
|
|
138
|
-
react_1.default.createElement("h1", null, (_h = project === null || project === void 0 ? void 0 : project.client) === null || _h === void 0 ? void 0 : _h.name),
|
|
139
|
-
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.`)),
|
|
140
|
-
react_1.default.createElement("div", { className: "flex flex-row gap-x-2 items-center ml-auto" },
|
|
141
|
-
showRating && react_1.default.createElement("div", { className: "flex flex-auto items-center justify-between" },
|
|
142
|
-
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" }) })),
|
|
143
|
-
(singleProjectData === null || singleProjectData === void 0 ? void 0 : singleProjectData.minFloorHours) && !adhocProject ? react_1.default.createElement(core_1.Tooltip, { classes: { tooltip: classes.tooltip }, title: "Minimum Floor Hours is the minimum amount of hours needed to log for this project.", placement: "top", arrow: true },
|
|
144
|
-
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#FDD7A5] border-2 border-solid border-[#F1F5F9] rounded-md flex place-content-center" },
|
|
145
|
-
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, "MF"))) : "",
|
|
146
|
-
(projectRateType !== "Fixed" && !adhocProject && !clientPortal) &&
|
|
147
|
-
react_1.default.createElement(core_1.Tooltip, { classes: { tooltip: classes.tooltip }, title: ['A', 'B', 'C', 'D'].includes(projectHealth) ? "This is your current grade for this project based on the amount of work you have completed to how much is expected to be completed throughout the duration of the project" : "If your project health grade is a ! log more than 60% of your Max Hours to change your grade. Please expand this section and contact your Customer Success Manager if you have questions.", placement: "top", arrow: true },
|
|
148
|
-
react_1.default.createElement("div", { className: `h-10 w-14 border-2 border-solid rounded-md flex place-content-center ${['A', 'B', 'C', 'D'].includes(projectHealth) ? (['A', 'B'].includes(projectHealth) && "bg-[#F1F5F9] border-[#A3DCD8]") || (['C', 'D'].includes(projectHealth) && "bg-[#A73A43] border-[#F9C34F]") : "bg-[#A73A43] text-[#F1F5F9] border-[#F1F5F9]"}` },
|
|
149
|
-
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, projectHealth))),
|
|
150
|
-
checkStartDate ?
|
|
151
|
-
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#F1F5F9] border-[#A3DCD8] border-2 border-solid rounded-md flex place-content-center" },
|
|
152
|
-
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, "NEW !")) : "",
|
|
153
|
-
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#F1F5F9] rounded-md flex place-content-center" },
|
|
154
|
-
react_1.default.createElement(base_ui_1.Button, { onClick: () => { setExpand(!expand); }, className: "font-bold text-md p-8", icon: expand ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null) })))),
|
|
155
|
-
expand && react_1.default.createElement("div", { className: `flex w-full p-4 gap-x-10 gap-y-10 ${projectRateType === "Fixed" ? "flex-col" : "flex-col md:flex-row"}` },
|
|
156
|
-
react_1.default.createElement(LeftCardUI_1.LeftCardUI, { projectData: singleProjectData, projectFrequencyType: projectFrequencyType, projectRateType: projectRateType, project: project, isAuthenticated: isAuthenticated, adhocProject: adhocProject, activeProject: activeProject, freelancerId: freelancerId, selectedTab: selectedTab, updateProjectTaskMutation: updateProjectTaskMutation, GetAllProjectIrprDetailsForFreelancerDocument: GetAllProjectIrprDetailsForFreelancerDocument, updateProjectTask: updateProjectTask, clientPortal: clientPortal }),
|
|
157
|
-
react_1.default.createElement("div", { className: "flex flex-col flex-grow md:flex-row gap-x-0 justify-around" },
|
|
158
|
-
react_1.default.createElement(CenterCardUI_1.CenterCardUI, { startDate: project === null || project === void 0 ? void 0 : project.startDate, endDate: project === null || project === void 0 ? void 0 : project.endDate, projectData: singleProjectData, projectRateType: projectRateType, project: project, projectFrequencyType: projectFrequencyType, adhocProject: adhocProject, clientPortal: clientPortal }),
|
|
159
|
-
react_1.default.createElement(RightCardUI_1.RightCardUI, { project: project, expertName: expertName, freelancerEmail: freelancerEmail, freelancerId: freelancerId, isAuthenticated: isAuthenticated, editEndDate: editEndDate, setEditEndDate: setEditEndDate, editStartDate: editStartDate, setEditStartDate: setEditStartDate, showTimeModal: showTimeModal, setShowTimeModal: setShowTimeModal, setSingleProjectData: setSingleProjectData, projectData: singleProjectData, checkStartDate: checkStartDate, activeProject: activeProject, projectRateType: projectRateType, projectFrequencyType: projectFrequencyType, upcomingProject: upcomingProject, selectedTab: selectedTab, showRating: !!showRating, projectTagsMap: projectTagsMap, updateProjectStatusMutation: updateProjectStatusMutation, GetAllProjectIrprDetailsForFreelancerDocument: GetAllProjectIrprDetailsForFreelancerDocument, updateParoProjectTagsMutation: updateParoProjectTagsMutation, GetParoProjectsDocument: GetParoProjectsDocument, updateProjectTagReviewStatusMutation: updateProjectTagReviewStatusMutation, updateProjectStatus: updateProjectStatus, updateProjectTags: updateProjectTags, getSowLazyQuery: getSowLazyQuery, sendParoSupportEmail: sendParoSupportEmail, createChangeRequestMutation: createChangeRequestMutation, createChangeRequest: createChangeRequest, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, submitProjectHoursMutation: submitProjectHoursMutation, getAuth0Roles: getAuth0Roles, submitProjectHoursLambda: submitProjectHoursLambda, user: user, internalPortal: internalPortal, csmUserGroup: csmUserGroup, clientPortal: clientPortal, signedSow: signedSow }))))));
|
|
160
|
-
};
|
|
161
|
-
exports.ActiveProjectCard = ActiveProjectCard;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ActiveProjectCard = exports.getAllProjectRecommendationData = exports.CheckItem = exports.useStyles = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const base_icons_1 = require("@paro.io/base-icons");
|
|
32
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
33
|
+
const core_1 = require("@material-ui/core");
|
|
34
|
+
const lab_1 = require("@material-ui/lab");
|
|
35
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
36
|
+
const styles_1 = require("@material-ui/core/styles");
|
|
37
|
+
const moment_1 = __importDefault(require("moment"));
|
|
38
|
+
const Star_1 = __importDefault(require("@material-ui/icons/Star"));
|
|
39
|
+
const RightCardUI_1 = require("./RightCardUI");
|
|
40
|
+
const LeftCardUI_1 = require("./LeftCardUI");
|
|
41
|
+
const CenterCardUI_1 = require("./CenterCardUI");
|
|
42
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
43
|
+
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
44
|
+
dayjs_1.default.extend(utc_1.default);
|
|
45
|
+
dayjs_1.default.extend(timezone_1.default);
|
|
46
|
+
exports.useStyles = (0, styles_1.makeStyles)({
|
|
47
|
+
tooltip: {
|
|
48
|
+
fontSize: ".9em",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const CheckItem = ({ checked, text }) => (react_1.default.createElement("div", { className: "p-2 w-full border-2 border-solid border-[#F1F5F9] rounded-md flex items-center" },
|
|
52
|
+
checked ? react_1.default.createElement(base_icons_1.IconCheck, { className: "mr-2 text-[#248384]" }) : react_1.default.createElement(base_icons_1.IconX, { className: "mr-2 text-[#A73A43]" }),
|
|
53
|
+
react_1.default.createElement("p", null, text)));
|
|
54
|
+
exports.CheckItem = CheckItem;
|
|
55
|
+
const getAllProjectRecommendationData = ({ projectData }) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const date = (0, moment_1.default)();
|
|
58
|
+
const lastDayOfMonth = (0, moment_1.default)().endOf('month');
|
|
59
|
+
const daysLeftInProject = (0, moment_1.default)(projectData === null || projectData === void 0 ? void 0 : projectData.endDate).diff(date, 'day');
|
|
60
|
+
const checkDays = (0, moment_1.default)(projectData === null || projectData === void 0 ? void 0 : projectData.endDate).isBefore(lastDayOfMonth) ? lastDayOfMonth.date() : daysLeftInProject;
|
|
61
|
+
const remainingWeeks = Math.ceil(checkDays / 7);
|
|
62
|
+
const minFloorHours = (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== null && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== undefined && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== 0 ? projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours : projectData === null || projectData === void 0 ? void 0 : projectData.totalEstimatedMinHours;
|
|
63
|
+
const maxFloorHours = projectData === null || projectData === void 0 ? void 0 : projectData.maxHours;
|
|
64
|
+
const loggedHours = (projectData === null || projectData === void 0 ? void 0 : projectData.hoursInvoiced) ? (_a = Number(projectData === null || projectData === void 0 ? void 0 : projectData.hoursInvoiced)) === null || _a === void 0 ? void 0 : _a.toFixed(2) : 0;
|
|
65
|
+
const weeklyHoursLogged = projectData === null || projectData === void 0 ? void 0 : projectData.weeklyMinHoursLogged;
|
|
66
|
+
const hoursToComplete = minFloorHours > 0 && (loggedHours >= minFloorHours ? 0 : Number(minFloorHours) - Number(loggedHours));
|
|
67
|
+
const hoursPerWeek = (hoursToComplete && remainingWeeks) && hoursToComplete / remainingWeeks;
|
|
68
|
+
const minFloorName = (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== null && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== undefined && (projectData === null || projectData === void 0 ? void 0 : projectData.minFloorHours) !== 0 ? "Min Floor Hours" : "Estimated Min Hours";
|
|
69
|
+
return {
|
|
70
|
+
minFloorHours,
|
|
71
|
+
maxFloorHours,
|
|
72
|
+
loggedHours,
|
|
73
|
+
weeklyHoursLogged,
|
|
74
|
+
hoursPerWeek,
|
|
75
|
+
minFloorName,
|
|
76
|
+
hoursToComplete,
|
|
77
|
+
remainingWeeks
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
exports.getAllProjectRecommendationData = getAllProjectRecommendationData;
|
|
81
|
+
const checkProjectFrequencyType = (projectFrequencyId) => {
|
|
82
|
+
let projectFrequencyType = '';
|
|
83
|
+
if (projectFrequencyId === 1 || projectFrequencyId === 2) {
|
|
84
|
+
projectFrequencyType = "Recurring";
|
|
85
|
+
}
|
|
86
|
+
else if (projectFrequencyId === 3) {
|
|
87
|
+
projectFrequencyType = "One-time";
|
|
88
|
+
}
|
|
89
|
+
return projectFrequencyType;
|
|
90
|
+
};
|
|
91
|
+
const checkProjectRateType = (freelanceRateTypeId) => {
|
|
92
|
+
let projectType = '';
|
|
93
|
+
if (freelanceRateTypeId === 1) {
|
|
94
|
+
projectType = "Hourly";
|
|
95
|
+
}
|
|
96
|
+
else if (freelanceRateTypeId === 2) {
|
|
97
|
+
projectType = "Fixed";
|
|
98
|
+
}
|
|
99
|
+
return projectType;
|
|
100
|
+
};
|
|
101
|
+
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, user, internalPortal = false, csmUserGroup = false, clientPortal = false, signedSow = false, }) => {
|
|
102
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
103
|
+
const [editEndDate, setEditEndDate] = (0, react_1.useState)(false);
|
|
104
|
+
const [editStartDate, setEditStartDate] = (0, react_1.useState)(false);
|
|
105
|
+
const [showTimeModal, setShowTimeModal] = (0, react_1.useState)(false);
|
|
106
|
+
const [singleProjectData, setSingleProjectData] = (0, react_1.useState)();
|
|
107
|
+
const projectHealth = (_a = project === null || project === void 0 ? void 0 : project.healthGrade) !== null && _a !== void 0 ? _a : "!";
|
|
108
|
+
const [expand, setExpand] = (0, react_1.useState)(projectHealth === "!" ? true : false);
|
|
109
|
+
const projectRateType = checkProjectRateType((_b = project === null || project === void 0 ? void 0 : project.projectScope) === null || _b === void 0 ? void 0 : _b.freelanceRateTypeId);
|
|
110
|
+
const projectFrequencyType = checkProjectFrequencyType((_c = project === null || project === void 0 ? void 0 : project.projectScope) === null || _c === void 0 ? void 0 : _c.projectFrequencyId);
|
|
111
|
+
const checkStartDate = (0, moment_1.default)(project === null || project === void 0 ? void 0 : project.startDate).isSameOrAfter((0, moment_1.default)());
|
|
112
|
+
const classes = (0, exports.useStyles)();
|
|
113
|
+
let sumOfRatingValuesOfSingleProject = 0;
|
|
114
|
+
project === null || project === void 0 ? void 0 : project.rating.forEach((rating) => sumOfRatingValuesOfSingleProject += rating.overallRating);
|
|
115
|
+
const [ratingValue, setRatingValue] = (0, react_1.useState)((sumOfRatingValuesOfSingleProject / ((_d = project === null || project === void 0 ? void 0 : project.rating) === null || _d === void 0 ? void 0 : _d.length)).toFixed(1));
|
|
116
|
+
(0, react_1.useEffect)(() => {
|
|
117
|
+
setSingleProjectData(projectsData.find((projectData) => projectData.id === (project === null || project === void 0 ? void 0 : project.id)));
|
|
118
|
+
}, [projectsData, project]);
|
|
119
|
+
const sortRatingsAndRequests = (data) => {
|
|
120
|
+
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'));
|
|
121
|
+
};
|
|
122
|
+
if ((project === null || project === void 0 ? void 0 : project.rating.length) > 1) {
|
|
123
|
+
project.rating = sortRatingsAndRequests(project.rating);
|
|
124
|
+
}
|
|
125
|
+
if ((project === null || project === void 0 ? void 0 : project.ratingRequest.length) > 1) {
|
|
126
|
+
project.ratingRequest = sortRatingsAndRequests(project.ratingRequest);
|
|
127
|
+
}
|
|
128
|
+
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)((_f = (_e = project === null || project === void 0 ? void 0 : project.rating) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.createdAt.replace('Z', '')).format('YYYY-MM-DD HH:mm:ss'), 'hours') > 48;
|
|
129
|
+
return (react_1.default.createElement("div", { className: "w-full mb-8" },
|
|
130
|
+
react_1.default.createElement("h1", { className: "font-bold text-lg m-2" }, (_g = project === null || project === void 0 ? void 0 : project.client) === null || _g === void 0 ? void 0 :
|
|
131
|
+
_g.name,
|
|
132
|
+
":",
|
|
133
|
+
" ", project === null || project === void 0 ? void 0 :
|
|
134
|
+
project.name),
|
|
135
|
+
react_1.default.createElement(core_1.Card, { style: { padding: '12px' } },
|
|
136
|
+
react_1.default.createElement("div", { className: "flex flex-col-reverse justify-between w-full mt-3 md:flex-row gap-y-4" },
|
|
137
|
+
react_1.default.createElement("div", { className: "flex flex-col" },
|
|
138
|
+
react_1.default.createElement("h1", null, (_h = project === null || project === void 0 ? void 0 : project.client) === null || _h === void 0 ? void 0 : _h.name),
|
|
139
|
+
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.`)),
|
|
140
|
+
react_1.default.createElement("div", { className: "flex flex-row gap-x-2 items-center ml-auto" },
|
|
141
|
+
showRating && react_1.default.createElement("div", { className: "flex flex-auto items-center justify-between" },
|
|
142
|
+
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" }) })),
|
|
143
|
+
(singleProjectData === null || singleProjectData === void 0 ? void 0 : singleProjectData.minFloorHours) && !adhocProject ? react_1.default.createElement(core_1.Tooltip, { classes: { tooltip: classes.tooltip }, title: "Minimum Floor Hours is the minimum amount of hours needed to log for this project.", placement: "top", arrow: true },
|
|
144
|
+
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#FDD7A5] border-2 border-solid border-[#F1F5F9] rounded-md flex place-content-center" },
|
|
145
|
+
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, "MF"))) : "",
|
|
146
|
+
(projectRateType !== "Fixed" && !adhocProject && !clientPortal) &&
|
|
147
|
+
react_1.default.createElement(core_1.Tooltip, { classes: { tooltip: classes.tooltip }, title: ['A', 'B', 'C', 'D'].includes(projectHealth) ? "This is your current grade for this project based on the amount of work you have completed to how much is expected to be completed throughout the duration of the project" : "If your project health grade is a ! log more than 60% of your Max Hours to change your grade. Please expand this section and contact your Customer Success Manager if you have questions.", placement: "top", arrow: true },
|
|
148
|
+
react_1.default.createElement("div", { className: `h-10 w-14 border-2 border-solid rounded-md flex place-content-center ${['A', 'B', 'C', 'D'].includes(projectHealth) ? (['A', 'B'].includes(projectHealth) && "bg-[#F1F5F9] border-[#A3DCD8]") || (['C', 'D'].includes(projectHealth) && "bg-[#A73A43] border-[#F9C34F]") : "bg-[#A73A43] text-[#F1F5F9] border-[#F1F5F9]"}` },
|
|
149
|
+
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, projectHealth))),
|
|
150
|
+
checkStartDate ?
|
|
151
|
+
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#F1F5F9] border-[#A3DCD8] border-2 border-solid rounded-md flex place-content-center" },
|
|
152
|
+
react_1.default.createElement("p", { className: "font-bold text-md self-center" }, "NEW !")) : "",
|
|
153
|
+
react_1.default.createElement("div", { className: "h-10 w-14 bg-[#F1F5F9] rounded-md flex place-content-center" },
|
|
154
|
+
react_1.default.createElement(base_ui_1.Button, { onClick: () => { setExpand(!expand); }, className: "font-bold text-md p-8", icon: expand ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null) })))),
|
|
155
|
+
expand && react_1.default.createElement("div", { className: `flex w-full p-4 gap-x-10 gap-y-10 ${projectRateType === "Fixed" ? "flex-col" : "flex-col md:flex-row"}` },
|
|
156
|
+
react_1.default.createElement(LeftCardUI_1.LeftCardUI, { projectData: singleProjectData, projectFrequencyType: projectFrequencyType, projectRateType: projectRateType, project: project, isAuthenticated: isAuthenticated, adhocProject: adhocProject, activeProject: activeProject, freelancerId: freelancerId, selectedTab: selectedTab, updateProjectTaskMutation: updateProjectTaskMutation, GetAllProjectIrprDetailsForFreelancerDocument: GetAllProjectIrprDetailsForFreelancerDocument, updateProjectTask: updateProjectTask, clientPortal: clientPortal }),
|
|
157
|
+
react_1.default.createElement("div", { className: "flex flex-col flex-grow md:flex-row gap-x-0 justify-around" },
|
|
158
|
+
react_1.default.createElement(CenterCardUI_1.CenterCardUI, { startDate: project === null || project === void 0 ? void 0 : project.startDate, endDate: project === null || project === void 0 ? void 0 : project.endDate, projectData: singleProjectData, projectRateType: projectRateType, project: project, projectFrequencyType: projectFrequencyType, adhocProject: adhocProject, clientPortal: clientPortal }),
|
|
159
|
+
react_1.default.createElement(RightCardUI_1.RightCardUI, { project: project, expertName: expertName, freelancerEmail: freelancerEmail, freelancerId: freelancerId, isAuthenticated: isAuthenticated, editEndDate: editEndDate, setEditEndDate: setEditEndDate, editStartDate: editStartDate, setEditStartDate: setEditStartDate, showTimeModal: showTimeModal, setShowTimeModal: setShowTimeModal, setSingleProjectData: setSingleProjectData, projectData: singleProjectData, checkStartDate: checkStartDate, activeProject: activeProject, projectRateType: projectRateType, projectFrequencyType: projectFrequencyType, upcomingProject: upcomingProject, selectedTab: selectedTab, showRating: !!showRating, projectTagsMap: projectTagsMap, updateProjectStatusMutation: updateProjectStatusMutation, GetAllProjectIrprDetailsForFreelancerDocument: GetAllProjectIrprDetailsForFreelancerDocument, updateParoProjectTagsMutation: updateParoProjectTagsMutation, GetParoProjectsDocument: GetParoProjectsDocument, updateProjectTagReviewStatusMutation: updateProjectTagReviewStatusMutation, updateProjectStatus: updateProjectStatus, updateProjectTags: updateProjectTags, getSowLazyQuery: getSowLazyQuery, sendParoSupportEmail: sendParoSupportEmail, createChangeRequestMutation: createChangeRequestMutation, createChangeRequest: createChangeRequest, createOrUpdateRatingRequestMutation: createOrUpdateRatingRequestMutation, submitProjectHoursMutation: submitProjectHoursMutation, getAuth0Roles: getAuth0Roles, submitProjectHoursLambda: submitProjectHoursLambda, user: user, internalPortal: internalPortal, csmUserGroup: csmUserGroup, clientPortal: clientPortal, signedSow: signedSow }))))));
|
|
160
|
+
};
|
|
161
|
+
exports.ActiveProjectCard = ActiveProjectCard;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface CenterCardUIProps {
|
|
3
|
-
startDate: any;
|
|
4
|
-
endDate: any;
|
|
5
|
-
projectRateType: string;
|
|
6
|
-
projectData: any;
|
|
7
|
-
projectFrequencyType: string;
|
|
8
|
-
project: any;
|
|
9
|
-
adhocProject: any;
|
|
10
|
-
clientPortal: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const CenterCardUI: ({ startDate, endDate, projectRateType, projectData, projectFrequencyType, project, adhocProject, clientPortal, }: CenterCardUIProps) => React.JSX.Element;
|
|
13
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface CenterCardUIProps {
|
|
3
|
+
startDate: any;
|
|
4
|
+
endDate: any;
|
|
5
|
+
projectRateType: string;
|
|
6
|
+
projectData: any;
|
|
7
|
+
projectFrequencyType: string;
|
|
8
|
+
project: any;
|
|
9
|
+
adhocProject: any;
|
|
10
|
+
clientPortal: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const CenterCardUI: ({ startDate, endDate, projectRateType, projectData, projectFrequencyType, project, adhocProject, clientPortal, }: CenterCardUIProps) => React.JSX.Element;
|
|
13
|
+
export {};
|