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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ For each PR made, an entry should be added to this changelog. It should contain
- etc.

## Changelog
- 1209-bug-fix-document-type-creator-form
- Description: The dropdown on the pattern creation form needs to be set as multi as the default option since this is why the doc type creator form is used for the majority of multi-URL pattern creations. This should be applied to doc types, division types, and titles as well.
- Changes:
- Set the default value for `match_pattern_type` in `BaseMatchPattern` class is set to `2`
- Changed `test_create_simple_exclude_pattern` test within `TestDeltaExcludePatternBasics`
- Changed `test_create_division_pattern` and `test_create_document_type_pattern_single` within `TestFieldModifierPatternBasics`

- 1052-update-cosmos-to-create-jobs-for-scrapers-and-indexers
- Description: The original automation set up to generate the scrapers and indexers automatically based on a collection workflow status change needed to be updated to more accurately reflect the curation workflow. It would also be good to generate the jobs during this process to streamline the same.
- Changes:
Expand Down
2 changes: 1 addition & 1 deletion sde_collections/models/delta_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MatchPatternTypeChoices(models.IntegerChoices):
match_pattern = models.CharField(
"Pattern", help_text="This pattern is compared against the URL of all documents in the collection"
)
match_pattern_type = models.IntegerField(choices=MatchPatternTypeChoices.choices, default=1)
match_pattern_type = models.IntegerField(choices=MatchPatternTypeChoices.choices, default=2)
delta_urls = models.ManyToManyField(
"DeltaUrl",
related_name="%(class)ss", # Makes delta_url.deltaincludepatterns.all()
Expand Down
2 changes: 1 addition & 1 deletion sde_collections/tests/test_exclude_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_create_simple_exclude_pattern(self):
pattern = DeltaExcludePattern.objects.create(
collection=self.collection, match_pattern="https://example.com/exclude-me", reason="Test exclusion"
)
assert pattern.match_pattern_type == DeltaExcludePattern.MatchPatternTypeChoices.INDIVIDUAL_URL
assert pattern.match_pattern_type == DeltaExcludePattern.MatchPatternTypeChoices.MULTI_URL_PATTERN

def test_exclude_single_curated_url(self):
"""Test excluding a single curated URL creates appropriate delta."""
Expand Down
2 changes: 2 additions & 0 deletions sde_collections/tests/test_field_modifier_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_create_document_type_pattern_single(self):
collection=self.collection,
match_pattern="https://example.com/docs/guide.pdf",
document_type=DocumentTypes.DOCUMENTATION,
match_pattern_type=DeltaDocumentTypePattern.MatchPatternTypeChoices.INDIVIDUAL_URL,
)
assert pattern.match_pattern_type == DeltaDocumentTypePattern.MatchPatternTypeChoices.INDIVIDUAL_URL
assert pattern.document_type == DocumentTypes.DOCUMENTATION
Expand All @@ -68,6 +69,7 @@ def test_create_division_pattern(self):
collection=self.collection,
match_pattern="https://example.com/helio/data.html",
division=Divisions.HELIOPHYSICS,
match_pattern_type=DeltaDivisionPattern.MatchPatternTypeChoices.INDIVIDUAL_URL,
)
assert pattern.match_pattern_type == DeltaDivisionPattern.MatchPatternTypeChoices.INDIVIDUAL_URL
assert pattern.division == Divisions.HELIOPHYSICS
Expand Down
20 changes: 10 additions & 10 deletions sde_indexing_helper/templates/sde_collections/delta_urls_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ <h5 class="modal-title" id="excludePatternModalLabel">Exclude Pattern Form</h5>
<div class="form-group pattern-form-group">
<label for="pattern_type_input" class="form-label">Pattern Type<div class="asterik">*</div></label>
<div class="input-group">
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" required>
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" value="2" required>
<div class="input-group-append pattern-dropdown-input">
<button class="btn btn-secondary btn-block dropdown-toggle pattern-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Select Pattern Type</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Multi-URL Pattern</button>
<div class="pattern-type-form dropdown-menu">
<a class="dropdown-item pattern_type_form_select" value="1">Individual URL Pattern</a>
<a class="dropdown-item pattern_type_form_select" value="2">Multi-URL Pattern</a>
Expand Down Expand Up @@ -483,10 +483,10 @@ <h5 class="modal-title" id="includePatternModalLabel">Include Pattern Form</h5>
<div class="form-group pattern-form-group">
<label for="pattern_type_input" class="form-label">Pattern Type<div class="asterik">*</div></label>
<div class="input-group">
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" required>
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" value="2" required>
<div class="input-group-append pattern-dropdown-input">
<button class="btn btn-secondary btn-block dropdown-toggle pattern-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Select Pattern Type</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Multi-URL Pattern</button>
<div class="pattern-type-form dropdown-menu">
<a class="dropdown-item pattern_type_form_select" value="1">Individual URL Pattern</a>
<a class="dropdown-item pattern_type_form_select" value="2">Multi-URL Pattern</a>
Expand Down Expand Up @@ -527,10 +527,10 @@ <h5 class="modal-title" id="titlePatternModalLabel">Title Pattern Form</h5>
<div class="form-group pattern-form-group">
<label for="pattern_type_input" class="form-label">Pattern Type<div class="asterik">*</div></label>
<div class="input-group">
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" required>
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" value="2" required>
<div class="input-group-append pattern-dropdown-input">
<button class="btn btn-secondary btn-block dropdown-toggle pattern-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Select Pattern Type</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Multi-URL Pattern</button>
<div class="pattern-type-form dropdown-menu">
<a class="dropdown-item pattern_type_form_select" value="1">Individual URL Pattern</a>
<a class="dropdown-item pattern_type_form_select" value="2">Multi-URL Pattern</a>
Expand Down Expand Up @@ -586,10 +586,10 @@ <h5 class="modal-title" id="documentTypePatternModalLabel">Document Type Pattern
<div class="form-group pattern-form-group">
<label for="pattern_type_input" class="form-label">Pattern Type<div class="asterik">*</div></label>
<div class="input-group">
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" required>
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" value="2" required>
<div class="input-group-append pattern-dropdown-input">
<button class="btn btn-secondary btn-block dropdown-toggle pattern-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Select Pattern Type</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Multi-URL Pattern</button>
<div class="pattern-type-form dropdown-menu">
<a class="dropdown-item pattern_type_form_select" value="1">Individual URL Pattern</a>
<a class="dropdown-item pattern_type_form_select" value="2">Multi-URL Pattern</a>
Expand Down Expand Up @@ -644,10 +644,10 @@ <h5 class="modal-title" id="divisionPatternModalLabel">Division Pattern Form</h5
<div class="form-group pattern-form-group">
<label for="pattern_type_input" class="form-label">Pattern Type<div class="asterik">*</div></label>
<div class="input-group">
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" required>
<input type="hidden" name="match_pattern_type" class="form-control" id="pattern_type_input" value="2" required>
<div class="input-group-append pattern-dropdown-input">
<button class="btn btn-secondary btn-block dropdown-toggle pattern-dropdown" type="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Select Pattern Type</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Multi-URL Pattern</button>
<div class="pattern-type-form dropdown-menu">
<a class="dropdown-item pattern_type_form_select" value="1">Individual URL Pattern</a>
<a class="dropdown-item pattern_type_form_select" value="2">Multi-URL Pattern</a>
Expand Down