Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

fix: issue #120 #127

Merged
merged 4 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,17 @@ export const WORKLOAD_OPTIONS = [
{ value: "fractional", label: "fractional" },
];

/**
* resourceType options
*/
export const RESOURCE_TYPE_OPTIONS = [
{ value: null, label: "" },
{ value: "designer", label: "Designer" },
{ value: "software-developer", label: "Software Developer" },
{ value: "data-scientist", label: "Data Scientist" },
{ value: "data-engineer", label: "Data Engineer" },
];

/**
* status options
*/
Expand Down
10 changes: 9 additions & 1 deletion src/routes/JobDetails/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
import React, { useEffect, useState } from "react";
import PT from "prop-types";
import _ from "lodash";
import Page from "../../components/Page";
import PageHeader from "../../components/PageHeader";
import { useData } from "hooks/useData";
Expand All @@ -20,6 +21,7 @@ import IconComputer from "../../assets/images/icon-computer.svg";
import IconDescription from "../../assets/images/icon-description.svg";
import IconOpenings from "../../assets/images/icon-openings.svg";
import Button from "../../components/Button";
import { RESOURCE_TYPE_OPTIONS } from "../../constants";
import { formatDate } from "utils/format";
import "./styles.module.scss";
import { hasPermission } from "utils/permissions";
Expand Down Expand Up @@ -82,7 +84,13 @@ const JobDetails = ({ teamId, jobId }) => {
{job.duration || "TBD"}
</DataItem>
<DataItem title="Resource Type" icon={<IconDescription />}>
{job.resourceType}
{_.get(
_.find(
RESOURCE_TYPE_OPTIONS,
(t) => t.value === job.resourceType
),
"label"
)}
</DataItem>
<DataItem
title="Resource Rate Frequency"
Expand Down
6 changes: 3 additions & 3 deletions src/routes/JobForm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
RATE_TYPE_OPTIONS,
STATUS_OPTIONS,
WORKLOAD_OPTIONS,
RESOURCE_TYPE_OPTIONS,
FORM_ROW_TYPE,
FORM_FIELD_TYPE,
} from "../../constants";
Expand Down Expand Up @@ -79,10 +80,9 @@ export const getEditJobConfig = (skillOptions, onSubmit) => {
},
{
label: "Resource Type",
type: FORM_FIELD_TYPE.TEXT,
type: FORM_FIELD_TYPE.SELECT,
name: "resourceType",
maxLength: 255,
placeholder: "Resource Type",
selectOptions: RESOURCE_TYPE_OPTIONS,
},
{
label: "Resource Rate Frequency",
Expand Down