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

Frontend Scaffolding + Helpers #7

Merged
merged 7 commits into from
Sep 10, 2023
Merged

Conversation

gbdubs
Copy link
Contributor

@gbdubs gbdubs commented Sep 7, 2023

Aside from the one issue with OAPI spec discussing offline, this PR is ready for reveiw. What does it include?

  • Utitilites, some standard, some new, for common frontend work.
  • Some global imports (computed, onMounted, presentX)
  • Helpful common display utils for forms

And, an initial editor for PACTA version definitions, including edit, delete, etc. Will need a bit more work after the OAPI issues are resolved.

Feel free to review!

@gbdubs gbdubs requested a review from bcspragu September 7, 2023 21:23
.vscode/settings.json Outdated Show resolved Hide resolved
Comment on lines +37 to +39
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/strict-boolean-expressions": 0,
"@typescript-eslint/promise-function-async": 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I actually kinda liked these, and adapted all the Azure login code to match them. I guess they can be a bit overbearing (esp strict-boolean-expressions), but they do encourage good code on the whole

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think they're pretty significantly overbearing: each of these is requiring that the user make explicit something that the compiler checks correctly. I started down the path of writing code for them, and they're way too much.

  • Example for Explicit return type: composables have to have a thorough, complete, return type.
  • Strict boolean expressions: if you want to check if a string is "", null or undefined, you now need to make 3 calls - it doesn't allow if (!!s), which feels like a significant loss
  • Promise functions async - all calls to withLoadingAndErrorHandling have to have an explicit async argument, turning a nice arrow function into an awful async () => await fooBar()

Copy link
Collaborator

Choose a reason for hiding this comment

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

A ~650 KB gif is still heresy, same comment from the last time about webp and other web video standards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a TODO for this - I looked into this before and there was a nontrivial lift to make sure browser support was there (with fallbacks, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#8

frontend/components/modal/Error.vue Outdated Show resolved Hide resolved
Comment on lines 52 to 62
Some common troubleshooting steps that might be helpful:
<ul>
<li><b>Refresh this page</b> - most of our pages save your progress as you go, so it's almost always fine to reload the page.</li>
<li><b>Check your internet connection</b> - this site requires connection to the internet for most functionality.</li>
<li><b>Visit this site on a desktop computer</b> - this site works best on desktop web browsers.</li>
</ul>
If this issue persists, please report this issue by <a
href="https://github.com/RMI/opgee-api/issues/new"
target="_blank"
>filing a bug in the OPGEE repository</a>.
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fix all the OPGEE references

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GC Done.

frontend/composables/newModal.ts Outdated Show resolved Hide resolved
frontend/composables/newModal.ts Show resolved Hide resolved
frontend/pages/admin/pacta-version/index.vue Outdated Show resolved Hide resolved
frontend/pages/admin/pacta-version/index.vue Show resolved Hide resolved
Comment on lines +26 to +27
<StandardContent>
<TitleBar title="New PACTA Version" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same note here as in StandardContent, every page shouldn't have to specify these components, we can hoist them into the default layout and set the title with a useTitle composable or similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I disagree on this one - mostly because is likely to contain other stuff (like a 3-dot menu) that benefits from being set up as a normal component (i.e. access to computed values in it's props)

@gbdubs gbdubs merged commit a1a6abe into main Sep 10, 2023
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.

2 participants