quantified-uncertainty / metaforecast

Fetch forecasts from prediction markets/forecasting platforms to make them searchable. Integrate these forecasts into other services.
https://metaforecast.org/
MIT License
57 stars 5 forks source link

Frontend refactorings & dashboard features #53

Closed berekuk closed 2 years ago

berekuk commented 2 years ago

Ok, I got a bit carried away here (instead of working on graphql, going to start on that soon), but these are the cleanups I wanted to do eventually.

What's included:

  1. Cleanups: coding style, extracted common components, enforced naming conventions, typescript. Also: initial docs/coding-style.md explaining what I consider to be best practice.
  2. Simplified html/css.
  3. Dashboards refactorings & new dashboard urls.

1) Cleanups:

2) Simplified HTML/CSS for DisplayForecast, /tools and /dashboards:

3) Dashboards:

netlify[bot] commented 2 years ago

Deploy Preview for metaforecast ready!

Name Link
Latest commit 6b0a9a4c417124057d2eeeb3bf0f42096511cfd3
Latest deploy log https://app.netlify.com/sites/metaforecast/deploys/6255d14798abb900081265e3
Deploy Preview https://deploy-preview-53--metaforecast.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

NunoSempere commented 2 years ago

This looks good. Could you also create a dashboardEmbed with the same schema (dashboardEmbed/view/[id]), to replace secretDashboard, but without deleting the secretDashboard page yet?

berekuk commented 2 years ago

Could you also create a dashboardEmbed with the same schema (dashboardEmbed/view/[id]), to replace secretDashboard, but without deleting the secretDashboard page yet?

Maybe dashboard/embed/[id] for namespacing then? Or /dashboard/view/[id]/embed.

I could just add a redirect to it and keep /secretDashboard forever as legacy.

Btw, where is /secretDashboard used currently? I see by Netlify analytics that it gets a lot of traffic (from globalguessing.com, probably?), but I couldn't find any pages where it's embedded. Reason I'm asking: it dumps a raw json into html, and I wonder if all pages that embed it are currently messed up.

NunoSempere commented 2 years ago

Maybe dashboard/embed/[id] for namespacing then? Or /dashboard/view/[id]/embed.

dashboard/embed/[id] sounds a bit better.

I could just add a redirect to it and keep /secretDashboard forever as legacy.

Sounds good, though maybe not forever.

Btw, where is /secretDashboard used currently?

Here: https://globalguessing.com/russia-ukraine-forecasts/, that I know of

berekuk commented 2 years ago

Reason I'm asking: it dumps a raw json into html, and I wonder if all pages that embed it are currently messed up.

Oh, I mixed it up with /secretEmbed. /secretDashboard is fine.

NunoSempere commented 2 years ago

/secretEmbed is used by the twitter bot.

Is this PR ready to be merged?

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

πŸ” Inspect: https://vercel.com/quantified-uncertainty/metaforecast/5ZTfKLAW8aiqZH82jxMy1jssYKCC
βœ… Preview: https://metaforecast-git-forecast-html-css-quantified-uncertainty.vercel.app

berekuk commented 2 years ago

Is this PR ready to be merged?

Yes! βœ”οΈ

Also, I added /dashboards/embed/[id] redirect in the final commit.

NunoSempere commented 2 years ago

I'm getting some errors in Vercel related to this commit @berekuk

temp

NunoSempere commented 2 years ago

Also, I added /dashboards/embed/[id] redirect in the final commit.

Nice

berekuk commented 2 years ago

I'm getting some errors in Vercel related to this commit

That's #15 again (due to me pushing longer versions of infer/gjopen cookies there). Fixed.