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

Centralize the AppBar; Remove extraneous component wrappers #807

Merged
merged 11 commits into from
Nov 15, 2020

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Nov 12, 2020

In the routing of src/App/component.tsx, separate out all pages that can only be accessed after login under a new AppLoggedIn.tsx, and place a single global AppBar within this new component, so we don't have to maintain a new instance within every page within the app.


This change is Reviewable

@imnasnainaec imnasnainaec added frontend maintenance Issue that makes it difficult to maintain the software or to upgrade installations post-release. labels Nov 12, 2020
@imnasnainaec imnasnainaec self-assigned this Nov 12, 2020
@codecov-io
Copy link

codecov-io commented Nov 12, 2020

Codecov Report

Merging #807 (993aa0a) into master (5c1a0f2) will decrease coverage by 0.03%.
The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #807      +/-   ##
==========================================
- Coverage   51.18%   51.15%   -0.04%     
==========================================
  Files         237      237              
  Lines        6449     6459      +10     
  Branches      416      418       +2     
==========================================
+ Hits         3301     3304       +3     
- Misses       2841     2846       +5     
- Partials      307      309       +2     
Flag Coverage Δ
backend 55.23% <ø> (ø)
frontend 47.24% <53.84%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/components/App/AppLoggedIn.tsx 0.00% <0.00%> (ø)
src/components/App/component.tsx 100.00% <ø> (ø)
src/components/AppBar/NavigationButtons.tsx 33.33% <ø> (ø)
src/components/AppBar/ProjectNameButton.tsx 66.66% <ø> (ø)
.../components/GoalTimeline/GoalTimelineComponent.tsx 68.75% <ø> (ø)
src/components/PageNotFound/component.tsx 50.00% <ø> (ø)
...nents/ProjectSettings/ProjectSettingsComponent.tsx 0.00% <ø> (ø)
.../components/SiteSettings/SiteSettingsComponent.tsx 0.00% <0.00%> (ø)
src/components/UserSettings/UserSettings.tsx 0.00% <ø> (ø)
...oals/DefaultGoal/BaseGoalScreen/BaseGoalScreen.tsx 71.42% <0.00%> (-14.29%) ⬇️
... and 6 more

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 5c1a0f2...993aa0a. Read the comment docs.

@johnthagen
Copy link
Collaborator


src/history.ts, line 13 at r2 (raw file):

export default history;

export enum path {

I'm not sure this needs to change, but when I first say a lowercased item like this, I think it was a built in (like string, etc).

Could this be renamed to Path so it's a little more obvious this is a custom type?

Also, I think canonically, on the web these things are called "routes" rather than "paths".

So maybe: Route or AppRoute to make it really clear?

@johnthagen
Copy link
Collaborator


src/components/AppBar/AppBarComponent.tsx, line 16 at r2 (raw file):

}

/** An app bar shown at the top of almost every page of The Combine */

Could rephrase to say: "Shown on all logged in pages" or equivalent.

@johnthagen
Copy link
Collaborator


src/history.ts, line 14 at r2 (raw file):

export enum path {
  dataEntry = "/app/data-entry",

It also looks like TypeScript prefers UpperCamelCase for enum members: https://www.typescriptlang.org/docs/handbook/enums.html

@johnthagen
Copy link
Collaborator


src/history.ts, line 13 at r2 (raw file):

Previously, johnthagen wrote…

I'm not sure this needs to change, but when I first say a lowercased item like this, I think it was a built in (like string, etc).

Could this be renamed to Path so it's a little more obvious this is a custom type?

Also, I think canonically, on the web these things are called "routes" rather than "paths".

So maybe: Route or AppRoute to make it really clear?

I see that other parts of React already have Route, so maybe something like AppRoute would be the best here.

@johnthagen
Copy link
Collaborator


src/goals/DefaultGoal/BaseGoalScreen/BaseGoalScreen.tsx, line 55 at r2 (raw file):

 * based on the current step in the goal
 */
export default class BaseGoalScreen extends React.Component<GoalProps> {

Could this become a functional component while we are here?

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 17 of 19 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @imnasnainaec)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 37 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec and @johnthagen)


src/history.ts, line 13 at r2 (raw file):

Previously, johnthagen wrote…

I see that other parts of React already have Route, so maybe something like AppRoute would be the best here.

Path implemented


src/components/AppBar/AppBarComponent.tsx, line 16 at r2 (raw file):

Previously, johnthagen wrote…

Could rephrase to say: "Shown on all logged in pages" or equivalent.

Done


src/goals/DefaultGoal/BaseGoalScreen/BaseGoalScreen.tsx, line 55 at r2 (raw file):

Previously, johnthagen wrote…

Could this become a functional component while we are here?

I had tried that, but it doesn't play well with BaseGoalScreen/index.tsx

@johnthagen
Copy link
Collaborator


src/history.ts, line 14 at r3 (raw file):

export enum Path {
  dataEntry = "/app/data-entry",

enum members should start with a capital letter: https://www.typescriptlang.org/docs/handbook/enums.html

DataEntry = ...

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 29 of 29 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 42 files reviewed, 1 unresolved discussion (waiting on @imnasnainaec and @johnthagen)


src/history.ts, line 14 at r3 (raw file):

Previously, johnthagen wrote…

enum members should start with a capital letter: https://www.typescriptlang.org/docs/handbook/enums.html

DataEntry = ...

Done.

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 32 files at r4.
Reviewable status: 11 of 42 files reviewed, all discussions resolved (waiting on @johnthagen)

Copy link
Collaborator

@johnthagen johnthagen left a comment

Choose a reason for hiding this comment

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

Reviewed 31 of 32 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@imnasnainaec imnasnainaec merged commit 5d2c6b8 into master Nov 15, 2020
@imnasnainaec imnasnainaec deleted the perma-appbar branch November 15, 2020 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend maintenance Issue that makes it difficult to maintain the software or to upgrade installations post-release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants