Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
94b127e8
Unverified
Commit
94b127e8
authored
3 years ago
by
Jai
Committed by
GitHub
3 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #11465 from hashicorp/ui-update-deps
Update UI dependencies
parents
6ede4b92
44277375
Branches unavailable
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.4.0-rc.1
v1.4.0-beta.1
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc.1
v1.3.0-beta.1
v1.2.15
v1.2.14
v1.2.13
v1.2.12
v1.2.11
v1.2.10
v1.2.9
v1.2.8
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc1
nightly
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
.github/workflows/ember-assets.yml
+2
-2
.github/workflows/ember-assets.yml
.github/workflows/ember-test-audit.yml
+4
-5
.github/workflows/ember-test-audit.yml
ui/app/components/distribution-bar.js
+1
-1
ui/app/components/distribution-bar.js
ui/app/components/job-page/parts/job-client-status-summary.js
+1
-1
...pp/components/job-page/parts/job-client-status-summary.js
ui/app/components/line-chart.js
+4
-4
ui/app/components/line-chart.js
ui/app/components/primary-metric/current-value.hbs
+1
-1
ui/app/components/primary-metric/current-value.hbs
ui/app/styles/components/node-status-light.scss
+3
-1
ui/app/styles/components/node-status-light.scss
ui/app/styles/components/toolbar.scss
+9
-7
ui/app/styles/components/toolbar.scss
ui/app/styles/core/table.scss
+4
-2
ui/app/styles/core/table.scss
ui/app/styles/core/variables.scss
+9
-0
ui/app/styles/core/variables.scss
ui/app/templates/clients/client/index.hbs
+17
-15
ui/app/templates/clients/client/index.hbs
ui/app/utils/units.js
+6
-0
ui/app/utils/units.js
ui/package.json
+20
-19
ui/package.json
ui/tests/acceptance/optimize-test.js
+5
-5
ui/tests/acceptance/optimize-test.js
ui/tests/integration/components/das/recommendation-card-test.js
+2
-1
...ts/integration/components/das/recommendation-card-test.js
ui/tests/integration/components/das/recommendation-chart-test.js
+1
-1
...s/integration/components/das/recommendation-chart-test.js
ui/yarn.lock
+810
-373
ui/yarn.lock
with
899 additions
and
438 deletions
+899
-438
.github/workflows/ember-assets.yml
+
2
-
2
View file @
94b127e8
...
...
@@ -15,9 +15,9 @@ jobs:
with
:
fetch-depth
:
0
-
name
:
Use Node.js
uses
:
actions/setup-node@v
1
uses
:
actions/setup-node@v
2
with
:
node-version
:
'
1
0.x
'
node-version
:
'
1
2
'
-
uses
:
backspace/ember-asset-size-action@edit-comment
with
:
repo-token
:
"
${{
secrets.GITHUB_TOKEN
}}"
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/ember-test-audit.yml
+
4
-
5
View file @
94b127e8
...
...
@@ -10,7 +10,6 @@ defaults:
# There’s currently no way to share steps between jobs so there’s a lot of duplication
# for running the audit for the base and PR.
jobs
:
time-base
:
runs-on
:
ubuntu-latest
...
...
@@ -20,9 +19,9 @@ jobs:
ref
:
${{ github.event.pull_request.base.sha }}
-
uses
:
nanasess/setup-chromedriver@master
-
name
:
Use Node.js
uses
:
actions/setup-node@v
1
uses
:
actions/setup-node@v
2
with
:
node-version
:
'
1
0.x
'
node-version
:
'
1
2
'
-
run
:
yarn --frozen-lockfile
-
run
:
mkdir -p /tmp/test-reports
-
run
:
npx ember-test-audit 3 --json --output ../base-audit.json
...
...
@@ -37,9 +36,9 @@ jobs:
-
uses
:
actions/checkout@v2
-
uses
:
nanasess/setup-chromedriver@master
-
name
:
Use Node.js
uses
:
actions/setup-node@v
1
uses
:
actions/setup-node@v
2
with
:
node-version
:
'
1
0.x
'
node-version
:
'
1
2
'
-
run
:
yarn --frozen-lockfile
-
run
:
mkdir -p /tmp/test-reports
-
run
:
npx ember-test-audit 3 --json --output ../pr-audit.json
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/distribution-bar.js
+
1
-
1
View file @
94b127e8
...
...
@@ -99,7 +99,7 @@ export default class DistributionBar extends Component.extend(WindowResizable) {
let
slicesEnter
=
slices
.
enter
()
.
append
(
'
g
'
)
.
on
(
'
mouseenter
'
,
d
=>
{
.
on
(
'
mouseenter
'
,
(
ev
,
d
)
=>
{
run
(()
=>
{
const
slices
=
this
.
slices
;
const
slice
=
slices
.
filter
(
datum
=>
datum
.
label
===
d
.
label
);
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/job-page/parts/job-client-status-summary.js
+
1
-
1
View file @
94b127e8
...
...
@@ -17,7 +17,7 @@ export default class JobClientStatusSummary extends Component {
}
@
action
onSliceClick
(
slice
)
{
onSliceClick
(
ev
,
slice
)
{
this
.
gotoClients
([
slice
.
className
.
camelize
()]);
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/line-chart.js
+
4
-
4
View file @
94b127e8
...
...
@@ -232,15 +232,15 @@ export default class LineChart extends Component {
const
updateActiveDatum
=
this
.
updateActiveDatum
.
bind
(
this
);
const
chart
=
this
;
canvas
.
on
(
'
mouseenter
'
,
function
()
{
const
mouseX
=
d3
.
mouse
(
this
)[
0
];
canvas
.
on
(
'
mouseenter
'
,
function
(
ev
)
{
const
mouseX
=
d3
.
pointer
(
ev
,
this
)[
0
];
chart
.
latestMouseX
=
mouseX
;
updateActiveDatum
(
mouseX
);
run
.
schedule
(
'
afterRender
'
,
chart
,
()
=>
(
chart
.
isActive
=
true
));
});
canvas
.
on
(
'
mousemove
'
,
function
()
{
const
mouseX
=
d3
.
mouse
(
this
)[
0
];
canvas
.
on
(
'
mousemove
'
,
function
(
ev
)
{
const
mouseX
=
d3
.
pointer
(
ev
,
this
)[
0
];
chart
.
latestMouseX
=
mouseX
;
updateActiveDatum
(
mouseX
);
});
...
...
This diff is collapsed.
Click to expand it.
ui/app/components/primary-metric/current-value.hbs
+
1
-
1
View file @
94b127e8
...
...
@@ -4,7 +4,7 @@
<progress
data-test-current-value
class=
"progress
{{
@chartClass
}}
is-small"
value=
"
{{
@percent
}}
"
value=
"
{{
or
@percent
0
}}
"
max=
"1"
>
{{
@percent
}}
</progress>
...
...
This diff is collapsed.
Click to expand it.
ui/app/styles/components/node-status-light.scss
+
3
-
1
View file @
94b127e8
@use
"sass:math"
;
$size
:
1
.6rem
;
.node-status-light
{
display
:
inline-flex
;
height
:
$size
;
width
:
$size
;
border-radius
:
$size
/
2
;
border-radius
:
math
.
div
(
$size
,
2
)
;
vertical-align
:
middle
;
align-items
:
center
;
justify-content
:
center
;
...
...
This diff is collapsed.
Click to expand it.
ui/app/styles/components/toolbar.scss
+
9
-
7
View file @
94b127e8
@use
"sass:math"
;
$spacing
:
1
.5em
;
.toolbar
{
display
:
flex
;
margin-bottom
:
$spacing
/
2
;
margin-bottom
:
math
.
div
(
$spacing
,
2
)
;
justify-content
:
space-between
;
flex-wrap
:
wrap
;
margin-left
:
-
$spacing
/
4
;
margin-right
:
-
$spacing
/
4
;
margin-left
:
math
.
div
(
-
$spacing
,
4
)
;
margin-right
:
math
.
div
(
-
$spacing
,
4
)
;
&
.collapse
+
.toolbar
{
margin-top
:
-
$spacing
/
2
;
margin-top
:
math
.
div
(
-
$spacing
,
2
)
;
}
.toolbar-item
{
margin-bottom
:
$spacing
/
2
;
padding-left
:
$spacing
/
4
;
padding-right
:
$spacing
/
4
;
margin-bottom
:
math
.
div
(
$spacing
,
2
)
;
padding-left
:
math
.
div
(
$spacing
,
4
)
;
padding-right
:
math
.
div
(
$spacing
,
4
)
;
align-self
:
center
;
flex-grow
:
1
;
...
...
This diff is collapsed.
Click to expand it.
ui/app/styles/core/table.scss
+
4
-
2
View file @
94b127e8
@use
"sass:math"
;
.table
{
color
:
$text
;
border-radius
:
$radius
;
...
...
@@ -110,8 +112,8 @@
@for
$i
from
1
through
11
{
&
.is-
#{
$i
}
{
width
:
100%
/
12
*
$i
;
max-width
:
100%
/
12
*
$i
;
width
:
math
.
div
(
100%
,
12
)
*
$i
;
max-width
:
math
.
div
(
100%
,
12
)
*
$i
;
}
}
...
...
This diff is collapsed.
Click to expand it.
ui/app/styles/core/variables.scss
+
9
-
0
View file @
94b127e8
...
...
@@ -48,3 +48,12 @@ $mq-hidden-gutter: 'only screen and (max-width : 960px)';
$timing-fast
:
150ms
;
$timing-medium
:
300ms
;
$timing-slow
:
450ms
;
// Undo Bulma 0.8.0 button increase.
$control-border-width
:
1px
!
default
;
$button-border-width
:
$control-border-width
!
default
;
$control-height
:
2
.25em
;
$control-padding-vertical
:
calc
(
0
.375em
-
#{
$control-border-width
}
);
$control-padding-horizontal
:
calc
(
0
.625em
-
#{
$control-border-width
}
);
$button-padding-vertical
:
calc
(
0
.375em
-
#{
$button-border-width
}
);
$button-padding-horizontal
:
0
.75em
;
This diff is collapsed.
Click to expand it.
ui/app/templates/clients/client/index.hbs
+
17
-
15
View file @
94b127e8
...
...
@@ -470,23 +470,25 @@
@
attributePairs=
{{
this
.
model
.
attributes
.
structured
}}
@
class=
"attributes-table"
/>
</div>
<div
class=
"boxed-section-head"
>
Meta
</div>
{{#if
this
.
model
.
meta
.
structured
}}
<div
class=
"boxed-section-body is-full-bleed"
>
<AttributesTable
data-test-meta
@
attributePairs=
{{
this
.
model
.
meta
.
structured
}}
@
class=
"attributes-table"
/>
<div
class=
"boxed-section"
>
<div
class=
"boxed-section-head"
>
Meta
</div>
{{else}}
<div
class=
"boxed-section-body"
>
<div
data-test-empty-meta-message
class=
"empty-message"
>
<h3
class=
"empty-message-headline"
>
No Meta Attributes
</h3>
<p
class=
"empty-message-body"
>
This client is configured with no meta attributes.
</p>
{{#if
this
.
model
.
meta
.
structured
}}
<div
class=
"boxed-section-body is-full-bleed"
>
<AttributesTable
data-test-meta
@
attributePairs=
{{
this
.
model
.
meta
.
structured
}}
@
class=
"attributes-table"
/>
</div>
</div>
{{/if}}
{{else}}
<div
class=
"boxed-section-body"
>
<div
data-test-empty-meta-message
class=
"empty-message"
>
<h3
class=
"empty-message-headline"
>
No Meta Attributes
</h3>
<p
class=
"empty-message-body"
>
This client is configured with no meta attributes.
</p>
</div>
</div>
{{/if}}
</div>
</section>
This diff is collapsed.
Click to expand it.
ui/app/utils/units.js
+
6
-
0
View file @
94b127e8
...
...
@@ -66,3 +66,9 @@ export function formatScheduledHertz(hertz, startingUnitSize) {
const
[
number
,
unit
]
=
reduceHertz
(
hertz
,
'
MHz
'
,
startingUnitSize
);
return
`
${
roundFormatter
.
format
(
number
)}
${
unit
}
`
;
}
// Replaces the minus sign (−) with a hyphen (-).
// https://github.com/d3/d3-format/releases/tag/v2.0.0
export
function
replaceMinus
(
input
)
{
return
input
.
replace
(
'
−
'
,
'
-
'
);
}
This diff is collapsed.
Click to expand it.
ui/package.json
+
20
-
19
View file @
94b127e8
...
...
@@ -34,26 +34,26 @@
},
"devDependencies"
:
{
"@babel/plugin-proposal-object-rest-spread"
:
"^7.4.3"
,
"@ember/optional-features"
:
"
^1.3
.0"
,
"@ember/optional-features"
:
"
2.0
.0"
,
"@ember/test-helpers"
:
"^2.0.0"
,
"@glimmer/component"
:
"^1.0.1"
,
"@glimmer/tracking"
:
"^1.0.0"
,
"@hashicorp/structure-icons"
:
"^1.3.0"
,
"@storybook/ember-cli-storybook"
:
"https://github.com/DingoEatingFuzz/ember-cli-storybook#c207500"
,
"anser"
:
"^
1.4.8
"
,
"anser"
:
"^
2.1.0
"
,
"babel-eslint"
:
"^10.1.0"
,
"base64-js"
:
"^1.3.1"
,
"broccoli-asset-rev"
:
"^3.0.0"
,
"bulma"
:
"0.
6.1
"
,
"core-js"
:
"
^2.4
.1"
,
"d3-array"
:
"^
2
.1.
0
"
,
"d3-axis"
:
"^
1
.0.0"
,
"d3-format"
:
"^
1.
3.0"
,
"d3-scale"
:
"^
1
.0.
0
"
,
"d3-selection"
:
"^
1.1
.0"
,
"d3-shape"
:
"^
1.2.0
"
,
"d3-time-format"
:
"^
2.1
.0"
,
"d3-transition"
:
"^
1.1.0
"
,
"bulma"
:
"0.
9.3
"
,
"core-js"
:
"
3.19
.1"
,
"d3-array"
:
"^
3
.1.
1
"
,
"d3-axis"
:
"^
3
.0.0"
,
"d3-format"
:
"^3.0
.1
"
,
"d3-scale"
:
"^
4
.0.
2
"
,
"d3-selection"
:
"^
3.0
.0"
,
"d3-shape"
:
"^
3.0.1
"
,
"d3-time-format"
:
"^
4.0
.0"
,
"d3-transition"
:
"^
3.0.1
"
,
"duration-js"
:
"^4.0.0"
,
"ember-a11y-testing"
:
"^4.0.0"
,
"ember-auto-import"
:
"^1.6.0"
,
...
...
@@ -106,28 +106,28 @@
"eslint-plugin-ember-a11y-testing"
:
"a11y-tool-sandbox/eslint-plugin-ember-a11y-testing#ca31c9698c7cb105f1c9761d98fcaca7d6874459"
,
"eslint-plugin-node"
:
"^11.1.0"
,
"faker"
:
"^4.1.0"
,
"flat"
:
"^
4
.0.
0
"
,
"flat"
:
"^
5
.0.
2
"
,
"fuse.js"
:
"^3.4.4"
,
"glob"
:
"^
4.0.5
"
,
"glob"
:
"^
7.2.0
"
,
"http-proxy"
:
"^1.1.6"
,
"husky"
:
"^4.2.5"
,
"is-ip"
:
"^3.1.0"
,
"ivy-codemirror"
:
"IvyApp/ivy-codemirror#c3b7f49f8e6492878619f8055695581240cce21a"
,
"lint-staged"
:
"^1
0.1.3
"
,
"lint-staged"
:
"^1
1.2.6
"
,
"loader.js"
:
"^4.7.0"
,
"lodash.intersection"
:
"^4.4.0"
,
"morgan"
:
"^1.3.2"
,
"npm-run-all"
:
"^4.1.5"
,
"pretender"
:
"^3.0.1"
,
"prettier"
:
"^1.4.4"
,
"query-string"
:
"^
5
.0.
0
"
,
"qunit-dom"
:
"^
1.2
.0"
,
"query-string"
:
"^
7
.0.
1
"
,
"qunit-dom"
:
"^
2.0
.0"
,
"sass"
:
"^1.17.3"
,
"testem"
:
"^3.0.3"
,
"testem-multi-reporter"
:
"^1.2.0"
,
"text-encoder-lite"
:
"^2.0.0"
,
"xterm"
:
"^4.6.0"
,
"xterm-addon-fit"
:
"
^
0.
3
.0"
"xterm-addon-fit"
:
"0.
5
.0"
},
"optionalDependencies"
:
{
"@babel/plugin-transform-member-expression-literals"
:
"^7.2.0"
,
...
...
@@ -153,7 +153,8 @@
]
},
"dependencies"
:
{
"lru_map"
:
"^0.3.3"
,
"codemirror"
:
"^5.56.0"
,
"lru_map"
:
"^0.4.1"
,
"no-case"
:
"^3.0.4"
,
"title-case"
:
"^3.0.3"
},
...
...
This diff is collapsed.
Click to expand it.
ui/tests/acceptance/optimize-test.js
+
5
-
5
View file @
94b127e8
...
...
@@ -5,7 +5,7 @@ import { setupMirage } from 'ember-cli-mirage/test-support';
import
a11yAudit
from
'
nomad-ui/tests/helpers/a11y-audit
'
;
import
Response
from
'
ember-cli-mirage/response
'
;
import
moment
from
'
moment
'
;
import
{
formatBytes
,
formatHertz
}
from
'
nomad-ui/utils/units
'
;
import
{
formatBytes
,
formatHertz
,
replaceMinus
}
from
'
nomad-ui/utils/units
'
;
import
Optimize
from
'
nomad-ui/tests/pages/optimize
'
;
import
Layout
from
'
nomad-ui/tests/pages/layout
'
;
...
...
@@ -153,23 +153,23 @@ module('Acceptance | optimize', function(hooks) {
const
memDiffPercent
=
Math
.
round
((
100
*
memDiff
)
/
currMem
);
assert
.
equal
(
summary
.
cpu
,
replaceMinus
(
summary
.
cpu
)
,
cpuDiff
?
`
${
cpuSign
}${
formatHertz
(
cpuDiff
,
'
MHz
'
)}
${
cpuSign
}${
cpuDiffPercent
}
%`
:
''
);
assert
.
equal
(
summary
.
memory
,
replaceMinus
(
summary
.
memory
)
,
memDiff
?
`
${
memSign
}${
formattedMemDiff
(
memDiff
)}
${
memSign
}${
memDiffPercent
}
%`
:
''
);
assert
.
equal
(
summary
.
aggregateCpu
,
replaceMinus
(
summary
.
aggregateCpu
)
,
cpuDiff
?
`
${
cpuSign
}${
formatHertz
(
cpuDiff
*
currentTaskGroupAllocations
.
length
,
'
MHz
'
)}
`
:
''
);
assert
.
equal
(
summary
.
aggregateMemory
,
replaceMinus
(
summary
.
aggregateMemory
)
,
memDiff
?
`
${
memSign
}${
formattedMemDiff
(
memDiff
*
currentTaskGroupAllocations
.
length
)}
`
:
''
);
});
...
...
This diff is collapsed.
Click to expand it.
ui/tests/integration/components/das/recommendation-card-test.js
+
2
-
1
View file @
94b127e8
...
...
@@ -116,7 +116,8 @@ module('Integration | Component | das/recommendation-card', function(hooks) {
assert
.
equal
(
RecommendationCard
.
totalsTable
.
unitDiff
.
cpu
,
'
-75 MHz
'
);
assert
.
equal
(
RecommendationCard
.
totalsTable
.
unitDiff
.
memory
,
'
+128 MiB
'
);
assert
.
equal
(
RecommendationCard
.
totalsTable
.
percentDiff
.
cpu
,
'
-27%
'
);
// Expected signal has a minus character, not a hyphen.
assert
.
equal
(
RecommendationCard
.
totalsTable
.
percentDiff
.
cpu
,
'
−27%
'
);
assert
.
equal
(
RecommendationCard
.
totalsTable
.
percentDiff
.
memory
,
'
+33%
'
);
assert
.
equal
(
RecommendationCard
.
copyButton
.
text
,
'
job-name / group-name
'
);
...
...
This diff is collapsed.
Click to expand it.
ui/tests/integration/components/das/recommendation-chart-test.js
+
1
-
1
View file @
94b127e8
...
...
@@ -47,7 +47,7 @@ module('Integration | Component | das/recommendation-chart', function(hooks) {
assert
.
dom
(
'
.recommendation-chart.decrease
'
).
exists
();
assert
.
dom
(
'
.recommendation-chart .resource
'
).
hasText
(
'
Mem
'
);
assert
.
dom
(
'
.recommendation-chart .icon-is-arrow-down
'
).
exists
();
assert
.
dom
(
'
text.percent
'
).
hasText
(
'
-
32%
'
);
assert
.
dom
(
'
text.percent
'
).
hasText
(
'
−
32%
'
);
await
componentA11yAudit
(
this
.
element
,
assert
);
});
...
...
This diff is collapsed.
Click to expand it.
ui/yarn.lock
+
810
-
373
View file @
94b127e8
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help