Skip to content

Feature: Content app sidebar redesign #2197

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

Merged
merged 117 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
f727131
task: changed global menu style
finnar-bin Jul 18, 2023
9cde14f
task: adjust instance menu style
finnar-bin Jul 18, 2023
26ef3e7
task: remove white bg
finnar-bin Jul 19, 2023
c35a544
task: convert usage of theme to getTheme
finnar-bin Jul 19, 2023
2ecfa51
task: created reusable appsidebar component
finnar-bin Jul 19, 2023
fc25650
task: added subheader components
finnar-bin Jul 19, 2023
2a9aba7
task: fixed hover color
finnar-bin Jul 19, 2023
418d5ca
task: fixed list item height
finnar-bin Jul 19, 2023
5f75640
task: change spacing
finnar-bin Jul 19, 2023
4d6ace7
task: wire button click routing
finnar-bin Jul 19, 2023
746c210
task: only allow scrolling for children
finnar-bin Jul 19, 2023
efeaef1
task: updated scrollbar color and only scroll children
finnar-bin Jul 19, 2023
9ffadb1
task: nav tree
finnar-bin Jul 20, 2023
c6f079d
task: convert nav to tsx
finnar-bin Jul 20, 2023
ef997ae
task: added todo
finnar-bin Jul 20, 2023
da31098
task: added other navs
finnar-bin Jul 20, 2023
df0104f
task: create new nav tree component based off of mui treeview
finnar-bin Jul 20, 2023
637d65a
task: update styling for nav tree item
finnar-bin Jul 20, 2023
fb64bf6
task: fixed tree actions icon colors
finnar-bin Jul 20, 2023
a27e045
task: icon button bgcolor
finnar-bin Jul 20, 2023
22e55bb
task: add module augmentation for new icon button size
finnar-bin Jul 21, 2023
0dc7dae
task: item select style
finnar-bin Jul 21, 2023
c95056c
task: css nesting
finnar-bin Jul 21, 2023
4323bac
task: create nav tree item type
finnar-bin Jul 21, 2023
3756d61
task: fix layout when screen is small
finnar-bin Jul 21, 2023
48c7998
task: styling update
finnar-bin Jul 21, 2023
e80dde3
task: change from getTheme to light or dark theme imports
finnar-bin Jul 21, 2023
33ea012
task: replace treeview arrow icons
finnar-bin Jul 21, 2023
972d26c
task: change nav tree item selected width
finnar-bin Jul 21, 2023
68fa448
task: added rtk query and logic to get nav items
finnar-bin Jul 24, 2023
9745dce
task: map chilren to parents
finnar-bin Jul 24, 2023
cbe5404
task: split nav items
finnar-bin Jul 24, 2023
1caa168
task: cleanup
finnar-bin Jul 24, 2023
f43b4c5
task: dynamic width calculate
finnar-bin Jul 24, 2023
ee551a3
task: revert to using theme instead of lightTheme import
finnar-bin Jul 25, 2023
4d5ea1f
task: added hidden items accordion
finnar-bin Jul 25, 2023
aaf0701
task: wire nav item click
finnar-bin Jul 25, 2023
8274f5f
task: wire collapse tree
finnar-bin Jul 25, 2023
074f22d
task: wire search filter
finnar-bin Jul 25, 2023
5d012e4
task: auto scroll down when hidden items are collapsed
finnar-bin Jul 25, 2023
00de99a
task: change to scopedcssbaseline
finnar-bin Jul 25, 2023
08db023
chore: local material-ui
finnar-bin Jul 26, 2023
a61324a
Merge branch 'master' of github.com:zesty-io/manager-ui into feature/…
finnar-bin Jul 26, 2023
f92f275
task: add new content modal
finnar-bin Jul 26, 2023
bfbc775
task: sort models
finnar-bin Jul 26, 2023
8f71f1d
Add Resizable container component
agalin920 Jul 26, 2023
8591408
remove log
agalin920 Jul 26, 2023
f1eef38
add comment
agalin920 Jul 26, 2023
7c0c2a8
task: invalidate content nav data on item create, delete and edit
finnar-bin Jul 26, 2023
22aa30d
task: update create content item style
finnar-bin Jul 26, 2023
5759986
task: set selected nav item even for nested urls
finnar-bin Jul 26, 2023
da33e24
task: fixed nested item depth
finnar-bin Jul 26, 2023
f14c441
task: add type limiter to create item dialog
finnar-bin Jul 26, 2023
db39ae9
task: wire per item create
finnar-bin Jul 27, 2023
f50d3b3
task: fixed highlighting of nested items inside dataset and templateset
finnar-bin Jul 27, 2023
cea2e7d
task: add reorder modal
finnar-bin Jul 27, 2023
4794b22
task: invalidate nav items on content reorder
finnar-bin Jul 27, 2023
6a2c38c
task: refresh nav data on link edit/delete
finnar-bin Jul 27, 2023
014daba
task: create hide/unhide item modal
finnar-bin Jul 27, 2023
5665284
task: wire hide/unhide
finnar-bin Jul 27, 2023
c0a41ad
task: skip nav fetch when user role fails
finnar-bin Jul 27, 2023
742f020
task: prevent page from loading when nav data is fails to fetch
finnar-bin Jul 27, 2023
60d5d9b
task: error handling
finnar-bin Jul 27, 2023
b95fd8f
task: remove tooltip
finnar-bin Jul 27, 2023
b5f9258
task: added releases as subpage
finnar-bin Jul 28, 2023
41f9d65
task: fixed active highlighting for releases subpage
finnar-bin Jul 28, 2023
3be240e
task: revert removal
finnar-bin Jul 28, 2023
8ade3d5
task: update build tree logic
finnar-bin Jul 28, 2023
357f24b
task: delete old nav tree
finnar-bin Jul 28, 2023
8f1210a
task: use new nav tree
finnar-bin Jul 28, 2023
9337342
fix: fixed reorder bug
finnar-bin Jul 28, 2023
dfe26ee
task: added tooltips
finnar-bin Jul 30, 2023
3b0b08a
Merge branch 'resizeable-container-component' of github.com:zesty-io/…
finnar-bin Jul 30, 2023
6fbd61d
task: integrate resizable component to app sidebar
finnar-bin Jul 30, 2023
1681449
task: added nav error state
finnar-bin Jul 31, 2023
44b02a7
task: layout fixes
finnar-bin Jul 31, 2023
8758b86
task: prevent text selection when dragging
finnar-bin Jul 31, 2023
275928d
task: delete old content nav
finnar-bin Jul 31, 2023
aa6843e
chore: cleanup
finnar-bin Jul 31, 2023
b1dae0d
fix: fixed undefined url
finnar-bin Jul 31, 2023
2a46bf8
task: version bump
finnar-bin Jul 31, 2023
2d2e9a8
task: added id
finnar-bin Jul 31, 2023
17808cf
task: moved naverror outside
finnar-bin Jul 31, 2023
de829d1
task: removed unneccessary prop
finnar-bin Jul 31, 2023
1fed39f
task: removed usememo
finnar-bin Jul 31, 2023
5174cd3
ResizeableContainer updates
agalin920 Jul 31, 2023
0293de2
remove user select
agalin920 Jul 31, 2023
53ab4a8
task: comment fixes
finnar-bin Jul 31, 2023
6f8182d
Merge branch 'feature/content-sidebar-redesign' of github.com:zesty-i…
finnar-bin Jul 31, 2023
b97d5f6
task: change nav item + button flow
finnar-bin Jul 31, 2023
2e924a1
task: hide subroutes when user filters items
finnar-bin Jul 31, 2023
1f20db7
task: limit height and create on click
finnar-bin Jul 31, 2023
71c62f8
task: icon change
finnar-bin Aug 1, 2023
41a75b6
task: changed to regular button
finnar-bin Aug 1, 2023
8c18ce8
task: vqa fixes
finnar-bin Aug 1, 2023
6cd88fa
task: moved pages header
finnar-bin Aug 1, 2023
88e1c34
task: overflow fix
finnar-bin Aug 1, 2023
7c884cb
task: moved back header comp
finnar-bin Aug 1, 2023
e1adb92
task: cypress tests
finnar-bin Aug 1, 2023
170bf01
resize updates
agalin920 Aug 1, 2023
fbefe8a
task: update tooltip delay
finnar-bin Aug 1, 2023
21395e4
task: hide releases
finnar-bin Aug 1, 2023
4a1e162
Merge branch 'feature/content-sidebar-redesign' of github.com:zesty-i…
finnar-bin Aug 1, 2023
b168d3f
task: refresh nav content data on model create/delete
finnar-bin Aug 1, 2023
3a9fe20
task: expand all navs by default
finnar-bin Aug 2, 2023
ed89530
task: use custom icon button that can look like a contained button
finnar-bin Aug 2, 2023
304962b
fix: items not collapsing at times
finnar-bin Aug 3, 2023
96880d7
task: added debounce on item filtering
finnar-bin Aug 3, 2023
fc0ce62
fix: uncollapsable datasets in page category
finnar-bin Aug 3, 2023
01abf99
task: moved header inside app bar
finnar-bin Aug 3, 2023
8f2db44
fix: memoize tree item
finnar-bin Aug 3, 2023
593e375
task: missing pb
finnar-bin Aug 3, 2023
2bdb480
Merge branch 'master' into feature/content-sidebar-redesign
shrunyan Aug 3, 2023
26fdcea
task: added separate memoized value for filtered content, moved where…
finnar-bin Aug 3, 2023
5695acc
Merge branch 'feature/content-sidebar-redesign' of github.com:zesty-i…
finnar-bin Aug 3, 2023
b51f9b1
task: version bump material-ui
finnar-bin Aug 7, 2023
c648dae
task: refetch nav data on mount
finnar-bin Aug 9, 2023
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
37 changes: 20 additions & 17 deletions cypress/e2e/content/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,35 @@ describe("Navigation through content editor", () => {
});

it("Opens homepage item", () => {
cy.get("#MainNavigation li a").contains("Homepage").click();
cy.getBySelector("pages_nav")
.find("li p[aria-label='Homepage']")
.should("exist")
.click();
cy.get("#12-0c3934-8dz720").should("exist");
});

it("Opens the reorder nav modal", () => {
cy.get("#ReorderNavButton").click();
cy.getBySelector("reorder_nav").should("exist").click();
cy.get(".ModalAligner--ptdt- article main ul.sort--taGo4").should("exist");
cy.get(".ModalAligner--ptdt-.Open--M5j6S button.Close--kVpCO").click();
});

it("Creates a new item from the menu", () => {
cy.get("#MainNavigation").then((content) => {
if (!content.is(":visible")) {
cy.get("[data-cy=contentNavButton]").click();
cy.get(".CreateItemDropdown").find(".MuiSelect-select").click();
cy.get("[role=presentation]").find('[data-value="link"]').click();
cy.get("#CreateLinkButton").should("exist");
} else {
cy.get(".CreateItemDropdown").find(".MuiSelect-select").click();
cy.get("[role=presentation]").find('[data-value="link"]').click();
cy.get('[data-value="link"]').click();
cy.get("#CreateLinkButton").should("exist");
}
});
cy.getBySelector("create_new_content_item").should("exist").click();
cy.getBySelector("create_new_content_item_dialog").should("exist");
cy.getBySelector("create_new_content_item_input")
.find("input")
.type("cypress");
cy.get(".MuiAutocomplete-listbox .MuiAutocomplete-option")
.first()
.should("exist")
.click();
cy.getBySelector("create_new_content_item_btn").click();
cy.location("pathname").should("eq", "/content/6-0c960c-d1n0kx/new");
});

it("Check Content Nav Collapsed functionality", () => {
// To be re-added on another release
it.skip("Check Content Nav Collapsed functionality", () => {
cy.get("[data-cy=contentNavButton]")
.siblings("div")
.then((btn) => {
Expand All @@ -48,7 +50,8 @@ describe("Navigation through content editor", () => {
});
});

it("Check Content Nav Collapse persist when clicking on other Applications ", () => {
// To be re-added on another release
it.skip("Check Content Nav Collapse persist when clicking on other Applications ", () => {
cy.get("[data-cy=contentNavButton]")
.siblings("div")
.then((btn) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@tinymce/tinymce-react": "^3.12.6",
"@welldone-software/why-did-you-render": "^6.1.1",
"@zesty-io/core": "1.9.1",
"@zesty-io/material": "^0.7.0",
"@zesty-io/material": "^0.8.0",
"chart.js": "^3.8.0",
"chartjs-adapter-moment": "^1.0.1",
"chartjs-plugin-datalabels": "^2.0.0",
Expand Down
Binary file added public/images/notFoundTransparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions src/apps/content-editor/src/app/ContentEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ import { fetchNav } from "../store/navContent";

import { AppLink } from "@zesty-io/core/AppLink";
import { WithLoader } from "@zesty-io/core/WithLoader";
import { ContentNav } from "./components/Nav";
import { ContentNav } from "./components/ContentNav";

import { Dashboard } from "./views/Dashboard";
import { ItemList } from "./views/ItemList";
import { ItemEdit } from "./views/ItemEdit";
import { ItemCreate } from "./views/ItemCreate";
import { LinkCreate } from "./views/LinkCreate";
import { LinkEdit } from "./views/LinkEdit";
import { NotFound } from "./views/NotFound";
import { CSVImport } from "./views/CSVImport";
import ReleaseApp from "../../../release/src";

// Vendor styles for codemirror, prosemirror and flatpickr
import "@zesty-io/core/vendor.css";

import styles from "./ContentEditor.less";
import Analytics from "./views/Analytics";
import { ResizableContainer } from "../../../../shell/components/ResizeableContainer";

// Makes sure that other apps using legacy theme does not get affected with the palette
let customTheme = createTheme(legacyTheme, {
Expand Down Expand Up @@ -95,7 +96,6 @@ let customTheme = createTheme(legacyTheme, {
});

export default function ContentEditor() {
const contentModels = useSelector((state) => state.models);
const navContent = useSelector((state) => state.navContent);
const ui = useSelector((state) => state.ui);
const dispatch = useDispatch();
Expand Down Expand Up @@ -139,13 +139,14 @@ export default function ContentEditor() {
: ""
)}
>
<ContentNav
data-cy="contentNav"
dispatch={dispatch}
models={contentModels}
nav={navContent}
/>

<ResizableContainer
id="contentNav"
defaultWidth={300}
minWidth={220}
maxWidth={360}
>
<ContentNav />
</ResizableContainer>
<div
className={cx(
styles.Content,
Expand All @@ -154,6 +155,7 @@ export default function ContentEditor() {
>
<div className={styles.ContentWrap}>
<Switch>
{/* <Route path="/content/releases" component={ReleaseApp} /> */}
<Route exact path="/content" component={Analytics} />
<Route
exact
Expand Down
6 changes: 4 additions & 2 deletions src/apps/content-editor/src/app/ContentEditor.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
}

.ContentEditor {
height: calc(100vh - 40px);
display: grid;
// height: calc(100vh - 40px);
height: 100%;
display: flex;
grid-template-columns: 60px 1fr;
position: relative;

.Content {
overflow: hidden;
border-left: 1px solid #f2f4f7;
z-index: 1;
width: 100%;

.ContentWrap {
display: flex;
Expand Down
19 changes: 19 additions & 0 deletions src/apps/content-editor/src/app/components/ContentNav/NavError.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { FC } from "react";
import { Box, Typography } from "@mui/material";

import notFound from "../../../../../../../public/images/notFoundTransparent.png";

interface Props {
navName: string;
}
export const NavError: FC<Props> = ({ navName }) => {
return (
<Box p={1.5} textAlign="center">
<img src={notFound} alt="Not Found" style={{ width: 112, height: 110 }} />
<Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
We're sorry we are unable to load your {navName}. Please refresh your
page and try again.
</Typography>
</Box>
);
};
Loading