Skip to content

Commit

Permalink
Merge branch 'main' into use-maas-react-components-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 authored Nov 8, 2023
2 parents 8c67f7c + 14dd2fc commit 5dc38c4
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 45 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"build-storybook": "storybook build"
},
"dependencies": {
"@canonical/maas-react-components": "1.4.1",
"@canonical/maas-react-components": "1.5.0",
"@canonical/macaroon-bakery": "1.3.2",
"@canonical/react-components": "0.46.0",
"@reduxjs/toolkit": "1.9.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ const generateDropdownContent = (
value: free >= 0 ? free : 0,
},
]}
label={
free >= 0 ? (
max={pool.total}
>
<Meter.Label>
{free >= 0 ? (
<ul className="p-inline-list u-no-margin--bottom">
<li
className="p-inline-list__item"
Expand Down Expand Up @@ -163,10 +165,9 @@ const generateDropdownContent = (
Only {byteDisplay(freeBytes, true)} GB available in {name}
.
</div>
)
}
max={pool.total}
/>
)}
</Meter.Label>
</Meter>
</div>
</button>
);
Expand Down
18 changes: 9 additions & 9 deletions src/app/kvm/components/KVMResourceMeter/KVMResourceMeter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ const KVMResourceMeter = ({
value: free > 0 ? free : 0,
},
]}
label={
detailed ? (
max={total}
size="small"
variant={segmented ? "segmented" : "regular"}
>
<Meter.Label className="u-align--right">
{detailed ? (
<div>
<div className="p-text--x-small-capitalised u-text--muted u-sv-1">
Total
Expand All @@ -110,13 +114,9 @@ const KVMResourceMeter = ({
>
{`${formattedAllocated} of ${formattedTotal}${formattedUnit} allocated`}
</small>
)
}
labelClassName="u-align--right"
max={total}
segmented={segmented}
small
/>
)}
</Meter.Label>
</Meter>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,35 +91,38 @@ const StoragePopover = ({
value: freeBytes > 0 ? freeBytes : 0,
},
]}
label={
<ul className="p-inline-list u-no-margin--bottom">
<li
className="p-inline-list__item"
data-testid="pool-allocated"
>
<i className="p-circle--link is-inline"></i>
{`${allocated.value}${allocated.unit}`}
</li>
{showOthers && (
max={pool.total}
>
<Meter.Label>
{
<ul className="p-inline-list u-no-margin--bottom">
<li
className="p-inline-list__item"
data-testid="pool-others"
data-testid="pool-allocated"
>
<i className="p-circle--positive is-inline"></i>
{`${other.value}${other.unit}`}
<i className="p-circle--link is-inline"></i>
{`${allocated.value}${allocated.unit}`}
</li>
)}
<li
className="p-inline-list__item"
data-testid="pool-free"
>
<i className="p-circle--link-faded is-inline"></i>
{`${free.value}${free.unit}`}
</li>
</ul>
}
max={pool.total}
/>
{showOthers && (
<li
className="p-inline-list__item"
data-testid="pool-others"
>
<i className="p-circle--positive is-inline"></i>
{`${other.value}${other.unit}`}
</li>
)}
<li
className="p-inline-list__item"
data-testid="pool-free"
>
<i className="p-circle--link-faded is-inline"></i>
{`${free.value}${free.unit}`}
</li>
</ul>
}
</Meter.Label>
</Meter>
</div>
</Fragment>
);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2907,10 +2907,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@canonical/maas-react-components@1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@canonical/maas-react-components/-/maas-react-components-1.4.1.tgz#9b165bed308a0ebfd361f86b485ca2bf0d28264b"
integrity sha512-D6RlDTIckoxyg/ZJa5f+WwhJuRynKeBsBKlWVph9eYWlp/31oCfC+voBnB1A6275pq1F5GVLm8DW+/cDMjbASA==
"@canonical/maas-react-components@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@canonical/maas-react-components/-/maas-react-components-1.5.0.tgz#3cda970c9f95a1379f22fddd37e9c94eb7e345b2"
integrity sha512-pef2X+mf/W+/3q3kkIBrD9gHjb0z0S+JghDkd0mlmYuCbGxb+PqXk0vzlyEfzbIsltI0H/UEJLtNhM6kVTtD9A==

"@canonical/[email protected]":
version "1.3.2"
Expand Down

0 comments on commit 5dc38c4

Please sign in to comment.