Skip to content

Commit

Permalink
WD-7613 - Make integrations tables responsive (canonical#1662)
Browse files Browse the repository at this point in the history
* Make integrations tables responsive. Rename 'relation' to 'integration'.
  • Loading branch information
huwshimi authored Nov 28, 2023
1 parent bdbf382 commit 667d83b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/pages/ControllersIndex/_controllers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
.controllers {
th,
td {
// Name
// Name.
&:nth-child(1) {
white-space: nowrap;
width: 20%;
}

// Status
// Status.
&:nth-child(2) {
width: 15%;
}

// Cloud
// Cloud.
&:nth-child(3) {
width: 15%;
}
Expand Down
10 changes: 5 additions & 5 deletions src/pages/EntityDetails/Model/Model.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe("Model", () => {
).not.toBeInTheDocument();
expect(
document.querySelector(
".entity-details__main > .entity-details__relations"
".entity-details__main > .entity-details__integrations"
)
).not.toBeInTheDocument();
expect(
Expand Down Expand Up @@ -202,7 +202,7 @@ describe("Model", () => {
).not.toBeInTheDocument();
expect(
document.querySelector(
".entity-details__main > .entity-details__relations"
".entity-details__main > .entity-details__integrations"
)
).not.toBeInTheDocument();
expect(
Expand Down Expand Up @@ -242,7 +242,7 @@ describe("Model", () => {
).toBeInTheDocument();
expect(
document.querySelector(
".entity-details__main > .entity-details__relations"
".entity-details__main > .entity-details__integrations"
)
).not.toBeInTheDocument();
expect(
Expand Down Expand Up @@ -282,7 +282,7 @@ describe("Model", () => {
).not.toBeInTheDocument();
expect(
document.querySelector(
".entity-details__main > .entity-details__relations"
".entity-details__main > .entity-details__integrations"
)
).toBeInTheDocument();
expect(
Expand Down Expand Up @@ -322,7 +322,7 @@ describe("Model", () => {
).not.toBeInTheDocument();
expect(
document.querySelector(
".entity-details__main > .entity-details__relations"
".entity-details__main > .entity-details__integrations"
)
).not.toBeInTheDocument();
expect(
Expand Down
16 changes: 8 additions & 8 deletions src/pages/EntityDetails/Model/Model.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,21 @@ const Model = () => {
relationTableRows.length > 0 ? (
<>
{shouldShow("relations-title", query.activeView) && (
<h5>Relations ({relationTableRows.length})</h5>
<h5>Integrations ({relationTableRows.length})</h5>
)}
<MainTable
headers={relationTableHeaders}
rows={relationTableRows}
className="entity-details__relations p-main-table"
className="entity-details__integrations p-main-table"
sortable
emptyStateMsg={"There are no relations in this model"}
emptyStateMsg="There are no integrations in this model"
/>
{shouldShow("relations-title", query.activeView) && (
<>
{consumedTableRows.length > 0 ||
(offersTableRows.length > 0 && (
<h5>
Cross-model relations (
Cross-model integrations (
{consumedTableRows.length + offersTableRows.length})
</h5>
))}
Expand All @@ -210,19 +210,19 @@ const Model = () => {
data-testid={TestId.CONSUMED}
headers={consumedTableHeaders}
rows={consumedTableRows}
className="entity-details__relations p-main-table"
className="p-main-table"
sortable
emptyStateMsg={"There are no remote relations in this model"}
emptyStateMsg="There are no remote integrations in this model"
/>
)}
{offersTableRows.length > 0 && (
<MainTable
data-testid={TestId.OFFERS}
headers={offersTableHeaders}
rows={offersTableRows}
className="entity-details__relations p-main-table"
className="p-main-table"
sortable
emptyStateMsg={"There are no connected offers in this model"}
emptyStateMsg="There are no connected offers in this model"
/>
)}
</>
Expand Down
27 changes: 25 additions & 2 deletions src/pages/EntityDetails/_entity-details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,31 @@
}
}

.entity-details__machines,
.entity-details__relations {
.entity-details__integrations {
th,
td {
// Type.
&:nth-child(4) {
width: 15%;
}

@include mobile-and-medium {
// Type.
&:nth-child(4) {
display: none;
}
}

@include mobile {
// Requirer.
&:nth-child(2) {
display: none;
}
}
}
}

.entity-details__machines {
th,
td {
&:nth-child(1) {
Expand Down

0 comments on commit 667d83b

Please sign in to comment.