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

♻️ Chore: Setup new Table Schemas, and Implement Helpers (component and function helpers) #79

Merged
merged 34 commits into from
May 25, 2024

Conversation

create-issue-branch[bot]
Copy link
Contributor

Original issue description

Step one of #77

closes #78

@create-issue-branch create-issue-branch bot changed the title Chore: Setup new Table Schemas, and Implement Helpers (component and function helpers) ♻️ Chore: Setup new Table Schemas, and Implement Helpers (component and function helpers) May 11, 2024
Copy link

studiocms-deployment-helper bot commented May 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-05-11 08:50:38 CET

Copy link

studiocms-deployment-helper bot commented May 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-05-11 08:50:25 CET

Copy link

studiocms-deployment-helper bot commented May 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-05-11 08:50:18 CET

@Adammatthiesen Adammatthiesen changed the base branch from main to issue-0050 May 11, 2024 08:49
@Adammatthiesen Adammatthiesen added this to the ATP Migration milestone May 11, 2024
Adammatthiesen and others added 18 commits May 12, 2024 02:33
… batch transactions (#76)

* Create draft PR for #71
[skip ci]

* Update - New setup page and done page implemented. as well as some OptionsSchema cleanup

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/done.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/setup.ts

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Paul Valladares <[email protected]>

* update as per dreyfus's comment

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Jacob Jenkins <[email protected]>

* Update packages/studioCMS/src/integrations/studioCMSDashboard/routes/databaseSetup/main.astro

Co-authored-by: Jacob Jenkins <[email protected]>

---------

Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com>
Co-authored-by: Adam Matthiesen <[email protected]>
Co-authored-by: Adam Matthiesen <[email protected]>
Co-authored-by: Paul Valladares <[email protected]>
Co-authored-by: Jacob Jenkins <[email protected]>
…h and start the process of converting the dashboad edit pages to utilitze HTMX based server rendering
… module for retrieving user data from the Astro Studio's Database.
@Adammatthiesen Adammatthiesen marked this pull request as ready for review May 17, 2024 09:05
@Adammatthiesen Adammatthiesen requested a review from a team May 17, 2024 09:08
Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

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

Amazing work @Adammatthiesen, just left a couple of comments.

packages/studioCMS/src/components/exports/Navigation.astro Outdated Show resolved Hide resolved
packages/studioCMS/src/components/exports/Navigation.astro Outdated Show resolved Hide resolved
import "./navigation.css";

type Props = {
topLevelLinkCount?: number;
Copy link
Member

Choose a reason for hiding this comment

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

What's topLevelLinkCount?

Copy link
Member

Choose a reason for hiding this comment

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

it creates a navigation map of any page with the showOnNav option on the table as true as such:

topLevelLinkCount: 3

{ Page1, Page2, Page3, More: { Page4, Page5 } }

This is for a front-end Navigation component to replace the old front-end header :)


type Props = { studioCMSSocials: StudioCMSSocials };
const { studioCMSSocials: { github: githubURL } } = Astro.props as Props;
Copy link
Member

Choose a reason for hiding this comment

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

The type assertion shouldn't be needed, it should be infered without it.

Suggested change
const { studioCMSSocials: { github: githubURL } } = Astro.props as Props;
const { studioCMSSocials: { github: githubURL } } = Astro.props;

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh does it? I always do as Props ... 👀

Copy link
Member

Choose a reason for hiding this comment

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

it does infer... but i noticed this also helps when the language server crashes... so i've been adding it in when i needed it instead of restarting the Language server

Copy link
Contributor

@jdtjenkins jdtjenkins left a comment

Choose a reason for hiding this comment

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

Just a few comments @Adammatthiesen !

Great work though, this is looking siiiiiiiiiiick

.github/workflows/firsttimepr.yml Outdated Show resolved Hide resolved
<div class="navigation">
<div class="title"><a href={baseSiteURL}>{title}</a></div>
{
links.slice(0, topLevelLinkCount).map(({ text, href }) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to just either not push these links into the array, or remove them before we get to the template? Feels weird to be modifying this array inside the template

<div class="dropdown">
<button>More ▼</button>
<div class="dropdown-content">
{ links.slice(topLevelLinkCount).map(({ text, href }) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here with the slicing! Also, this one doesn't have a count... So I actually don't know what happens but I feel nothing good

Copy link
Member

Choose a reason for hiding this comment

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

its just a using the count as a starting point in this situation. i'm using Slice to get the first 3 links and then throwing the rest into a dropdown for the front-end stuff with it all being controlled by a true/false variable on the PageData table


.navigation .title {
font-size: xx-large;
color: black;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't mind for now since we don't have official branding. But this should probably be an off-black

<text class="text-lg py-2">
<text class="font-bold">What is StudioCMS?</text>
<br />
StudioCMS is a simple, easy to use, and fast CMS for Astro. It's built with the latest technologies and is designed to be as simple as possible. It's also open source and free to use.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should eventually just be a link to the docs 😂

Copy link
Member

Choose a reason for hiding this comment

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

This was created before this was even much more than a thought... Its kinda just placeholder information till we have docs and everything setup

//@ts-expect-error - show is not a standard method on HTMLElement it comes from `Shoelace.syle`
localAdmin.show();
//@ts-expect-error - hide is not a standard method on HTMLElement it comes from `Shoelace.syle`
oauthAdmin.hide();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmmmmmmmmmmm wonder if we should make like custom types for these things.. I really hate all these ts expect errors.

Something like

type SLHTMLElement = HTMLElement & {
  show: () => void;
  hide: () => void;

  etc
}

}
});

document.forms[0]?.addEventListener("submit", async (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see cheeky. Can this form reference be a document.getElemenyById in case we ever introduce more forms we don't need to fix this

Copy link
Member

Choose a reason for hiding this comment

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

In this case, atleast for now i think it should be fine, since this is only the First time setup page, and primarily used only to setup the tables with some dummy data to get started as well as the permission setup

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

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

Let's ship this, looks good to me! 🚢

Copy link
Contributor

@jdtjenkins jdtjenkins left a comment

Choose a reason for hiding this comment

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

I think is so cool! I love it all! Lets ship it fam 🚢

@BryceRussell
Copy link
Member

Looks like this covers everything we talked about, ship it! 🚢🚀

@Adammatthiesen
Copy link
Member

!coauthor

Copy link

Co-authored-by: Bryce Russell <[email protected]>
Co-authored-by: Adam Matthiesen <[email protected]>
Co-authored-by: Jacob Jenkins <[email protected]>
Co-authored-by: Paul Valladares <[email protected]>

@Adammatthiesen Adammatthiesen merged commit 4bce343 into issue-0050 May 25, 2024
1 check passed
@Adammatthiesen Adammatthiesen deleted the issue-0078 branch May 25, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chore: Setup new Table Schemas, and Implement Helpers (component and function helpers)
4 participants