Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] [ALS-1848] Default overview page #230

Merged
merged 3 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions cypress/e2e/userIsAbleToUseTheSidebar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,34 @@ describe("Sidebar", () => {
it("SB-001 - should allow user to access the sidebar via hamburger menu", { scrollBehavior: false }, () => {
cy.visitDomain(`${Cypress.env("WEB_DOMAIN")}/demo`);
cy.get('[data-testid="hamburger-menu"]').click();
cy.get("div").should("contain", "Demo")
.and("contain", "Geofence")
.and("contain", "Tracker")
.and("contain", "Settings")
.and("contain", "Overview")
.and("contain", "Samples");
});
cy.get("div")
.should("contain", "Demo")
.and("contain", "Geofence")
.and("contain", "Tracker")
.and("contain", "Settings")
.and("contain", "Samples");
});
});

context("Responsive view", () => {
it("SB-002 - should allow user to access the Bottom Sheet (sidebar) in responsive menu", { scrollBehavior: false }, () => {
cy.visitDomainInResponsiveView(`${Cypress.env("WEB_DOMAIN")}/demo`);
cy.openResponsiveMenu('[data-testid="bottomsheet"]');
cy.get('[data-testid="explore-button-container-Map style"]').should("contain", "Map style");
cy.get('[data-testid="explore-button-container-Routes"]').should("contain", "Routes");
cy.get('[data-testid="explore-button-container-Geofences"]').should("contain", "Geofences");
cy.get('[data-testid="explore-button-container-Trackers"]').should("contain", "Tracker");
cy.get('[data-testid="iconic-info-card-title"]')
.should("contain", "Overview")
.and("contain", "Samples")
.and("contain", "Migration")
.and("contain", "Pricing")
.and("contain", "Settings")
.and("contain", "About")
.and("contain", "Provide Feedback")
});
it(
"SB-002 - should allow user to access the Bottom Sheet (sidebar) in responsive menu",
{ scrollBehavior: false },
() => {
cy.visitDomainInResponsiveView(`${Cypress.env("WEB_DOMAIN")}/demo`);
cy.openResponsiveMenu('[data-testid="bottomsheet"]');
cy.get('[data-testid="explore-button-container-Map style"]').should("contain", "Map style");
cy.get('[data-testid="explore-button-container-Routes"]').should("contain", "Routes");
cy.get('[data-testid="explore-button-container-Geofences"]').should("contain", "Geofences");
cy.get('[data-testid="explore-button-container-Trackers"]').should("contain", "Tracker");
cy.get('[data-testid="iconic-info-card-title"]')
.should("contain", "Samples")
.and("contain", "Migration")
.and("contain", "Pricing")
.and("contain", "Settings")
.and("contain", "About")
.and("contain", "Provide Feedback");
}
);
});
});
7 changes: 0 additions & 7 deletions src/atomicui/organisms/Explore/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const {
PRICING_PAGE
},
ROUTES: {
OVERVIEW,
SAMPLES,
MIGRATE_FROM_GOOGLE_MAPS,
MIGRATE_A_WEB_APP,
Expand Down Expand Up @@ -271,12 +270,6 @@ const Explore: FC<IProps> = ({

const exploreMoreOptions = useMemo(
() => [
{
title: t("header__overview.text"),
description: t("settings_modal_option__overview.text"),
onClickHandler: () => navigate(OVERVIEW),
isEnabled: true
},
{
title: t("samples.text"),
description: t("settings_modal_option__samples.text"),
Expand Down
4 changes: 2 additions & 2 deletions src/atomicui/organisms/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const List = lazy(() => import("@demo/atomicui/atoms/List").then(module => ({ de
const Logo = lazy(() => import("@demo/atomicui/atoms/Logo").then(module => ({ default: module.Logo })));

const {
ROUTES: { DEMO, OVERVIEW }
ROUTES: { DEFAULT, DEMO }
} = appConfig;

interface SidebarProps {
Expand Down Expand Up @@ -136,7 +136,7 @@ const Sidebar: FC<SidebarProps> = ({
padding: "16px 20px",
cursor: "pointer"
}}
onClick={() => navigate(OVERVIEW)}
onClick={() => navigate(DEFAULT)}
/>

<View className="icon-container">
Expand Down
1 change: 0 additions & 1 deletion src/core/constants/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const appConfig = {
NL_DEMO: "/demo?dp=Esri&nl=true",
NOT_FOUND: "/404",
ERROR_BOUNDARY: "/error",
OVERVIEW: "/overview",
SAMPLES: "/samples",
SAMPLE_DETAILS: "/sample/:sampleId",
HELP: "/demo/help",
Expand Down
10 changes: 0 additions & 10 deletions src/core/constants/marketingMenuOptionsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* SPDX-License-Identifier: MIT-0 */

import IconCodeMenu from "@demo/assets/svgs/icon-code-menu-icon.svg";
import IconCompassMenu from "@demo/assets/svgs/icon-compass-menu-icon.svg";
import IconDollarSolid from "@demo/assets/svgs/icon-dollar-solid.svg";
import IconSwap from "@demo/assets/svgs/icon-swap.svg";

Expand All @@ -18,7 +17,6 @@ const {
PRICING_PAGE
},
ROUTES: {
OVERVIEW,
SAMPLES,
MIGRATE_FROM_GOOGLE_MAPS,
MIGRATE_A_WEB_APP,
Expand All @@ -39,7 +37,6 @@ type MenuItem = {
};

const routeToEnvMapping = {
[OVERVIEW]: "1",
[SAMPLES]: "1",
[MIGRATE_FROM_GOOGLE_MAPS]: MIGRATE_FROM_GOOGLE_MAPS_PAGE,
[MIGRATE_A_WEB_APP]: MIGRATE_A_WEB_APP_PAGE,
Expand All @@ -52,13 +49,6 @@ const routeToEnvMapping = {
const shouldIncludeMenuItem = (menuItem: MenuItem) => !!parseInt(routeToEnvMapping[menuItem?.link]);

let marketingMenuOptionsData: MenuItem[] = [
{
label: "header__overview.text",
link: OVERVIEW,
iconBeforeLink: IconCompassMenu,
iconContainerClass: "menu-item-icon",
isExternalLink: false
},
{
label: "samples.text",
link: SAMPLES,
Expand Down
42 changes: 0 additions & 42 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jest.mock("@demo/core/constants/appConfig", () => ({
NL_DEMO: "/demo?dp=Esri&nl=true",
NOT_FOUND: "/404",
ERROR_BOUNDARY: "/error",
OVERVIEW: "/overview",
SAMPLES: "/samples",
SAMPLE_DETAILS: "/sample/:sampleId",
HELP: "/demo/help",
Expand Down Expand Up @@ -101,47 +100,6 @@ jest.mock("@demo/core/constants/appConfig", () => ({
[-123.061047, 49.303531] // northeast corner
]
},
// MAP_ITEMS: {
// [EsriMapEnum.ESRI_DARK_GRAY_CANVAS]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_DARK_GRAY_CANVAS]
// },
// [EsriMapEnum.ESRI_IMAGERY]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_IMAGERY]
// },
// [EsriMapEnum.ESRI_LIGHT]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_LIGHT]
// },
// [EsriMapEnum.ESRI_LIGHT_GRAY_CANVAS]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_LIGHT_GRAY_CANVAS]
// },
// [EsriMapEnum.ESRI_NAVIGATION]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_NAVIGATION]
// },
// [EsriMapEnum.ESRI_STREET_MAP]: {
// style: EsriMapStyleEnum[EsriMapEnum.ESRI_STREET_MAP]
// },
// [HereMapEnum.HERE_EXPLORE]: {
// style: HereMapStyleEnum[HereMapEnum.HERE_EXPLORE]
// },
// [HereMapEnum.HERE_CONTRAST]: {
// style: HereMapStyleEnum[HereMapEnum.HERE_CONTRAST]
// },
// [HereMapEnum.HERE_EXPLORE_TRUCK]: {
// style: HereMapStyleEnum[HereMapEnum.HERE_EXPLORE_TRUCK]
// },
// [HereMapEnum.HERE_HYBRID]: {
// style: HereMapStyleEnum[HereMapEnum.HERE_HYBRID]
// },
// [HereMapEnum.HERE_IMAGERY]: {
// style: HereMapStyleEnum[HereMapEnum.HERE_IMAGERY]
// },
// [GrabMapEnum.GRAB_STANDARD_LIGHT]: {
// style: GrabMapStyleEnum[GrabMapEnum.GRAB_STANDARD_LIGHT]
// },
// [GrabMapEnum.GRAB_STANDARD_DARK]: {
// style: GrabMapStyleEnum[GrabMapEnum.GRAB_STANDARD_DARK]
// }
// },
MAP_STYLES: {
ESRI_STYLES: [
{ id: "location.aws.com.demo.maps.Esri.Light", image: "", name: "Light" },
Expand Down
Loading