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

Feature/sckan 259 #228

Merged
merged 10 commits into from
Feb 15, 2024
Merged

Feature/sckan 259 #228

merged 10 commits into from
Feb 15, 2024

Conversation

afonsobspinto
Copy link
Member

@afonsobspinto afonsobspinto commented Feb 13, 2024

Closes https://metacell.atlassian.net/browse/SCKAN-259 and https://metacell.atlassian.net/browse/SCKAN-253 (only in the frontend, not in the admin page)

if profile.is_reviewer and instance.state in [SentenceState.OPEN, SentenceState.NEEDS_FURTHER_REVIEW]:
return True

return user.is_staff
Copy link
Member Author

Choose a reason for hiding this comment

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

@zsinnema @ddelpiano I assumed that staff/admins should be able to do any transition except the ones from the system.

@@ -4,24 +4,25 @@ export const duplicatesRowsPerPage = 10;
export const autocompleteRows = 100;

export const statementStateToColor: StatementStateToColor = {
draft: "primary", // blue
Copy link
Member Author

Choose a reason for hiding this comment

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

@ddelpiano @zsinnema I couldn't find in figma what colours to use so I opted for the ones that make more sense to me:

warning -> applied to states that require changes
info -> applied to states that were processed
primary -> applied to the initial state
success -> applied to everything else

@afonsobspinto
Copy link
Member Author

@ddelpiano I left this PR as draft so that we don't have dev change while you are testing the release. Please make the PR ready for review and mark @zsinnema as reviewer when you think it's fine to have this PR merged.

@zsinnema
Copy link
Contributor

@afonsobspinto did you test the migrations?

@afonsobspinto
Copy link
Member Author

afonsobspinto commented Feb 13, 2024

@afonsobspinto did you test the migrations?

@zsinnema Locally, yes:

[☸ docker-desktop][ feature/SCKAN-259][$?⇡][🐍 v3.9.9(sckan)]
sckan-composer/backend ❯ python manage.py makemigrations
Migrations for 'composer':
  composer/migrations/0039_remove_connectivitystatement_state_valid_and_more.py
    - Remove constraint state_valid from model connectivitystatement
    - Remove constraint sentence_state_valid from model sentence
    - Alter field state on exportmetrics
    - Create constraint state_valid on model connectivitystatement
    - Create constraint sentence_state_valid on model sentence

[☸ docker-desktop][ feature/SCKAN-259][$?⇡][🐍 v3.9.9(sckan)]
sckan-composer/backend ❯ python manage.py makemigrations composer --empty
Migrations for 'composer':
  composer/migrations/0040_auto_20240213_1301.py

[☸ docker-desktop][ feature/SCKAN-259][$?⇡][🐍 v3.9.9(sckan)]
sckan-composer/backend ❯ python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, authtoken, composer, contenttypes, sessions, social_django
Running migrations:
  Applying composer.0036_convert_unknown_to_null... OK
  Applying composer.0037_remove_unknown_enum... OK
  Applying composer.0038_alter_connectivitystatement_circuit_type_and_more... OK
  Applying composer.0039_remove_connectivitystatement_state_valid_and_more... OK
  Applying composer.0040_auto_20240213_1301... OK

@afonsobspinto afonsobspinto mentioned this pull request Feb 13, 2024
@ddelpiano ddelpiano marked this pull request as ready for review February 15, 2024 09:58
@zsinnema
Copy link
Contributor

@afonsobspinto there are some merge conflicts, can you have a look? thanks

@zsinnema zsinnema merged commit 4a04f85 into develop Feb 15, 2024
1 check passed
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.

2 participants