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

feat: releases settings #20354

Merged
merged 7 commits into from
May 29, 2024
Merged

feat: releases settings #20354

merged 7 commits into from
May 29, 2024

Conversation

Marc-Roig
Copy link
Contributor

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.

image

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.

Comment on lines +4 to +11
type Services = {
release: any;
'release-validation': any;
scheduling: any;
'release-action': any;
'event-manager': any;
settings: SettingsService;
};
Copy link
Contributor Author

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?

Copy link

vercel bot commented May 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ❌ Failed (Inspect) May 29, 2024 1:46pm

Copy link
Contributor

@remidej remidej left a comment

Choose a reason for hiding this comment

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

Looks good! I

Comment on lines 39 to 40
data: Settings;
error?: errors.ApplicationError | errors.ValidationError;
Copy link
Contributor

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.

Copy link
Contributor Author

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!

Copy link
Contributor Author

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 });
Copy link
Contributor Author

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

Copy link
Member

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 🙂

Copy link
Contributor

@remidej remidej left a 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!

@Feranchz Feranchz merged commit 602c470 into v5/releases May 29, 2024
53 of 83 checks passed
@Feranchz Feranchz deleted the v5/releases-settings branch May 29, 2024 14:07
Feranchz added a commit that referenced this pull request Jun 13, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants