Skip to content

Commit

Permalink
DEVPROD-7660: Add link to image page in task metadata (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
minnakt authored Sep 10, 2024
1 parent 9590b01 commit d9a8390
Show file tree
Hide file tree
Showing 14 changed files with 163 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("distroSettings/navigation", () => {
cy.location("pathname").should("not.contain", "/distros");
cy.location("pathname").should(
"eq",
"/distro/localhost/settings/general",
"/distro/archlinux-test/settings/general",
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion apps/spruce/cypress/integration/hosts/select_hosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ describe("Select hosts in hosts page table", () => {
cy.dataCy("reprovision-button").should("be.visible").click();
cy.dataCy("reprovision-button-popover").should("be.visible");
cy.contains("button", "Yes").click();
cy.validateToast("success", "Marked hosts to reprovision for 0 hosts");
cy.validateToast("success", "Marked hosts to reprovision for 3 hosts");
});
});
11 changes: 11 additions & 0 deletions apps/spruce/cypress/integration/image/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,15 @@ describe("/image/imageId/random redirect route", () => {
});
});
});

it("navigates to the image page from the task page", () => {
cy.visit(
"/task/evergreen_ubuntu1604_test_annotations_b_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48",
);
cy.dataCy("task-image-link")
.should("have.attr", "href")
.and("eq", "/image/ubuntu1604/build-information");
cy.dataCy("task-image-link").click();
cy.location("pathname").should("eq", "/image/ubuntu1604/build-information");
});
});
2 changes: 1 addition & 1 deletion apps/spruce/cypress/integration/nav_bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Nav Bar", () => {
cy.dataCy("auxiliary-dropdown-distro-settings").should(
"have.attr",
"href",
"/distro/localhost/settings/general",
"/distro/archlinux-test/settings/general",
);
});
it("Nav Dropdown should link to patches page of default project in SpruceConfig if cookie does not exist", () => {
Expand Down
1 change: 1 addition & 0 deletions apps/spruce/src/gql/generated/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8807,6 +8807,7 @@ export type TaskQuery = {
generatedBy?: string | null;
generatedByName?: string | null;
hostId?: string | null;
imageId: string;
ingestTime?: Date | null;
isPerfPluginEnabled: boolean;
latestExecution: number;
Expand Down
1 change: 1 addition & 0 deletions apps/spruce/src/gql/mocks/taskData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const taskQuery: TaskQueryType = {
canUnschedule: false,
dependsOn: [],
displayName: "e2e_test",
imageId: "ubuntu1604",
distroId: "ubuntu1604-small",
estimatedStart: 1000,
pod: null,
Expand Down
1 change: 1 addition & 0 deletions apps/spruce/src/gql/queries/task.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ query Task($taskId: String!, $execution: Int) {
generatedBy
generatedByName
hostId
imageId
ingestTime
isPerfPluginEnabled
latestExecution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
class="css-qqg5h5-Divider eb6szep0"
/>
</div>

<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,26 @@
class="css-qqg5h5-Divider eb6szep0"
/>
</div>

<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
ID:
</b>

ami-0c83bb0a9f48c15bf
<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
>
<span>
i-0e0e62799806e037d
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
Expand All @@ -176,20 +185,31 @@
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
ID:
Image:
</b>

<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
data-cy="task-image-link"
href="/image/ubuntu1604/build-information"
>
<span>
i-0e0e62799806e037d
ubuntu1604
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
</b>

ami-0c83bb0a9f48c15bf
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,26 @@
class="css-qqg5h5-Divider eb6szep0"
/>
</div>

<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
ID:
</b>

ami-0c83bb0a9f48c15bf
<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
>
<span>
i-0e0e62799806e037d
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
Expand All @@ -172,20 +181,31 @@
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
ID:
Image:
</b>

<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
data-cy="task-image-link"
href="/image/ubuntu1604/build-information"
>
<span>
i-0e0e62799806e037d
ubuntu1604
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
</b>

ami-0c83bb0a9f48c15bf
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,26 @@
class="css-qqg5h5-Divider eb6szep0"
/>
</div>

<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
ID:
</b>

ami-0c83bb0a9f48c15bf
<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
>
<span>
i-0e0e62799806e037d
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
Expand All @@ -176,20 +185,31 @@
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
ID:
Image:
</b>

<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
data-cy="task-image-link"
href="/image/ubuntu1604/build-information"
>
<span>
i-0e0e62799806e037d
ubuntu1604
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
</b>

ami-0c83bb0a9f48c15bf
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,26 @@
class="css-qqg5h5-Divider eb6szep0"
/>
</div>

<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
ID:
</b>

ami-0c83bb0a9f48c15bf
<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
>
<span>
i-0e0e62799806e037d
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
Expand All @@ -176,20 +185,31 @@
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
ID:
Image:
</b>

<a
class="lg-ui-0001 css-1gw3cuq-StyledLink leafygreen-ui-16e7rxl"
data-cy="task-host-link"
href="/host/i-0e0e62799806e037d"
target="_self"
data-cy="task-image-link"
href="/image/ubuntu1604/build-information"
>
<span>
i-0e0e62799806e037d
ubuntu1604
</span>
</a>
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
data-cy="task-metadata-ami"
>
<b
class="css-1xk67r-MetadataLabel e1ul56zb0"
>
AMI:
</b>

ami-0c83bb0a9f48c15bf
</p>
<p
class="css-1spnncu-Item-wordBreakCss e1ul56zb1 leafygreen-ui-1tb6tuo"
>
Expand Down
Loading

0 comments on commit d9a8390

Please sign in to comment.