-
Notifications
You must be signed in to change notification settings - Fork 0
Feature kpoland public private setting on dataset #217
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
base: master
Are you sure you want to change the base?
Feature kpoland public private setting on dataset #217
Conversation
0e4ff1c to
167ebad
Compare
167ebad to
8c75f96
Compare
05d7301 to
d43f3c6
Compare
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.
Pull Request Overview
This PR implements a public/private setting feature for datasets, allowing dataset owners and co-owners to publish datasets and control their visibility. The feature includes comprehensive UI changes for dataset creation/editing workflows and adds backend validation to prevent editing of published or public datasets.
Key Changes
- Adds
is_publicboolean field to datasets with UI controls for public/private visibility selection - Implements a new publishing workflow with a dedicated step in the dataset creation/editing wizard
- Creates a publish modal and API endpoint for updating dataset status and visibility from the dataset list
- Prevents editing of datasets that are published (status=final) or made public
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| gateway/sds_gateway/users/views.py | Adds PublishDatasetView for handling publish requests, refactors permission validation with status/public checks, and updates dataset creation to handle is_public field |
| gateway/sds_gateway/users/urls.py | Adds URL route for the new publish dataset endpoint |
| gateway/sds_gateway/users/forms.py | Adds is_public BooleanField and changes status field to HiddenInput widget |
| gateway/sds_gateway/templates/users/partials/step_4.html | New step for publishing info with toggles for status and visibility |
| gateway/sds_gateway/templates/users/partials/step_5.html | Moves review/create content to step 5 (previously step 4) |
| gateway/sds_gateway/templates/users/partials/step_1.html | Removes status field from basic info step (moved to publishing step) |
| gateway/sds_gateway/templates/users/partials/review_create_dataset.html | Removes status display and adds publishing alerts container |
| gateway/sds_gateway/templates/users/partials/publish_dataset_modal.html | New modal for publishing datasets from the dataset list |
| gateway/sds_gateway/templates/users/group_captures.html | Updates step tabs and passes dataset status/public state to JavaScript |
| gateway/sds_gateway/templates/users/dataset_list.html | Adds public/private icons, publish button in dropdown, and conditional edit button visibility |
| gateway/sds_gateway/static/js/dataset/DatasetModeManager.js | Major updates to handle 5-step workflow, publishing info UI, and submit button styling based on publish status |
| gateway/sds_gateway/static/js/dataset/DatasetCreationHandler.js | Updates step indices for 5-step workflow |
| gateway/sds_gateway/static/js/dataset/DatasetEditingHandler.js | Replaces inline opacity styles with CSS class for disabled elements |
| gateway/sds_gateway/static/js/actions/PublishActionManager.js | New manager class for handling publish modal interactions and API calls |
| gateway/sds_gateway/static/js/actions/DetailsActionManager.js | Updates status display to use badge instead of plain text |
| gateway/sds_gateway/static/js/search/AssetSearchHandler.js | Adds null check for search form (handles public datasets without search) |
| gateway/sds_gateway/static/css/components.css | Adds disabled-element and disable-events CSS classes, textarea padding fix |
| gateway/sds_gateway/api_methods/serializers/dataset_serializers.py | Adds is_public field to dataset serializer |
| gateway/sds_gateway/api_methods/migrations/0017_convert_dataset_authors_to_object_format.py | Removes blank lines (formatting only) |
| gateway/sds_gateway/templates/users/partials/files_management.html | Adds id to files section for JavaScript targeting |
| gateway/sds_gateway/templates/users/partials/captures_management.html | Adds id to captures section for JavaScript targeting |
Comments suppressed due to low confidence (1)
gateway/sds_gateway/static/css/components.css:185
- Duplicate CSS rule: The
.author-itemclass is defined twice (lines 123-125 and 177-179) with slightly different styles. The second definition will override the first one. These should be consolidated into a single rule to avoid confusion and ensure predictable styling.
/* Author management styling */
.author-item {
transition: all 0.3s ease;
}
.author-item:hover {
background-color: var(--bs-gray-100);
}
.author-item.marked-for-removal .form-control {
background-color: var(--bs-gray-100);
border-color: var(--bs-gray-300);
color: var(--bs-gray-600);
}
.author-name-input,
.author-orcid-input {
font-size: 0.9rem;
}
.author-orcid-input {
font-family: "Courier New", monospace;
}
/* Permission-based styling */
.readonly-field {
background-color: var(--bs-gray-100);
border: 1px solid var(--bs-gray-300);
color: var(--bs-gray-600);
}
.readonly-field:focus {
background-color: var(--bs-gray-100);
border-color: var(--bs-gray-300);
box-shadow: none;
}
.readonly-row {
background-color: var(--bs-gray-100);
opacity: 0.8;
}
.readonly-row td {
color: var(--bs-gray-600);
}
.readonly-row .badge {
opacity: 0.7;
}
/* Disabled state styling */
.disabled-element {
opacity: 0.5;
pointer-events: none;
}
/* Authors management styling */
.author-item {
transition: all 0.2s ease;
}
.author-item:hover {
background-color: var(--bs-gray-100);
padding: 0.5rem;
border-radius: 0.375rem;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d43f3c6 to
1643156
Compare
|
I think the answer is that no changes are needed, but I just want to check anyway:
|
5eff96f to
7482db1
Compare
SFDS-184