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

Author and diff tracking #395

Merged
merged 12 commits into from
Feb 3, 2025
Merged

Author and diff tracking #395

merged 12 commits into from
Feb 3, 2025

Conversation

Adammatthiesen
Copy link
Member

@Adammatthiesen Adammatthiesen commented Feb 2, 2025

This pull request includes significant changes to the StudioCMS project, focusing on adding diff tracking capabilities, updating dependencies, and making layout adjustments. The most important changes include adding new diff tracking features, updating package dependencies, and modifying layout files.

Diff Tracking Features:

  • Added new columns enableDiffs and diffPerPage to the StudioCMSSiteConfig table (packages/studiocms_core/src/db/tables.ts).
  • Introduced new routes for content management diffs (packages/studiocms_core/src/lib/routeMap.ts).
  • Implemented diff tracking methods in the StudioCMSSDK class, including methods to insert, clear, get, and revert diffs (packages/studiocms_core/src/sdk-utils/StudioCMSSDK.ts).

Dependency Updates:

  • Added diff, diff2html, and their respective type definitions to package.json (packages/studiocms_core/package.json). [1] [2]

Layout Adjustments:

  • Fixed layout issues in FallbackCanvas.astro by closing a div tag and removing unnecessary whitespace (packages/studiocms_auth/assets/layouts/FallbackCanvas.astro). [1] [2] [3]
  • Included new CSS file diff.css in BaseHead.astro for styling diffs (packages/studiocms_dashboard/assets/components/BaseHead.astro). [1] [2]

Changes and Notes:

  • Adds Author and Contributor Tracking to pages

  • Implements new Diff system

    • Add User management reference
    • Add Edit page reference
    • Add new Edit page route /content-management/diff
      • Needs more work on UI but is functional enough for early version
    • Setup API Endpoints and update siteconfig table.

    New content previews:

image
image
image

closes #187
closes #293

Copy link

changeset-bot bot commented Feb 2, 2025

🦋 Changeset detected

Latest commit: d62500c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@studiocms/dashboard Patch
studiocms Patch
@studiocms/blog Patch
@studiocms/assets Patch
@studiocms/auth Patch
@studiocms/betaresources Patch
@studiocms/core Patch
@studiocms/devapps Patch
@studiocms/frontend Patch
@studiocms/imagehandler Patch
@studiocms/renderers Patch
@studiocms/robotstxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@studiocms-no-reply
Copy link
Member

Thanks for opening this pull request! 🎉

The following links will become available for preview shortly (if applicable):

TEMPORARILY DISABLED: The StudioCMS Demo (playgrounds/node) link is currently disabled due to ongoing development on the next version. We apologize for the inconvenience and appreciate your understanding. 🙏

Note: Changes may take a few minutes to propagate. Please be patient! You can also see the status of each deployment via the withstudiocms-deployments bot 🤖 comments.

Please review the changes and provide any feedback. Thanks! 🚀

Copy link

pkg-pr-new bot commented Feb 2, 2025

Open in Stackblitz

studiocms

npm i https://pkg.pr.new/withstudiocms/studiocms@395

@studiocms/assets

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/assets@395

@studiocms/betaresources

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/betaresources@395

@studiocms/auth

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/auth@395

@studiocms/blog

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/blog@395

@studiocms/core

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/core@395

@studiocms/dashboard

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/dashboard@395

@studiocms/devapps

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/devapps@395

@studiocms/frontend

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/frontend@395

@studiocms/imagehandler

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/imagehandler@395

@studiocms/renderers

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/renderers@395

@studiocms/robotstxt

npm i https://pkg.pr.new/withstudiocms/studiocms/@studiocms/robotstxt@395

commit: d62500c

@Adammatthiesen Adammatthiesen marked this pull request as ready for review February 3, 2025 01:40
@Adammatthiesen Adammatthiesen requested a review from a team as a code owner February 3, 2025 01:40
@@ -141,5 +141,7 @@ export const StudioCMSSiteConfig = defineTable({
siteIcon: column.text({ optional: true }),
loginPageBackground: column.text({ default: 'studiocms-curves' }),
loginPageCustomImage: column.text({ optional: true }),
enableDiffs: column.boolean({ default: false }),
diffPerPage: column.number({ default: 10 }),
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be diffsPerPage?

Suggested change
diffPerPage: column.number({ default: 10 }),
diffsPerPage: column.number({ default: 10 }),

Copy link
Member Author

Choose a reason for hiding this comment

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

Valid point. Only downside... its a bit hard to rename a table column after you've already pushed the schema to the database... 😅 and we would probably need the first time setup stuff ready first... so i can purge the db and reset while updating the schema

Copy link

@RATIU5 RATIU5 left a comment

Choose a reason for hiding this comment

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

Awesome work!

@Adammatthiesen Adammatthiesen merged commit d7c5e0e into issue-0304 Feb 3, 2025
7 checks passed
@Adammatthiesen Adammatthiesen deleted the feat-tracking branch February 3, 2025 19:19
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.

5 participants