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

[PROD] Release 1.0.2 #65

Merged
merged 37 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
06e071c
Fixed (regression): 'Process Payments' button and other related contr…
MadOPcode Jul 1, 2021
6bfea50
Fixed: page extended past the edge of screen.
MadOPcode Jul 1, 2021
12a7c71
Fixed: toastr messages for single resources were in plural form.
MadOPcode Jul 1, 2021
9366a10
Added working days update hint.
MadOPcode Jul 1, 2021
77f8685
Minor change in Work Period header's padding.
MadOPcode Jul 2, 2021
b2cc7a9
Removed global classes where possible.
MadOPcode Jul 2, 2021
714c26f
Merge pull request #59 from MadOPcode/dev
maxceem Jul 2, 2021
d800c6d
Implemented JobName component that loads and caches job name by job id.
MadOPcode Jul 2, 2021
9b10ac2
Removed code related to loading job name into redux store for working…
MadOPcode Jul 2, 2021
99ac1d1
Implemented Tooltip component and added tooltips for user handle and …
MadOPcode Jul 2, 2021
a1d3aab
Added tooltip with error messages for work period selection checkbox.
MadOPcode Jul 3, 2021
9019778
Merge branch 'dev' of github.com:MadOPcode/micro-frontends-taas-admin…
MadOPcode Jul 3, 2021
5f11c85
Merge pull request #60 from MadOPcode/dev
maxceem Jul 3, 2021
bd05dbf
chore: rename to "Job Name"
maxceem Jul 3, 2021
4701efd
Implemented error messages in popovers for failed working period rows.
MadOPcode Jul 3, 2021
9a4057c
Changed endpoint for user handle suggestions.
MadOPcode Jul 3, 2021
ead7ac8
Fixed: billing account was reset in UI after reopening working period…
MadOPcode Jul 4, 2021
02c6a82
Added working period alert column.
MadOPcode Jul 4, 2021
4b77b44
Implemented Modal component and payment cancelling.
MadOPcode Jul 5, 2021
519a289
Fixed: closing modal sometimes closed popover.
MadOPcode Jul 5, 2021
7a91a13
fix: get Team Name using TaaS API
maxceem Jul 5, 2021
a8b751f
fix: typo
maxceem Jul 5, 2021
9e469c4
fix: added dashes to messages
maxceem Jul 5, 2021
213c774
Added comments for Modal. Disabled payment Cancel button for payments…
MadOPcode Jul 5, 2021
fbf0f35
Merge branch 'dev' of https://github.com/topcoder-platform/micro-fron…
MadOPcode Jul 5, 2021
7ccac08
Merge branch 'topcoder-platform-dev' into dev
MadOPcode Jul 5, 2021
b50ea7a
Added comments for PaymentCancel component.
MadOPcode Jul 5, 2021
3b061c0
Added bullet lists to selection checkbox and alerts tooltips.
MadOPcode Jul 5, 2021
d2d1a1c
Fixed: working period rows got taller on small screens.
MadOPcode Jul 5, 2021
878a2a7
Merge pull request #62 from MadOPcode/dev
maxceem Jul 5, 2021
202acbf
fix: don't keep space for row error icon
maxceem Jul 5, 2021
b332de9
fix: plural form when select WPs in for payment
maxceem Jul 5, 2021
12e070f
Implemented limiting working days by resource booking period.
MadOPcode Jul 5, 2021
429b32e
fix: plural "is"/"are"
maxceem Jul 6, 2021
714651c
fix: cancel button for In-Progress
maxceem Jul 6, 2021
b388ec7
Merge pull request #64 from MadOPcode/dev
maxceem Jul 6, 2021
d8ed637
fix: disable decrease button when days worked is 0
maxceem Jul 6, 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
5 changes: 5 additions & 0 deletions src/assets/images/icon-checkmark-circled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/assets/images/icon-cross-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 15 additions & 10 deletions src/components/Button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import styles from "./styles.module.scss";
* @param {Object} props component properties
* @param {Object} props.children button text
* @param {string} [props.className] class name added to root element
* @param {'primary'|'primary-dark'|'primary-light'} [props.color] button color
* @param {'primary'|'primary-dark'|'primary-light'|'error'|'warning'} [props.color]
* button color
* @param {boolean} [props.isDisabled] if button is disabled
* @param {boolean} [props.isSelected] if button is selected
* @param {string} [props.name] button name
* @param {(e: any) => void} props.onClick function called when button is clicked
* @param {(e: any) => void} [props.onClick] function called when button is clicked
* @param {'medium'|'small'} [props.size] button size
* @param {'circle'|'rounded'} [props.style] button style
* @param {'button'|'submit'|'reset'} [props.type] button type
Expand Down Expand Up @@ -42,13 +43,11 @@ const Button = ({
type={type}
className={cn(
styles.button,
{
[styles.selected]: isSelected,
[styles[color]]: true,
[styles[size]]: true,
[styles[style]]: true,
[styles[variant]]: true,
},
styles[color],
styles[size],
styles[style],
styles[variant],
{ [styles.selected]: isSelected },
className
)}
onClick={onClick}
Expand All @@ -60,7 +59,13 @@ const Button = ({
Button.propTypes = {
children: PT.node,
className: PT.string,
color: PT.oneOf(["primary"]),
color: PT.oneOf([
"primary",
"primary-dark",
"primary-light",
"error",
"warning",
]),
isDisabled: PT.bool,
isSelected: PT.bool,
name: PT.string,
Expand Down
21 changes: 21 additions & 0 deletions src/components/Button/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
align-items: center;
@include roboto-bold;
letter-spacing: 0.8px;
white-space: nowrap;
text-transform: uppercase;
outline: none;
cursor: pointer;
Expand Down Expand Up @@ -61,6 +62,16 @@
color: $primary-dark-text-color;
}

&.error {
border-color: $error-color;
color: $error-text-color;
}

&.warning {
border-color: $warning-color;
color: $warning-text-color;
}

&:disabled {
border-color: $control-disabled-border-color;
background-color: $control-disabled-bg-color;
Expand Down Expand Up @@ -88,6 +99,16 @@
background-color: $primary-dark-color;
}

&.error {
border-color: $error-color;
background-color: $error-color;
}

&.warning {
border-color: $warning-color;
background-color: $warning-color;
}

&:disabled {
border-color: $control-disabled-border-color;
background-color: $control-disabled-bg-color;
Expand Down
5 changes: 4 additions & 1 deletion src/components/Checkbox/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import styles from "./styles.module.scss";
* @param {Object} props component properties
* @param {boolean} props.checked whether checkbox is checked
* @param {string} [props.className] class name added to root element
* @param {string} [props.impostorClassName] class name added to checkbox impostor
* @param {boolean} [props.isDisabled] if checkbox is disabled
* @param {string} props.name name for input element
* @param {() => void} props.onChange function called when checkbox changes state
Expand All @@ -21,6 +22,7 @@ import styles from "./styles.module.scss";
const Checkbox = ({
checked,
className,
impostorClassName,
isDisabled = false,
name,
onChange,
Expand All @@ -47,7 +49,7 @@ const Checkbox = ({
checked={checked}
value={option ? option.value : ""}
/>
<span className={styles.impostor} />
<span className={cn(styles.impostor, impostorClassName)} />
{option && option.label && (
<span className={styles.label}>{option.label}</span>
)}
Expand All @@ -57,6 +59,7 @@ const Checkbox = ({
Checkbox.propTypes = {
checked: PT.bool,
className: PT.string,
impostorClassName: PT.string,
isDisabled: PT.bool,
name: PT.string.isRequired,
size: PT.oneOf(["medium", "small"]),
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ input.checkbox {
z-index: 2;
position: relative;
display: inline-block;
vertical-align: -2px;
vertical-align: -3px;
width: 15px;
height: 15px;
line-height: 13px;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Content/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
padding: 0 10px;

@include desktop {
flex: 1 1 auto;
flex: 1 1 0;
padding: 0 35px;
min-width: 0;
}
}
61 changes: 61 additions & 0 deletions src/components/Icons/CheckmarkCircled/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React, { useEffect, useState } from "react";
import PT from "prop-types";
import cn from "classnames";
import Icon from "../../../assets/images/icon-checkmark-circled.svg";
import styles from "./styles.module.scss";

/**
* Displays an animated checkmark inside circle. After the specified timeout
* the checkmark is faded out and after fade transition ends the onTimeout
* is called.
*
* @param {Object} props component properties
* @param {string} [props.className] class name to be added to root element
* @param {() => void} props.onTimeout
* @param {number} props.timeout timeout milliseconds
* @returns {JSX.Element}
*/
const CheckmarkCircled = ({ className, onTimeout, timeout = 2000 }) => {
const [isAnimated, setIsAnimated] = useState(false);
const [isTimedOut, setIsTimedOut] = useState(false);

useEffect(() => {
setIsAnimated(true);
}, []);

useEffect(() => {
setIsTimedOut(false);
let timeoutId = setTimeout(() => {
timeoutId = 0;
setIsTimedOut(true);
}, Math.max(timeout, /* total CSS animation duration */ 1200));
return () => {
if (timeoutId) {
clearTimeout(timeoutId);
}
};
}, [timeout]);

return (
<span
className={cn(
styles.container,
{ [styles.fadeOut]: isTimedOut },
className
)}
onTransitionEnd={isTimedOut ? onTimeout : null}
>
<Icon
className={cn(styles.checkmark, { [styles.animated]: isAnimated })}
/>
</span>
);
};

CheckmarkCircled.propTypes = {
className: PT.string,
onTimeout: PT.func.isRequired,
timeout: PT.number,
};

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

.container {
display: inline-block;
width: 30px;
height: 30px;
opacity: 1;
transition: opacity 0.2s ease;
}

.checkmark {
display: block;
width: auto;
height: 100%;
border-radius: 999px;
stroke-width: 2;
stroke: $primary-color;
stroke-miterlimit: 10;
box-shadow: inset 0px 0px 0px $primary-color;
animation-play-state: paused;
animation: /*checkmark-circled-fill 0.4s ease-in-out 0.4s forwards,*/ checkmark-circled-scale
0.3s ease-in-out 0.9s both;

:global(.checkmark__circle) {
stroke-dasharray: 166;
stroke-dashoffset: 166;
stroke-width: 2;
stroke-miterlimit: 10;
stroke: $primary-color;
fill: rgba(255, 255, 255, 0);
animation-play-state: paused;
animation: checkmark-circled-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1)
forwards;
}

:global(.checkmark__check) {
transform-origin: 50% 50%;
stroke-dasharray: 48;
stroke-dashoffset: 48;
animation-play-state: paused;
animation: checkmark-circled-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s
forwards;
}
}

.animated {
animation-play-state: running;

:global(.checkmark__circle),
:global(.checkmark__check) {
animation-play-state: running;
}
}

.fadeOut {
opacity: 0;
}

@keyframes checkmark-circled-stroke {
100% {
stroke-dashoffset: 0;
}
}

@keyframes checkmark-circled-scale {
0%,
100% {
transform: none;
}
50% {
transform: scale3d(1.1, 1.1, 1);
}
}

@keyframes checkmark-circled-fill {
100% {
box-shadow: inset 0px 0px 0px 10px $primary-color;
}
}
20 changes: 20 additions & 0 deletions src/components/Icons/ExclamationMarkCircled/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import PT from "prop-types";
import cn from "classnames";
import styles from "./styles.module.scss";

/**
* Displays a white exclamation mark inside red circle.
*
* @param {Object} props component properties
* @returns {JSX.Element}
*/
const ExclamationMarkCircled = (props) => (
<span {...props} className={cn(styles.icon, props.className)} />
);

ExclamationMarkCircled.propTypes = {
className: PT.string,
};

export default ExclamationMarkCircled;
22 changes: 22 additions & 0 deletions src/components/Icons/ExclamationMarkCircled/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@import "styles/mixins";
@import "styles/variables";

.icon {
display: inline-block;
padding: 2px 0 0;
font-size: 12px;
width: 16px;
height: 16px;
border-radius: 8px;
line-height: 14px;
@include roboto-bold;
text-align: center;
background: $error-color;
color: #fff;
cursor: pointer;

&::before {
content: "!";
display: inline;
}
}
30 changes: 30 additions & 0 deletions src/components/JobName/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { memo, useContext, useEffect } from "react";
import PT from "prop-types";
import cn from "classnames";
import { JobNameContext } from "components/JobNameProvider";
import { JOB_NAME_LOADING } from "constants/workPeriods";
import styles from "./styles.module.scss";

const JobName = ({ className, jobId }) => {
const [getName, fetchName] = useContext(JobNameContext);
const [jobName, error] = getName(jobId);

useEffect(() => {
fetchName(jobId);
}, [fetchName, jobId]);

return (
<span
className={cn(styles.container, { [styles.error]: !!error }, className)}
>
{jobName || JOB_NAME_LOADING}
</span>
);
};

JobName.propTypes = {
className: PT.string,
jobId: PT.oneOfType([PT.number, PT.string]).isRequired,
};

export default memo(JobName);
Loading