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

[PROD] Release 1.5 #77

Merged
merged 123 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
39a44a3
feat: track page analytics and page titles
maxceem Jan 12, 2021
7512a1c
chore: deploy branch "dev-1_5"
maxceem Jan 27, 2021
9a587d9
Merge pull request #50 from topcoder-platform/feature/analytics-and-p…
maxceem Jan 27, 2021
9102ccc
Merge branch 'master' into dev
maxceem Jan 27, 2021
f219e3f
Revert "Merge branch 'master' into dev"
maxceem Jan 27, 2021
bb78934
Merge branch 'dev' into dev-1_5
maxceem Jan 27, 2021
9e4bba0
fix: path during local setup
maxceem Jan 27, 2021
3cbcdc5
Jobs and Booking Resource Management Submission.
dashu-baba Feb 4, 2021
7c9a7be
Merge pull request #75 from dashu-baba/dev-1_5
maxceem Feb 4, 2021
83d1df1
chore: debug build env variables
maxceem Feb 4, 2021
a1377f8
Merge pull request #65 from topcoder-platform/dev-1_5
maxceem Feb 4, 2021
3721e52
fixed styles for job-rb
dashu-baba Feb 5, 2021
f7fe380
feedback on stylings
dashu-baba Feb 5, 2021
0470460
Adjusted Select component style & form fluidity
dashu-baba Feb 6, 2021
ec0e3b6
Merge pull request #79 from dashu-baba/feature/job-rb-management
maxceem Feb 7, 2021
cc48edc
fix: use internal links instead of "a"
maxceem Feb 7, 2021
4958678
Merge pull request #76 from topcoder-platform/feature/job-rb-management
maxceem Feb 7, 2021
d8a0a1c
fix: add delay after create/update operations
maxceem Feb 8, 2021
cbd5869
feat: add RB edit action
maxceem Feb 8, 2021
d2d728a
Added new route. Added links to MyTeams page and MyTeamsDetails page.
mbaghel Feb 9, 2021
eb6bb17
finished presentation of manage access page
mbaghel Feb 11, 2021
a24384a
Created base modal and used to style add modal and delete modals
mbaghel Feb 12, 2021
8a1ab18
delete modal working for members
mbaghel Feb 12, 2021
2c06f11
working delete modal, formatted code
mbaghel Feb 12, 2021
cd15a8d
working suggestions and reactselect element
mbaghel Feb 13, 2021
830ff4a
able to add invites to project
mbaghel Feb 13, 2021
04060d5
fix: issue #35
yoution Feb 13, 2021
b250d55
fix: issue #81
yoution Feb 13, 2021
97c4ebe
fix: issue #80
yoution Feb 13, 2021
78cb7a5
fixed issue 68
dashu-baba Feb 13, 2021
c627bf0
fix: issue #82
yoution Feb 13, 2021
ebcf6a1
fix: issue-84
yoution Feb 13, 2021
f86503d
fix: issue #86
yoution Feb 13, 2021
bf72bec
Added capability to inject custom validator
dashu-baba Feb 13, 2021
1c724ad
fix: issue #90
yoution Feb 14, 2021
525922b
fix: issue #45
yoution Feb 14, 2021
2fe7c41
Merge pull request #92 from dashu-baba/issue-68
maxceem Feb 16, 2021
98803eb
Merge pull request #93 from yoution/issue-82
maxceem Feb 16, 2021
e6159ba
fix: format plural/singular "week"
maxceem Feb 16, 2021
aff92db
Merge pull request #95 from yoution/issue-86
maxceem Feb 16, 2021
5b3081e
fix: make improvements
yoution Feb 17, 2021
acaed88
fix: fix issue
yoution Feb 17, 2021
8548d49
fix: fix issue
yoution Feb 17, 2021
affa385
fix: delete duration
yoution Feb 17, 2021
c036ddf
fixed review items
dashu-baba Feb 17, 2021
abac3ef
Merge branch 'dev' into issue-35
maxceem Feb 17, 2021
9f52f0b
Merge pull request #88 from yoution/issue-35
maxceem Feb 17, 2021
209066c
fix: lint
maxceem Feb 17, 2021
08144eb
Merge pull request #89 from yoution/issue-81
maxceem Feb 17, 2021
4e57c34
fix: improve style logic consistency
maxceem Feb 17, 2021
ad5dbd4
Merge pull request #91 from yoution/issue-80
maxceem Feb 17, 2021
ad02cdf
Merge pull request #94 from yoution/issue-84
maxceem Feb 17, 2021
e8e3ec4
fix: update language
maxceem Feb 17, 2021
886757d
Merge pull request #99 from mbaghel/feature/member-management
maxceem Feb 17, 2021
ac4259c
fix: decrease settimeout
yoution Feb 17, 2021
55c35e0
fix: increase settimeout
yoution Feb 17, 2021
194af0f
Merge branch 'dev' into feature/member-management
maxceem Feb 17, 2021
cd5941f
Merge pull request #98 from yoution/issue-45
maxceem Feb 17, 2021
721b19f
Merge branch 'dev' into feature/member-management
maxceem Feb 17, 2021
be7ec0d
chore: remove not used package
maxceem Feb 17, 2021
4f0ec9b
final fix of custom validator. Removing supportive prop.
dashu-baba Feb 17, 2021
4568280
lint fix
dashu-baba Feb 17, 2021
2eeec1f
Merge pull request #96 from dashu-baba/issue-85
maxceem Feb 18, 2021
27a6277
fix: remove skills outline
maxceem Feb 18, 2021
9907a4f
fix: show "Interested" tab if nobody to review
maxceem Feb 18, 2021
c375bb5
fix: cannot find name for job skill
maxceem Feb 18, 2021
c8645ba
Removed previous issue reporting logic. Added static Report Popup com…
mbaghel Feb 18, 2021
82cbbc6
Added Report Popup component to MyTeamsList and MyTeamsDetails pages.
mbaghel Feb 18, 2021
8665339
added postreport service
mbaghel Feb 18, 2021
0e354a4
Merge branch 'mbaghel/report-issue' into feature/member-management
mbaghel Feb 18, 2021
b0d6864
fix: show unsupported job skills
maxceem Feb 18, 2021
b96c46e
Merge pull request #97 from yoution/issue-90
maxceem Feb 18, 2021
c5679d8
fix: lint
maxceem Feb 18, 2021
b5145fb
refactor: job loading for RB
maxceem Feb 18, 2021
e6f33c5
feat: rename job field labels
maxceem Feb 18, 2021
4398e04
feat: smaller validation error font
maxceem Feb 18, 2021
17727a4
feat: adapt group form field for mobile
maxceem Feb 18, 2021
9dbc0ed
Extracted loading spinner from delete modal to its own component. Fin…
mbaghel Feb 18, 2021
8db036e
fix: saving RB
maxceem Feb 18, 2021
e5403a6
Documentation and cleanup
mbaghel Feb 18, 2021
1e18101
Removed leftover console log. Reset textarea on close popup
mbaghel Feb 18, 2021
f6b734f
fix: step for duration only integers
maxceem Feb 19, 2021
d8604e6
fix: wrong labels in job create form
maxceem Feb 19, 2021
850ce75
fix: step for num positions only integers
maxceem Feb 19, 2021
7d037b7
fix: edit RB page borken
maxceem Feb 19, 2021
ee297cb
fix: cannot load view RB page
maxceem Feb 19, 2021
4b02817
Change request: Fixed typo in data for issue reporting. Only display …
mbaghel Feb 20, 2021
241083d
Merge pull request #104 from mbaghel/feature/member-management
maxceem Feb 20, 2021
14bb09a
Merge branch 'dev' into feature/member-management
maxceem Feb 20, 2021
11c24e7
Ran prettier. Removed logic for adding and removing invites. Changed …
mbaghel Feb 21, 2021
14a9f0f
Merge pull request #102 from topcoder-platform/feature/member-management
maxceem Feb 21, 2021
1be375a
fix: improve server error handling
maxceem Feb 21, 2021
75a4821
Remove unused style from DeleteModal. Allow adding members by email o…
mbaghel Feb 21, 2021
bbd902a
Merging changes from remote of feature/member-management to local
mbaghel Feb 21, 2021
acbc29c
Added validation for handles and emails of users already on team or i…
mbaghel Feb 22, 2021
3d46e63
Handle errors when adding members. Keep failed adds in select, show e…
mbaghel Feb 22, 2021
49ab386
Get Topcoder roles from token using a hook. Only show suggestions in …
mbaghel Feb 22, 2021
e3a73cb
Moved logic for AddModal from MemberList to new container component. …
mbaghel Feb 22, 2021
ce7bf4b
feat: permission based on Topcoder roles
maxceem Feb 22, 2021
2aca828
Merge pull request #107 from mbaghel/feature/member-management
maxceem Feb 22, 2021
da3f5c4
Merge branch 'dev' into feature/permissions
maxceem Feb 22, 2021
72cfe63
Merge pull request #108 from topcoder-platform/feature/permissions
maxceem Feb 22, 2021
1266d9c
feat: add tui editor
yoution Feb 23, 2021
baec302
refactor: permission check for member suggestions
maxceem Feb 23, 2021
b4d6661
refactor: put all actions in one config
maxceem Feb 23, 2021
a1ead8e
fix: add markdown editor
yoution Feb 23, 2021
074e0fb
feat: loading team members for permissinos
maxceem Feb 23, 2021
ced2d16
Merge pull request #109 from yoution/feature/tuieditor
maxceem Feb 23, 2021
54faf19
fix: markdown editor styles and code improvements
maxceem Feb 23, 2021
cf60658
fix: improve Job Description editor style
maxceem Feb 23, 2021
f18605e
feat: candidate accept/reject permissions
maxceem Feb 23, 2021
382e9ba
Merge pull request #110 from topcoder-platform/feature/permissions-pa…
maxceem Feb 23, 2021
fe479df
fix: success added message
maxceem Feb 23, 2021
2918e8d
feat: current user "leaves" team instead of remove
maxceem Feb 23, 2021
e8d3ac4
feat: permission for editing Jobs
maxceem Feb 23, 2021
7130123
fix: rename Member Details to Resource Booking
maxceem Feb 23, 2021
3819b56
Updated to use react-select's AsyncCreatableSelect for getting sugges…
mbaghel Feb 24, 2021
ca11835
Merge pull request #113 from mbaghel/dev
maxceem Feb 24, 2021
4cb9c59
fix: use TaaS API endpoints for permissions
maxceem Feb 24, 2021
d91d434
fix: add members case-insensitive way
maxceem Feb 25, 2021
8b94f2b
fix: always show "handle" for team members
maxceem Feb 25, 2021
a6340e2
Merge branch 'master' into dev
maxceem Feb 25, 2021
3fb3593
fix: key candidates by "id"
maxceem Feb 25, 2021
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"dependencies": {
"@popperjs/core": "^2.5.4",
"@reach/router": "^1.3.4",
"@toast-ui/editor": "^2.5.1",
"axios": "^0.21.0",
"classnames": "^2.2.6",
"express": "^4.17.1",
Expand Down
11 changes: 11 additions & 0 deletions src/components/FormField/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Field } from "react-final-form";
import { FORM_FIELD_TYPE } from "../../constants";
import TextInput from "../../components/TextInput";
import TextArea from "../../components/TextArea";
import MarkdownEditor from "../../components/MarkdownEditor";
import ReactSelect from "../../components/ReactSelect";
import DateInput from "../../components/DateInput";
import "./styles.module.scss";
Expand Down Expand Up @@ -59,6 +60,16 @@ const FormField = ({ field }) => {
step={field.step}
/>
)}
{field.type === FORM_FIELD_TYPE.MARKDOWNEDITOR && (
<MarkdownEditor
placeholder={field.placeholder}
value={input?.value ?? ""}
onChange={input.onChange}
onBlur={input.onBlur}
onFocus={input.onFocus}
className={meta.error && meta.touched ? "error" : ""}
/>
)}
{field.type === FORM_FIELD_TYPE.TEXTAREA && (
<TextArea
placeholder={field.placeholder}
Expand Down
39 changes: 39 additions & 0 deletions src/components/MarkdownEditor/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* MarkdownEditor
*/

import React, { useState, useCallback, useRef } from "react";
import PropTypes from "prop-types";
import cn from "classnames";
import TuiEditor from "../TuiEditor";
import styles from "./styles.module.scss";

const MarkdownEditor = (props) => {
const editorElement = useRef(null);

const onChange = useCallback(() => {
const mk = editorElement.current.editorInst.getMarkdown();
props.onChange(mk);
}, []);

return (
<div className={cn(styles["editor-container"], props.className)}>
<TuiEditor
{...props}
ref={editorElement}
onChange={onChange}
initialValue={props.value}
/>
</div>
);
};

MarkdownEditor.propTypes = {
value: PropTypes.string,
className: PropTypes.string,
onChange: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
};

export default MarkdownEditor;
37 changes: 37 additions & 0 deletions src/components/MarkdownEditor/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@import "styles/include";

.editor-container {
margin-top: 10px;

:global {
// reset style for heading list in headings selection popup
.tui-popup-body {
h1,h2,h3,h4,h4,h5,h6 {
font-weight: revert;
line-height: revert;
}
}

// reset border color
.tui-editor-defaultUI {
border: 1px solid #aaaaab
}

.te-toolbar-section {
border-bottom: 1px solid #aaaaab
}

// hide uplodd file
.tui-editor-popup{
box-shadow: 0px 0px 15px 5px rgba(0,0,0,0.26);
}

.te-popup-add-image .te-tab button, .te-popup-add-image .te-file-type{
display: none !important;
}

.te-popup-add-image .te-url-type{
display: block !important;
}
}
}
17 changes: 17 additions & 0 deletions src/components/MarkdownEditorViewer/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* MarkdownViewer
*/

import React, { useState } from "react";
import PropTypes from "prop-types";
import TuiEditorViewer from "../TuiEditorViewer";

const MarkdownViewer = (props) => (
<TuiEditorViewer initialValue={props.value} />
);

MarkdownViewer.propTypes = {
value: PropTypes.string,
};

export default MarkdownViewer;
138 changes: 138 additions & 0 deletions src/components/TuiEditor/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*
* TuiEditor
* wrap toast-ui editor with react
*/
import React from "react";
import PropTypes from "prop-types";
import Editor from "@toast-ui/editor";

class TuiEditor extends React.Component {
constructor(props) {
super(props);
this.rootEl = React.createRef();
this.editorInst = null;
}

getRootElement() {
return this.rootEl.current;
}

getInstance() {
return this.editorInst;
}

bindEventHandlers(props) {
Object.keys(this.props)
.filter((key) => /^on[A-Z][a-zA-Z]+/.test(key))
.forEach((key) => {
const eventName = key[2].toLowerCase() + key.slice(3);
// off function has issue
// when add `onFocus` function, the headings popup will not hide automatically
// this.editorInst.off(eventName, props[key]);
this.editorInst.on(eventName, props[key]);
});
}

componentDidMount() {
this.editorInst = new Editor({
el: this.rootEl.current,
...this.props,
});

this.bindEventHandlers(this.props);
}

shouldComponentUpdate(nextProps) {
const instance = this.getInstance();
const { height, previewStyle } = nextProps;

if (this.props.height !== height) {
instance.height(height);
}

if (this.props.previewStyle !== previewStyle) {
instance.changePreviewStyle(previewStyle);
}

this.bindEventHandlers(nextProps, this.props);

return false;
}

render() {
return <div ref={this.rootEl} />;
}
}

TuiEditor.defaultProps = {
height: "320px",
minHeight: "320px",
initialValue: "",
previewStyle: "",
initialEditType: "wysiwyg",
language: "en-US",
useCommandShortcut: true,
customHTMLSanitizer: null,
frontMatter: false,
hideModeSwitch: true,
referenceDefinition: false,
usageStatistics: false,
useDefaultHTMLSanitizer: true,
};

TuiEditor.propTypes = {
// Editor's initial value
initialValue: PropTypes.string,
// Markdown editor's preview style (tab, vertical)
previewStyle: PropTypes.string.isRequired,
// Editor's height style value. Height is applied as border-box ex) '300px', '100%', 'auto'
height: PropTypes.string,
// Initial editor type (markdown, wysiwyg)
initialEditType: PropTypes.string,
// Editor's min-height style value in pixel ex) '300px'
minHeight: PropTypes.string,
// The placeholder text of the editable element.
placeholder: PropTypes.string,
// hide mode switch tab bar
hideModeSwitch: PropTypes.bool,
// language, 'en-US'
language: PropTypes.string,
// whether use keyboard shortcuts to perform commands
useCommandShortcut: PropTypes.bool,
// It would be emitted when editor fully load1
onLoad: PropTypes.func,
// It would be emitted when content changed
onChange: PropTypes.func,
// It would be emitted when format change by cursor position
onStateChange: PropTypes.func,
// It would be emitted when editor get focus
onFocus: PropTypes.func,
// It would be emitted when editor loose focus
onBlur: PropTypes.func,
// hooks
hooks: PropTypes.arrayOf(PropTypes.object),
// send hostname to google analytics
usageStatistics: PropTypes.bool,
// use default htmlSanitizer
useDefaultHTMLSanitizer: PropTypes.bool,
// toolbar items.
toolbarItems: PropTypes.arrayOf(PropTypes.object),
// Array of plugins. A plugin can be either a function or an array in the form of [function, options].
plugins: PropTypes.arrayOf(PropTypes.object),
// Using extended Autolinks specified in GFM spec
extendedAutolinks: PropTypes.object,
// convertor extention
customConvertor: PropTypes.object,
// Attributes of anchor element that should be rel, target, contenteditable, hreflang, type
linkAttribute: PropTypes.object,
// Object containing custom renderer functions correspond to markdown node
customHTMLRenderer: PropTypes.object,
// whether use the specification of link reference definition
referenceDefinition: PropTypes.bool,
// custom HTML sanitizer
customHTMLSanitizer: PropTypes.func,
// whether use the front matter
frontMatter: PropTypes.bool,
};

export default TuiEditor;
59 changes: 59 additions & 0 deletions src/components/TuiEditorViewer/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* TuiEditorViewer
*/
import React from "react";
import PropTypes from "prop-types";
import Viewer from "@toast-ui/editor/dist/toastui-editor-viewer";

class TuiViewer extends React.Component {
constructor(props) {
super(props);
this.rootEl = React.createRef();
this.viewerInst = null;
}

getRootElement() {
return this.rootEl.current;
}

getInstance() {
return this.viewerInst;
}

bindEventHandlers(props) {
Object.keys(this.props)
.filter((key) => /^on[A-Z][a-zA-Z]+/.test(key))
.forEach((key) => {
const eventName = key[2].toLowerCase() + key.slice(3);
// off function has issue
// when add `onFocus` function, the headings popup will not hide automatically
// this.editorInst.off(eventName, props[key]);
this.viewerInst.on(eventName, props[key]);
});
}

componentDidMount() {
this.viewerInst = new Viewer({
el: this.rootEl.current,
...this.props,
});

this.bindEventHandlers(this.props);
}

shouldComponentUpdate(nextProps) {
this.bindEventHandlers(nextProps, this.props);

return false;
}

render() {
return <div ref={this.rootEl} />;
}
}

TuiViewer.propTypes = {
initialValue: PropTypes.string,
};

export default TuiViewer;
1 change: 1 addition & 0 deletions src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export const ACTION_TYPE = {
export const FORM_FIELD_TYPE = {
TEXT: "text",
TEXTAREA: "textarea",
MARKDOWNEDITOR: "markdowneditor",
NUMBER: "number",
SELECT: "select",
MULTISELECT: "multiselect",
Expand Down
3 changes: 2 additions & 1 deletion src/routes/JobDetails/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useData } from "hooks/useData";
import { getJobById } from "services/jobs";
import { getSkills } from "services/skills";
import LoadingIndicator from "../../components/LoadingIndicator";
import MarkdownEditorViewer from "../../components/MarkdownEditorViewer";
import withAuthentication from "../../hoc/withAuthentication";
import DataItem from "../../components/DataItem";
import IconSkill from "../../assets/images/icon-skill.svg";
Expand Down Expand Up @@ -64,7 +65,7 @@ const JobDetails = ({ teamId, jobId }) => {
{job.title}
</DataItem>
<DataItem title="Job Description" icon={<IconDescription />}>
{job.description}
<MarkdownEditorViewer value={job.description} />
</DataItem>
<DataItem title="Number of Openings" icon={<IconOpenings />}>
{job.numPositions}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/JobForm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const getEditJobConfig = (skillOptions, onSubmit) => {
},
{
label: "Job Description",
type: FORM_FIELD_TYPE.TEXTAREA,
type: FORM_FIELD_TYPE.MARKDOWNEDITOR,
name: "description",
placeholder: "Job Description",
},
Expand Down
4 changes: 4 additions & 0 deletions src/styles/main.vendor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
@import "~react-redux-toastr/src/styles/index";
@import "~react-responsive-modal/styles";
@import "~react-loader-spinner/dist/loader/css/react-spinner-loader.css";

// toast-ui.editor styles
@import "~codemirror/lib/codemirror.css";
@import "~@toast-ui/editor/dist/toastui-editor.css"