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

1155 add a column to track the reindexing curator #1180

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

Kirandawadi
Copy link
Collaborator

Changes made:

  • Added "Reindexing Curator" column to the homepage.
  • Added functionality to automatically clear the reindexing curator when reindexing status is set to "Not Needed".
  • This is implemented both in the frontend through postReindexingStatus() and in the backend via the CollectionSerializer.
  • Made minor refactors to improve variable naming consistency

@Kirandawadi Kirandawadi linked an issue Jan 11, 2025 that may be closed by this pull request
@Kirandawadi
Copy link
Collaborator Author

Demo

Reindexing_Curator.mov

# If reindexing_status is REINDEXING_NOT_NEEDED, set Reindexing Curator field to None (reset to default)
if validated_data.get("reindexing_status") == 1:
validated_data["reindexing_curated_by"] = None

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we maintain the history of changes on this field?

@CarsonDavis
Copy link
Collaborator

Let's add a test file for the new features. Cover everything that makes sense, but also specifically I want to see that the ReindexingHistory logs are being maintained as we add additional reindexing curators.

@bishwaspraveen
Copy link
Contributor

bishwaspraveen commented Jan 24, 2025

Can you also take a look at this part of the code:

if instance.reindexing_status != instance.old_reindexing_status:
        ReindexingHistory.objects.create(
            collection=instance,
            reindexing_status=instance.reindexing_status,
            curated_by=instance.curated_by,
            old_status=instance.old_reindexing_status,
        )

@@ -426,6 +443,37 @@ function handleCuratorSelect() {
});
}

function handleReindexingCuratorSelect() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this code dry and reuse code that we already have for CuratorSelect

@CarsonDavis
Copy link
Collaborator

Ok, slight design change. Lets only maintain one curator column, and populate the frontend based on the history. The original curator will be populated based on the first entry in the history table, and the reindexing curator will be populated based on the latest curator.

@CarsonDavis
Copy link
Collaborator

The recurator doesn't get depopulated until curation in progress or recuration in progress.

@@ -440,6 +488,16 @@ function postReindexingStatus(collection_id, reindexing_status) {
},
success: function (data) {
toastr.success("Reindexing Status Updated!");

// If reindexing_status is REINDEXING_NOT_NEEDED, set Reindexing Curator field to None (reset to default)
Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at the post_save method in collection.py and refactor it based on standards.

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.

Add a Column to Track the Reindexing Curator
3 participants