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-1975
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Jan 10, 2024
2 parents 21e27ec + 1a766b1 commit 118cb96
Show file tree
Hide file tree
Showing 47 changed files with 863 additions and 474 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/projectSettings/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("Notifications", () => {
cy.dataCy("add-button").contains("Add Subscription").should("be.visible");
cy.dataCy("add-button").click();
cy.dataCy("expandable-card").should("contain.text", "New Subscription");
cy.selectLGOption("Event", "Any Version Finishes");
cy.selectLGOption("Event", "Any version finishes");
cy.selectLGOption("Notification Method", "Email");
cy.getInputByLabel("Email").type("[email protected]");
cy.dataCy("save-settings-button").scrollIntoView();
Expand All @@ -43,7 +43,7 @@ describe("Notifications", () => {
cy.dataCy("expandable-card")
.should("be.visible")
.should("contain.text", "New Subscription");
cy.selectLGOption("Event", "Any Task Finishes");
cy.selectLGOption("Event", "Any task finishes");
cy.selectLGOption("Notification Method", "Comment on a JIRA issue");
cy.getInputByLabel("JIRA Issue").type("JIRA-123");
cy.contains("Subscription type not allowed for tasks in a project.").should(
Expand All @@ -58,7 +58,7 @@ describe("Notifications", () => {
cy.dataCy("expandable-card")
.should("be.visible")
.should("contain.text", "New Subscription");
cy.selectLGOption("Event", "Any Version Finishes");
cy.selectLGOption("Event", "Any version finishes");
cy.selectLGOption("Notification Method", "Email");
cy.getInputByLabel("Email").type("Not a real email");
cy.contains("Value should be a valid email.").should("be.visible");
Expand Down
61 changes: 61 additions & 0 deletions cypress/integration/projectSettings/stepback_bisect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { clickSave } from "../../utils";
import { getGeneralRoute, project, projectUseRepoEnabled } from "./constants";

describe("Stepback bisect setting", () => {
describe("Repo project present", () => {
const destination = getGeneralRoute(projectUseRepoEnabled);

beforeEach(() => {
cy.visit(destination);
});

it("Starts as default to repo", () => {
cy.dataCy("stepback-bisect-group")
.contains("Default to repo")
.find("input")
.should("have.attr", "aria-checked", "true");
});

it("Clicking on enabled and then save shows a success toast", () => {
cy.dataCy("stepback-bisect-group").contains("Enable").click();
clickSave();
cy.validateToast("success", "Successfully updated project");

cy.reload();

cy.dataCy("stepback-bisect-group")
.contains("Enable")
.find("input")
.should("have.attr", "aria-checked", "true");
});
});

describe("Repo project not present", () => {
const destination = getGeneralRoute(project);

beforeEach(() => {
cy.visit(destination);
});

it("Starts as disabled", () => {
cy.dataCy("stepback-bisect-group")
.contains("Disable")
.find("input")
.should("have.attr", "aria-checked", "true");
});

it("Clicking on enabled and then save shows a success toast", () => {
cy.dataCy("stepback-bisect-group").contains("Enable").click();

clickSave();
cy.validateToast("success", "Successfully updated project");

cy.reload();

cy.dataCy("stepback-bisect-group")
.contains("Enable")
.find("input")
.should("have.attr", "aria-checked", "true");
});
});
});
2 changes: 1 addition & 1 deletion cypress/integration/spawn/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("Navigating to Spawn Host page", () => {
cy.dataCy("distro-option-ubuntu1804-workstation")
.should("be.visible")
.click();
cy.dataCy("volume-select").should("be.disabled");
cy.dataCy("volume-select").should("have.attr", "aria-disabled", "true");
});

it("Clicking 'Add new key' hides the key name dropdown and shows the key value text area", () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/spawn/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe("Spawn volume page", () => {
).click();
cy.dataCy("distro-input").click();
cy.dataCy("distro-option-ubuntu1804-workstation").click();
cy.dataCy("region-select").should("be.disabled");
cy.dataCy("region-select").should("have.attr", "aria-disabled", "true");
cy.dataCy("migrate-modal").contains("Next").click({ force: true });
cy.dataCy("migrate-modal")
.contains("Migrate Volume")
Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/subscription_modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe("Waterfall subscription modal", () => {
cy.dataCy("add-notification").click();
cy.dataCy(dataCyModal).should("be.visible");

cy.selectLGOption("Event", "Any Version Finishes");
cy.selectLGOption("Event", "Any version finishes");
cy.selectLGOption("Notification Method", "JIRA issue");

cy.dataCy("jira-comment-input").type("EVG-2000");
Expand All @@ -160,7 +160,7 @@ describe("Waterfall subscription modal", () => {
cy.dataCy("add-notification").click();
cy.dataCy(dataCyModal).should("be.visible");

cy.selectLGOption("Event", "Any Build Finishes");
cy.selectLGOption("Event", "Any build finishes");
cy.dataCy("add-button").click();
saveButtonEnabled(false);

Expand All @@ -179,7 +179,7 @@ describe("Waterfall subscription modal", () => {
cy.dataCy("add-notification").click();
cy.dataCy(dataCyModal).should("be.visible");

cy.selectLGOption("Event", "Any Version Finishes");
cy.selectLGOption("Event", "Any version finishes");
cy.dataCy("jira-comment-input").type("EVG-2000");
mockErrorResponse({
path: "SaveSubscription",
Expand Down Expand Up @@ -207,7 +207,7 @@ describe("Waterfall subscription modal", () => {
cy.dataCy("waterfall-menu").click();
cy.dataCy("add-notification").click();
cy.dataCy(dataCyModal).should("be.visible");
cy.contains("Any Build Fails").should("be.visible");
cy.contains("Any build fails").should("be.visible");
cy.contains("Slack").should("be.visible");

cy.clearCookie(subscriptionCookie);
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/task/files_tables.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe("files table", () => {
const FILES_ROUTE = "/task/evergreen_ubuntu1604_89/files";
const FILES_ROUTE_WITHOUT_FILES =
"/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files ";
"/task/evergreen_ubuntu1604_test_model_commitqueue_patch_5e823e1f28baeaa22ae00823d83e03082cd148ab_5e4ff3abe3c3317e352062e4_20_02_21_15_13_48/files";

it("File names under name column should link to a new tab", () => {
cy.visit(FILES_ROUTE);
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spruce",
"version": "3.0.184",
"version": "3.0.188",
"private": true,
"scripts": {
"bootstrap-logkeeper": "./scripts/bootstrap-logkeeper.sh",
Expand Down Expand Up @@ -64,20 +64,20 @@
"@leafygreen-ui/callout": "9.0.13",
"@leafygreen-ui/card": "10.0.5",
"@leafygreen-ui/checkbox": "12.0.5",
"@leafygreen-ui/code": "14.0.1",
"@leafygreen-ui/code": "14.2.18",
"@leafygreen-ui/combobox": "7.0.1",
"@leafygreen-ui/confirmation-modal": "5.0.6",
"@leafygreen-ui/emotion": "4.0.7",
"@leafygreen-ui/expandable-card": "3.0.5",
"@leafygreen-ui/guide-cue": "5.0.4",
"@leafygreen-ui/icon": "11.12.1",
"@leafygreen-ui/icon-button": "15.0.5",
"@leafygreen-ui/guide-cue": "5.0.5",
"@leafygreen-ui/icon": "11.26.0",
"@leafygreen-ui/icon-button": "15.0.19",
"@leafygreen-ui/inline-definition": "6.0.14",
"@leafygreen-ui/interaction-ring": "7.0.2",
"@leafygreen-ui/leafygreen-provider": "3.1.10",
"@leafygreen-ui/loading-indicator": "2.0.6",
"@leafygreen-ui/menu": "20.0.1",
"@leafygreen-ui/modal": "16.0.1",
"@leafygreen-ui/modal": "16.0.3",
"@leafygreen-ui/number-input": "1.0.18",
"@leafygreen-ui/pagination": "1.0.12",
"@leafygreen-ui/palette": "4.0.7",
Expand All @@ -86,12 +86,12 @@
"@leafygreen-ui/radio-group": "10.1.1",
"@leafygreen-ui/search-input": "2.0.8",
"@leafygreen-ui/segmented-control": "8.2.6",
"@leafygreen-ui/select": "10.2.0",
"@leafygreen-ui/select": "11.1.1",
"@leafygreen-ui/side-nav": "14.0.3",
"@leafygreen-ui/skeleton-loader": "1.1.0",
"@leafygreen-ui/table": "12.1.4",
"@leafygreen-ui/tabs": "11.0.4",
"@leafygreen-ui/text-area": "8.0.4",
"@leafygreen-ui/text-area": "8.0.21",
"@leafygreen-ui/text-input": "12.1.0",
"@leafygreen-ui/toast": "6.1.4",
"@leafygreen-ui/toggle": "10.0.17",
Expand Down Expand Up @@ -158,7 +158,7 @@
"@types/new-relic-browser": "0.1212.2",
"@types/node": "^16.11.47",
"@types/pluralize": "0.0.29",
"@types/prompts": "2.4.6",
"@types/prompts": "2.4.9",
"@types/react": "18.2.0",
"@types/react-dom": "18.2.0",
"@typescript-eslint/eslint-plugin": "5.57.1",
Expand All @@ -178,7 +178,7 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.2.1",
"eslint-plugin-jsdoc": "^46.2.6",
"eslint-plugin-jsdoc": "48.0.2",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.30.1",
Expand Down
4 changes: 4 additions & 0 deletions src/analytics/task/useTaskAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ type Action =
}
| { name: "Click Trace Link" }
| { name: "Click Trace Metrics Link" }
| { name: "Click Last Passing Stepback Task Link" }
| { name: "Click Last Failing Stepback Task Link" }
| { name: "Click Previous Stepback Task Link" }
| { name: "Click Next Stepback Task Link" }
| { name: "Submit Previous Commit Selector"; type: CommitType };

export const useTaskAnalytics = () => {
Expand Down
1 change: 0 additions & 1 deletion src/components/Hosts/UpdateStatusModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export const UpdateStatusModal: React.FC<Props> = ({
);
};

// @ts-expect-error
const StyledSelect = styled(Select)`
margin-bottom: ${size.xs};
`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Notifications/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("getGqlPayload", () => {
type: "email",
target: "[email protected]",
},
trigger: "family-outcome",
trigger: "outcome",
trigger_data: {},
});
});
Expand Down
1 change: 0 additions & 1 deletion src/components/PageSizeSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const PageSizeSelector: React.FC<Props> = ({ onChange, value, ...rest }) => (
</StyledSelect>
);

// @ts-expect-error
const StyledSelect = styled(Select)`
width: 120px;
`;
Expand Down
42 changes: 32 additions & 10 deletions src/components/Table/BaseTable.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useRef } from "react";
import { useRef, useState } from "react";
import { css } from "@leafygreen-ui/emotion";
import { LGColumnDef, useLeafyGreenTable } from "@leafygreen-ui/table";
import { WordBreak } from "components/styles";
import { CustomStoryObj, CustomMeta } from "test_utils/types";
Expand All @@ -9,7 +10,7 @@ export default {
} satisfies CustomMeta<typeof BaseTable>;

export const Default: CustomStoryObj<typeof BaseTable> = {
render: (args) => <TemplateComponent {...args} data={defaultRows} />,
render: (args) => <TemplateComponent {...args} data={makeDefaultRows(100)} />,
args: {
shouldAlternateRowColor: true,
darkMode: false,
Expand Down Expand Up @@ -39,6 +40,23 @@ export const LongContent: CustomStoryObj<typeof BaseTable> = {
darkMode: false,
},
};
const virtualScrollingContainerHeight = css`
height: 500px;
`;
export const VirtualTable: CustomStoryObj<typeof BaseTable> = {
render: (args) => (
<TemplateComponent
{...args}
data={makeDefaultRows(10000)}
useVirtualScrolling
className={virtualScrollingContainerHeight}
/>
),
args: {
shouldAlternateRowColor: true,
darkMode: false,
},
};

export const Loading: CustomStoryObj<typeof BaseTable> = {
render: (args) => <TemplateComponent {...args} data={[]} />,
Expand All @@ -55,11 +73,12 @@ interface DataShape {
size: string;
}

const defaultRows: DataShape[] = Array.from({ length: 100 }, (_, i) => ({
name: `name ${i}`,
type: `type ${i}`,
size: `size ${i}`,
}));
const makeDefaultRows = (count: number): DataShape[] =>
Array.from({ length: count }, (_, i) => ({
name: `name ${i}`,
type: `type ${i}`,
size: `size ${i}`,
}));

const nestedRows: DataShape[] = Array.from({ length: 50 }, (_, i) => ({
name: `name ${i}`,
Expand Down Expand Up @@ -115,17 +134,20 @@ const columns: LGColumnDef<DataShape>[] = [
const TemplateComponent: React.FC<
React.ComponentProps<typeof BaseTable> & {
data: DataShape[];
useVirtualScrolling?: boolean;
}
> = (args) => {
const { data, ...rest } = args;
const { data, useVirtualScrolling, ...rest } = args;
const tableContainerRef = useRef<HTMLDivElement>(null);
const tableData = useState(() => data)[0];
const table = useLeafyGreenTable<DataShape>({
data,
data: tableData,
columns,
containerRef: tableContainerRef,
useVirtualScrolling,
});

return <BaseTable {...rest} table={table} />;
return <BaseTable {...rest} table={table} ref={tableContainerRef} />;
};

interface CellProps {
Expand Down
Loading

0 comments on commit 118cb96

Please sign in to comment.