Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into DEVPROD-808
Browse files Browse the repository at this point in the history
  • Loading branch information
minnakt committed Feb 17, 2024
2 parents e21e238 + b573116 commit 7387484
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spruce",
"version": "3.0.205",
"version": "3.0.207",
"private": true,
"scripts": {
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh",
Expand Down Expand Up @@ -95,7 +95,7 @@
"@leafygreen-ui/text-input": "12.1.24",
"@leafygreen-ui/toast": "6.1.4",
"@leafygreen-ui/toggle": "10.0.17",
"@leafygreen-ui/tokens": "2.1.0",
"@leafygreen-ui/tokens": "2.3.0",
"@leafygreen-ui/tooltip": "10.0.10",
"@leafygreen-ui/typography": "17.0.1",
"@rjsf/core": "4.2.3",
Expand Down
6 changes: 3 additions & 3 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { spacing } from "@leafygreen-ui/tokens";

// Should be used for spacing such as margins and padding.
const size = {
xxs: `${spacing[1]}px`, // 4px
xs: `${spacing[2]}px`, // 8px
s: `${spacing[3]}px`, // 16px
xxs: `${spacing[100]}px`, // 4px
xs: `${spacing[200]}px`, // 8px
s: `${spacing[400]}px`, // 16px
m: `${spacing[4]}px`, // 24px
l: `${spacing[5]}px`, // 32px
xl: `${spacing[6]}px`, // 64px
Expand Down
4 changes: 4 additions & 0 deletions src/pages/task/metadata/ETATimer/ETATimer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ describe("etaTimer", () => {
expect(global.clearInterval).toHaveBeenCalledWith(expect.any(Number));
expect(jest.getTimerCount()).toBe(0);
});
it("if the eta has been exceeded, it does not render", () => {
render(<ETATimer startTime={new Date()} expectedDuration={0} />);
expect(screen.queryByTestId("task-metadata-eta")).not.toBeInTheDocument();
});
});
2 changes: 1 addition & 1 deletion src/pages/task/metadata/ETATimer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ interface ETATimerProps {
const ETATimer: React.FC<ETATimerProps> = ({ expectedDuration, startTime }) => {
const parsedStartTime = new Date(startTime);
const { endTimer, runningTime } = useRunningTime(parsedStartTime);

useEffect(() => {
if (runningTime >= expectedDuration) {
endTimer();
}
}, [runningTime, expectedDuration, endTimer]);

const eta = expectedDuration - runningTime;
if (eta < 0) return null;
return (
<MetadataItem data-cy="task-metadata-eta">
ETA: {msToDuration(eta)}
Expand Down
1 change: 0 additions & 1 deletion src/pages/task/metadata/Metadata.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ describe("metadata", () => {
},
);
expect(screen.queryByDataCy("task-metadata-estimated_start")).toBeNull();
expect(screen.getByDataCy("task-metadata-eta")).toBeInTheDocument();
expect(screen.getByDataCy("task-metadata-started")).toBeInTheDocument();
expect(screen.queryByDataCy("task-metadata-finished")).toBeNull();
expect(screen.queryByDataCy("task-trace-link")).toBeNull();
Expand Down
17 changes: 5 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3967,12 +3967,12 @@
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/tokens" "^2.1.4"

"@leafygreen-ui/tokens@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/tokens/-/tokens-2.1.0.tgz#9677750169876536447b2944c4caaca7c0a4fa4e"
integrity sha512-sn+vveqrWYq0ubKuo5i1q8DS8IVIyApxyjwR0j4QoxW0w1ina9DOgK5KG1XIptw/i1kGQEMCw/5rOfqQWLv3Kw==
"@leafygreen-ui/tokens@2.3.0", "@leafygreen-ui/tokens@^2.0.0", "@leafygreen-ui/tokens@^2.0.1", "@leafygreen-ui/tokens@^2.1.0", "@leafygreen-ui/tokens@^2.1.1", "@leafygreen-ui/tokens@^2.1.4", "@leafygreen-ui/tokens@^2.2.0", "@leafygreen-ui/tokens@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/tokens/-/tokens-2.3.0.tgz#33ec8416f423849c64174b387c2844cb41c24752"
integrity sha512-8oDrQWRvUISitKLufO+9rpvQnJxU56sVUhTjR3O3sY7CkRo1vhHUV7F82oY3Gt6nBXVn82RrBTHzZ6F6LHlBvw==
dependencies:
"@leafygreen-ui/palette" "^4.0.4"
"@leafygreen-ui/palette" "^4.0.7"

"@leafygreen-ui/tokens@^1.4.1":
version "1.4.1"
Expand All @@ -3981,13 +3981,6 @@
dependencies:
"@leafygreen-ui/palette" "^3.4.5"

"@leafygreen-ui/tokens@^2.0.0", "@leafygreen-ui/tokens@^2.0.1", "@leafygreen-ui/tokens@^2.1.0", "@leafygreen-ui/tokens@^2.1.1", "@leafygreen-ui/tokens@^2.1.4", "@leafygreen-ui/tokens@^2.2.0", "@leafygreen-ui/tokens@^2.3.0":
version "2.3.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/tokens/-/tokens-2.3.0.tgz#33ec8416f423849c64174b387c2844cb41c24752"
integrity sha512-8oDrQWRvUISitKLufO+9rpvQnJxU56sVUhTjR3O3sY7CkRo1vhHUV7F82oY3Gt6nBXVn82RrBTHzZ6F6LHlBvw==
dependencies:
"@leafygreen-ui/palette" "^4.0.7"

"@leafygreen-ui/[email protected]":
version "10.0.10"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/tooltip/-/tooltip-10.0.10.tgz#bebf502c7b8ef12fdb40a2a9bdcbafa1273b410b"
Expand Down

0 comments on commit 7387484

Please sign in to comment.