Skip to content

Routes#64

Draft
Neha wants to merge 22 commits intodevelopfrom
routes
Draft

Routes#64
Neha wants to merge 22 commits intodevelopfrom
routes

Conversation

@Neha
Copy link
Contributor

@Neha Neha commented Aug 10, 2022

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #45

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Manual
  • Test-casees

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neha Neha marked this pull request as draft August 10, 2022 07:21
@Neha
Copy link
Contributor Author

Neha commented Aug 10, 2022

Pending:

  1. test cases

@Neha Neha linked an issue Aug 10, 2022 that may be closed by this pull request
2 tasks
@Neha Neha mentioned this pull request Aug 10, 2022
10 tasks
@Neha Neha self-assigned this Sep 18, 2022
Comment on lines 16 to 30
export const NAV = {
"Home" : "/",
"Create Users" : "/users",
"Flags" : "/flags",
"SDK" : "/sdk",
"Docs" : "/docs",
}

export const PATH = {
"HOME" : "/",
"CREATE_USERS" : "/users",
"FLAGS" : "/flags",
"SDK" : "/sdk",
"DOCS" : "/docs",
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are violating DRY principle here.
How about?

Suggested change
export const NAV = {
"Home" : "/",
"Create Users" : "/users",
"Flags" : "/flags",
"SDK" : "/sdk",
"Docs" : "/docs",
}
export const PATH = {
"HOME" : "/",
"CREATE_USERS" : "/users",
"FLAGS" : "/flags",
"SDK" : "/sdk",
"DOCS" : "/docs",
}
export const NAV = {
"Home" : PATH.HOME,
"Create Users" : PATH.CREATE_USERS,
"Flags" : PATH.FLAGS,
"SDK" : PATH.SDK,
"Docs" : PATH.DOCS,
}
export const PATH = {
"HOME" : "/",
"CREATE_USERS" : "/users",
"FLAGS" : "/flags",
"SDK" : "/sdk",
"DOCS" : "/docs",
}

Copy link
Contributor Author

@Neha Neha Sep 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking to create an array object. An object will have a name and URL. Something like this:

and loop over to create the navigation and URL.

One down point I see in this is scaling to different languages could be not easy. WYT?

export const NAV = [
    {
        name: 'Home',
        path: '/'
    },
    {
        name: "Create Users",
        path:  "/users"

    },
    {
        name: "Flags",
        path:  "/flags"
    },
    {
        name: "SDK",
        path:  "/SDK"
    },
    {
        name: "Docs",
        path:  "/docs"
    }
]

Basically like this: https://reactrouter.com/en/main/hooks/use-routes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.


describe('<Docs/> component', () => {
it('component should render',() => {
render(<Router><Docs /></Router>);
Copy link
Contributor

@pallabez pallabez Sep 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what purpose wrapping serves. Mind explaining?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Removed from one test-case. Will add a new issue to update rest of the test-cases

import { MemoryRouter as Router } from 'react-router-dom';
import LeftNav from '../Components/LeftNav/LeftNav';

describe('<LeftNav/> component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a good idea to call it LeftNav? We might move it to right perhaps in future. Something like NavPanel would be better I guess. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it Navigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Setup Routes

2 participants

Comments