Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(cdr): Approach 3 - Initial UI (port over cdr/m components) #8

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 33 commits into from
Jan 12, 2022

Conversation

bryphe-coder
Copy link
Contributor

@bryphe-coder bryphe-coder commented Jan 6, 2022

This is testing out Approach 3 in the UI scaffolding RFC.

Fixes #11

The folder structure looks like:

  • site
    • components (buttons, empty state, etc)
    • pages (large sections of UI -> composition of components)
    • theme (files defining our palette)

Several components were able to be brought in essentially unmodified:

  • SplitButton
  • EmptyState
  • Footer
  • All the icons / logos
  • Theming (removed several items that aren't necessary, yet, though)

Other components had more coupling, and need more refactoring:

  • NavBar
  • Confetti

Current State:

2022-01-06 17 16 31

For a full working app, there's potentially a lot more to bring in:

  • User / Account Settings Stuff
  • Users Page
  • Organizations Page
    (and all the supporting dependencies)

TODO:

  • Move <EmptyState /> to component
  • Integrate material UI theme provider, port over some basic theme colors
  • Port over <NavBar />, streamline for V2
  • Port over <Footer />, streamline for V2
  • Move empty workspaces stuff to a page/Workspaces/index.tsx
  • Add favicon back
  • Remove intermediate src directory
  • Bring back next build

If this ends up being an OK approach with you @kylecarbs - I'll remove some of the extra stuff like the triangle and confetti for now before bringing in 😎

@bryphe-coder bryphe-coder self-assigned this Jan 7, 2022
@bryphe-coder bryphe-coder marked this pull request as ready for review January 7, 2022 03:00
@@ -0,0 +1,125 @@
import Button, { ButtonProps } from "@material-ui/core/Button"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file was brought in unchanged

@@ -0,0 +1,30 @@
<!DOCTYPE html>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This HTML file is a placeholder. Likely we'll have to do something like v1 where the backend injects some metadata into the HTML when serving it to the client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,216 @@
import { useEffect, useRef } from "react"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was brought in mostly unmodified (just a quick tweak to localize it to a specific element)

@@ -0,0 +1,74 @@
import React from "react"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was brought in mostly as-is from v1, except I removed some properties that weren't yet needed.

@@ -0,0 +1,20 @@
import * as React from "react"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Brought in as-is from v1

@bryphe-coder bryphe-coder changed the title [WIP] feat(cdr): Approach 3 - Initial UI (port over cdr/m components) feat(cdr): Approach 3 - Initial UI (port over cdr/m components) Jan 7, 2022
@bryphe-coder bryphe-coder requested a review from kylecarbs January 7, 2022 15:49
@codecov
Copy link

codecov bot commented Jan 7, 2022

Codecov Report

Merging #8 (8ef457f) into main (0778f3e) will increase coverage by 0.97%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   69.46%   70.44%   +0.97%     
==========================================
  Files          18       18              
  Lines        1130     1130              
==========================================
+ Hits          785      796      +11     
+ Misses        273      264       -9     
+ Partials       72       70       -2     
Flag Coverage Δ
macos-latest 62.32% <ø> (+1.62%) ⬆️
ubuntu-latest 69.38% <ø> (+0.70%) ⬆️
windows-latest 61.60% <ø> (+1.32%) ⬆️
Impacted Files Coverage Δ
peer/conn.go 74.29% <0.00%> (+1.88%) ⬆️
peer/channel.go 87.42% <0.00%> (+3.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0778f3e...8ef457f. Read the comment docs.

@bryphe-coder
Copy link
Contributor Author

FYI @kylecarbs - I made the changes we discussed earlier today:

  • Flattened the hierarchy -> removed the intermediate src folder
  • Migrated to next and removed webpack and react-router - just kept a very initial pages folder for now... but we can add to this soon in next PRs 😄

Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

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

We could cleanup the theme files a bit. I know they're copied from the other repo, but I think some minor love could set better precedent on this repo.

Chefs choice on all the things I commented. Overall looks great to me!

# Check that node is available
# TODO: Implement actual test run
- run: node --version
- run: yarn install
Copy link
Member

Choose a reason for hiding this comment

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

We should probably cache node modules here too!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sure! I'll add this in a separate change

}
}

// END Material-UI v5 code:
Copy link
Member

Choose a reason for hiding this comment

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

I know we're just pasting these, but I think this comment could be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually material-ui v5 code (we're on material ui v4).

One thing we could consider is upgrading to material-ui v5 for this... but it means the components might not be as easy port from v1 -> v2. There are several breaking changes, including import paths: https://mui.com/guides/migration-v4/

My thinking is we should stick with what we have for the moment to make it easy to port v1 components in -> especially given that in 'v2 Phase 2' it's possible we'd redesign the UX and/or move away from material-ui.

@@ -0,0 +1,118 @@
import { Palette } from "@material-ui/core/styles/createPalette"
/**
Copy link
Member

Choose a reason for hiding this comment

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

We use multiple // above, and a block here. It would be nice to standardize and enforce a style with linting.

Copy link
Contributor Author

@bryphe-coder bryphe-coder Jan 12, 2022

Choose a reason for hiding this comment

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

I'll take a look at this in a subsequent PR.

We could enable this rule: https://eslint.org/docs/rules/multiline-comment-style (ie, starred-block for multiline comments)

@bryphe-coder bryphe-coder merged commit ace8916 into main Jan 12, 2022
@bryphe-coder bryphe-coder deleted the bryphe/prototype/3-port-ui branch January 12, 2022 22:25
bryphe-coder added a commit that referenced this pull request Mar 16, 2022
This refactoring re-organizes the `site` folder to have a nested `src` folder.

Originally, [we wanted to keep the directory structure shallow](#8 (comment)) - but there were two points that motivated this change to introduce the `src` level.

1. We have several non-`src` folders now (`e2e`, `static`, `html_templates`, `.storybook`)
2. Having a `src` folder makes it easier to run XState Typegen

So given those two data points - I believe it makes sense to revisit that and introduce a `src` folder.
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.

Front-end: Create initial project scaffolding
2 participants