Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def convert_authors_to_object_format(apps, schema_editor):
logger.debug("Dataset %s already in new format, skipping", dataset.uuid)
skipped_count += 1
continue

# Convert string authors to object format
if isinstance(current_authors[0], str):
new_authors = []
Expand Down Expand Up @@ -126,7 +125,6 @@ def reverse_authors_to_string_format(apps, schema_editor):
if isinstance(current_authors[0], dict) and "name" in current_authors[0]:
# Convert object authors back to string format
string_authors = [author["name"] for author in current_authors]

# Update the dataset
dataset.authors = json.dumps(string_authors)
dataset.save(update_fields=["authors"])
Expand Down
25 changes: 25 additions & 0 deletions gateway/sds_gateway/static/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
text-decoration: line-through;
background-color: var(--bs-gray-100);
cursor: not-allowed;
opacity: 0.6;
color: var(--bs-gray-600);
}

.marked-for-removal td {
text-decoration: line-through;
color: var(--bs-gray-600);
}

/* Authors Management Styles */
Expand Down Expand Up @@ -112,6 +119,13 @@
box-shadow: none;
}

/* Ensure textarea also has proper padding when disabled */
textarea.form-control[readonly],
textarea.form-control:disabled,
textarea.form-control-plaintext {
padding: 0.75rem 1rem;
}

/* Author management styling */
.author-item {
transition: all 0.3s ease;
Expand Down Expand Up @@ -160,6 +174,12 @@
opacity: 0.7;
}

/* Disabled state styling */
.disabled-element {
opacity: 0.5;
pointer-events: none;
}

/* Authors management styling */
.author-item {
transition: all 0.2s ease;
Expand Down Expand Up @@ -1092,6 +1112,11 @@ body {
padding: 1.25rem;
}

.disable-events {
pointer-events: none;
cursor: not-allowed;
}

.display-block {
display: block;
}
Expand Down
29 changes: 24 additions & 5 deletions gateway/sds_gateway/static/js/actions/DetailsActionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,9 @@ class DetailsActionManager {
".dataset-details-description",
datasetData.description || "No description provided",
);
this.updateElementText(
modal,
".dataset-details-status",
datasetData.status || "Unknown",
);
// Update status as badge
this.updateStatusBadge(modal, datasetData.status);

this.updateElementText(
modal,
".dataset-details-created",
Expand Down Expand Up @@ -309,6 +307,27 @@ class DetailsActionManager {
}
}

/**
* Update status badge
* @param {Element} modal - Modal element
* @param {string} status - Status value ('draft' or 'final')
*/
updateStatusBadge(modal, status) {
const statusContainer = modal.querySelector(".dataset-details-status");
if (!status || typeof status !== "string") {
if (statusContainer) {
statusContainer.innerHTML = `<span class="badge bg-secondary">Unknown</span>`;
}
return;
}

const statusText = status[0].toUpperCase() + status.slice(1);
const statusClass = status === "final" ? "success" : "secondary";
if (statusContainer) {
statusContainer.innerHTML = `<span class="badge bg-${statusClass}">${statusText}</span>`;
}
}
Comment thread
klpoland marked this conversation as resolved.

/**
* Set up UUID copy button functionality
* @param {Element} modal - Modal element
Expand Down
Loading