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

Home Page Updates #5961

Merged
merged 20 commits into from
Mar 13, 2023
Merged

Home Page Updates #5961

merged 20 commits into from
Mar 13, 2023

Conversation

nickgrato
Copy link
Contributor

@nickgrato nickgrato commented Feb 23, 2023

  • Adding "--legacy-peer-deps" to npm ci because lilypad uses React 18
  • Converting home page to functional react component and TS
  • Adding new content to home page ( icons copy etc)
  • Adding style library we use in marketing page and dashboard so all out utility and css vars are available. ( this is about 25 files, a majority of the PR. This is not brand new SCSS, it is approved code im copying over to be used and edit in the context of the admin.)

@nickgrato nickgrato changed the title staching progress Home Page Updates Feb 23, 2023
admin/types.d.ts Outdated
in_quota: boolean;
};

export type ReticulumSceneListingT = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keianhzo do you know where a good place for me to look to build these types out?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

amazing thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@keianhzo ok I think this is ready to review when you get a chance - it's a big departure from the current way we do things here so let me know if you want me to walk through my future plans if something seems odd.

Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

Nice to see how we are consolidating things here and in the dashboard. Looking good. Just left a few nits, mostly things that we were already doing in a weird way before so I don't want to block on this so take them as suggestions in case you want to look into them now or prefer to let them for the future.

useEffect(() => {
const init = async () => {
try {
const adminInfo = await getAdminInfo();
Copy link
Contributor

Choose a reason for hiding this comment

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

All this queries will only throw an exception in case of network failure but not when a valid HTTP response is received including 404 or 500. We are also acting differently for getAdminInfo vs getEditableConfig updateReticulumMeta where in the first one we catch the exception but we don't in the others. We will probably need to check the response "ok" field to see if the request was successful. Also as we are just logging when error, we can probably put them in the same ty/catch block.

const needsScenes = reticulumMeta.repo && !reticulumMeta.repo.scene_listings.any;
const exceededStorageQuota = reticulumMeta.repo && !reticulumMeta.repo.storage.in_quota;
const isInSESSandbox =
adminInfo && adminInfo.using_ses && adminInfo.ses_max_24_hour_send <= MAX_AWS_SES_QUOTA_FOR_SANDBOX;
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the types it seems that if we get and AdminInfoT response it will always contain all the properties so not sure if it makes sense to check them all here. If not maybe they should be optional?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also al this state properties only seem to make sense if the async requests are successful so maybe it would make sense to include them in the same effect and initialize to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check what types are optional for this.

retConfig.phx &&
retConfig.phx.cors_proxy_url_host === `cors-proxy.${adminInfo.worker_domain}`;

return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to show some error card in case the async requests fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

putting a todo note for this!

</Card>

<div className="flex-align-items-center ml-12">
<a className="link mr-24">What's new</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

This was already like that but it doesn't seem to go anywhere

@@ -0,0 +1,41 @@
export type ReticulumMetaT = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bryanenders @netpro2k Was hoping to get some insight on if any of these types are conditional so I can throw the "?" on them or if we think they are all expected every time?

@nickgrato nickgrato temporarily deployed to smoke March 13, 2023 16:02 — with GitHub Actions Inactive
@nickgrato nickgrato temporarily deployed to hc-bio March 13, 2023 16:02 — with GitHub Actions Inactive
@nickgrato nickgrato merged commit 00488dd into master Mar 13, 2023
@nickgrato nickgrato deleted the content-requests branch March 13, 2023 16:50
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