Skip to content

V2.0 - Routing Forms and Shell 2.0 everywhere#3902

Merged
PeerRich merged 306 commits intomainfrom
v2.0/routing-forms
Sep 2, 2022
Merged

V2.0 - Routing Forms and Shell 2.0 everywhere#3902
PeerRich merged 306 commits intomainfrom
v2.0/routing-forms

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Aug 19, 2022

What does this PR do?

Ignore the number of commits - These are high due to many branches being merged in it.

Loom Demo
Demo Showing Shell is not re-rendered
Fixes #3794 #3795
It also updates Shell to v2 with the following fixes

  • Layout fixes for tablet and mobile screens
  • i18n flicker
  • Layout fixes in case of child nav items.

I took this opportunity to do following as well:

  • Security Hardening for routing forms endpoints.
  • Refactored code to share actions across list and single view of Routing Form.

Environment: Production

Type of change

  • Bug Fixes
  • New feature (non-breaking change which adds functionality)

How should this be tested?

Prerequisite: Go and install the Routing Forms App first and then you would see Routing Forms link in Main Navigation
Tests for V2.0 Routing Forms

Tests for V2.0 Shell - Because Routing Forms V2.0 designs are going live with V1, Shell V2.0 deigns has to also go live with V1

  • Test Main Navigation - Should be as per the designs of mobile, tablet and desktop screens,

sean-brydon and others added 30 commits August 2, 2022 22:42
# Conflicts:
#	apps/web/pages/event-types/[type]/old.tsx
#	apps/web/pages/event-types/index.tsx
# Conflicts:
#	apps/web/public/static/locales/en/common.json
Comment thread packages/ui/v2/core/Shell.tsx Outdated
Comment on lines +177 to +189
const i18n = useViewerI18n();

// Don't show any content till translations are loaded.
// As they are cached infinitely, this status would be loading just once for the app's lifetime until refresh
if (i18n.status === "loading") {
return (
<div className="absolute z-50 flex h-screen w-full items-center bg-gray-50">
<Loader />
</div>
);
}

if (!session && !props.isPublic) return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Id rather show untranslated string than nothing at all. This will increase the First Contentful Paint and will prevent the empty skeleton static generation. Thoughts? @PeerRich @Jaibles

Comment thread packages/ui/v2/core/Shell.tsx Outdated

function SideBar() {
const [visible, setVisible] = useState(true);
const { t } = useLocale();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const { t } = useLocale();

Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

The counting forms parts LGTM. About Shell tho I have some thoughts.

  • Let's try to use and abuse the getLayout pattern instead of using Shell everywhere.
  • I propose have Shell and PublicShell or PublicLayout for public pages
  • I don't like the idea of using Loader inside Shell, if any we should try to display the loading skeleton so it can be statically generated one build time.

@zlwaterfield
Copy link
Copy Markdown
Contributor

Hey @hariombalhara I'm coming in with a little less context so I'm finding it hard to review this PR. Could you add testing notes to the PR description in order to make sure I cover all bases when testing these changes?

Also, in the future, do you think it would be possible to break up a PR like this into multiple smaller PRs that are easier to review/test and get to production without worrying about causing breaking changes?

@hariombalhara
Copy link
Copy Markdown
Member Author

hariombalhara commented Sep 2, 2022

@zlwaterfield I have updated testing notes which should help.

wrt breaking this PR down in smaller PRs, I think it was doable but there are a few things to consider and wouldn't have benefitted much. The entire PR can be divided into 2 parts

  • V2.0 Routing Forms - This is like 95% of the changes in PR. This could have been broken down by changes wrt to various views(like forms list, Form Tab, Routing Forms Tab) but I consider that would have resulted in more effort overall
    • Required creation of new components
    • Required fixes in some existing components
    • Required fixes for tests.
  • V2.0 Shell

V2.0 Shell could have been avoided but that would have required me to use old Shell and that would mean that as soon as this PR is merged I would have to immediately switch to using Shell V2 which would have required some rework

@hariombalhara hariombalhara mentioned this pull request Sep 2, 2022
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Just one nitpick left

Comment thread packages/app-store/ee/routing_forms/pages/route-builder/[...appPages].tsx Outdated
Comment thread packages/app-store/ee/routing_forms/pages/route-builder/[...appPages].tsx Outdated
Comment thread packages/ui/v2/core/Shell.tsx Outdated
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Removed the Loader so we can merge now. Awesome work @hariombalhara 🙏🏽

@alishaz-polymath alishaz-polymath mentioned this pull request Sep 6, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

i18n is flickering 2.0 Routing Forms {View}

5 participants