-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
feat: releases settings #20354
feat: releases settings #20354
Conversation
type Services = { | ||
release: any; | ||
'release-validation': any; | ||
scheduling: any; | ||
'release-action': any; | ||
'event-manager': any; | ||
settings: SettingsService; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Feranchz I updated the getService
method to be typed, but we might as well want to add the rest of services type. Do you prefer to fill them in another PR?
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I
data: Settings; | ||
error?: errors.ApplicationError | errors.ValidationError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it possible to tie the two together? To use a union to let TS know that we either have data and no error, or an error and no data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure :) good point, will create a util for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created an utility to make it easier on the other scenarios? wdyt?
We can use this everywhere else from now on !
* type Response = { data: Data, error: never } | { data: never, error: ApplicationError | ValidationError }; | ||
* | ||
*/ | ||
export type OneOf<T, U> = (T & { [K in keyof U]?: never }) | (U & { [K in keyof T]?: never }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Convly Do you think I could fit a utility like this into our types package? This is something I could start using a lot in our type contract files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could actually replace the usage we're having of XOR in a lot of places.
Go for it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested (i think it will be more convenient to do it together with the frontend), but LGTM!
* chore: migrate bulk publish & unpublish to v5 * chore: change findLocales type to accept arrays * chore: fix lint error * chore: migrate bulkDelete to v5 (#20161) * chore: migrate bulkDelete to v5 * chore: change findLocales type to accept strings array * fix: docs prettier styles * chore: remove console.log * enhancement: migrate countManyDraftRelations to v5 * chore(content-releases): v5 migration * chore(content-releases): remove CMReleasesContainer * fix(content-releases): singleType works with v5 changes and e2e tests enabled * fix(content-releases): apply josh & marc comments * apply comments * fix(content-releases): tests * fix(content-releases): create custom populate object for each content type to handle relations * fix(content-releases): build problem * fix(content-releases): editing lifecycles * fix(content-releases): details view table columns * feat: releases settings (#20354) * feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * chore: OneOf type for response * chore: move OneOf utility to types package --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io> * feat: content releases settings permissions (#20357) * feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * feat: content releases settings permissions * chore: test for unauthorized role --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io> * fix(content-releases): run settings api tests only on ee edition * fix(content-releases): apply mark comments * fix(content-releases): remove releases box when there are no releases related to the entry * fix(content-releases): relation between actions and documents (#20424) * fix(content-releases): refactor relation with entries * fix(content-releases): refactor relation with entries * fix(content-releases): lint & unit tests errors * fix(content-releases): add migration for releases actions coming from v4 * fix(content-releases): apply multiple suggestions * fix(content-releases): new test data for e2e tests * fix(content-releases): fix test data * fix(content-releases): handle edge cases * fix(content-releases): apply marc suggestions * fix(content-releases): add modified status on validation column * fix(content-releases): fix releases menu button * fix(content-releases): use documents middleware instead of db lifecycles * fix(content-releases): invalidate releases tags on some content manager queries * fix(content-releases): using contentType utils and make afterDeleteMany lifecycle async * fix(content-releases): ui fixs * fix(content-releases): removing not needed axios from releases plugin * fix(content-releases): invalidate tags on release service * fix(content-releases): fix dependencies * feat(release-settings): remove navbar link release purchase page in CE (#20498) --------- Co-authored-by: Marc Roig <marc.roig.campos@strapi.io> Co-authored-by: Simone <startae14@gmail.com>
What does it do?
We are introducing a Settings page for releases, where Users can set their Default Timezone for release scheduling. That is so they don't have to manually change it every time they want to release.
This PR includes the backend endpoints for that feature.
GET /content-releases/settings
- Gets the stored settings , returns null by default.PUT /content-releases/settings
- Updates the settings.