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

Allow a user to provide a commit message when saving a Document or Collection Item #5

Closed
revgum opened this issue Mar 2, 2024 · 6 comments

Comments

@revgum
Copy link
Contributor

revgum commented Mar 2, 2024

When the CMS configuration is using GitHub as the storage adapter;

  • It would be nice to have a text input (with a default value/placeholder) so that the user can supply a specific git commit message when saving a change.
  • Or the default message to include the "document name" or "collection item name" (ie. "Updated ${document.name} document")
@oscarotero
Copy link
Member

I like the second option. This is something specific for the GitHub adapter so I don't think there should be something in the UI for that. Most people won't know what to write there (or even don't know they are using Git).

The storage is independent of the collection (the same storage can be used for several collections and documents). But the default message could include, at least, the file name that is being edited/created.

If you want to make it even more customizable, we can add an option for that. For example:

const gh = new GitHub({
  // ...
  commitMessage(info) {
    return `Edited file "${info.path}"`,
  }
});

@revgum
Copy link
Contributor Author

revgum commented Mar 3, 2024

I like this, it feels like a good improvement!

oscarotero added a commit that referenced this issue Mar 4, 2024
@oscarotero
Copy link
Member

I just added this option. Let me know if it works for you.

@revgum
Copy link
Contributor Author

revgum commented Mar 6, 2024

Thanks! Are you able to release version 0.3.4 with this update?

@oscarotero
Copy link
Member

done!

@revgum
Copy link
Contributor Author

revgum commented Mar 9, 2024

Addressed in #8

@revgum revgum closed this as completed Mar 9, 2024
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

No branches or pull requests

2 participants