Skip to content

Commit

Permalink
Merge pull request #8517 from cfpb/upgrade/wagtail61
Browse files Browse the repository at this point in the history
Upgrade Wagtail to 6.1
  • Loading branch information
willbarton authored Jul 25, 2024
2 parents d5bcc74 + 1989c85 commit 9880439
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
6 changes: 6 additions & 0 deletions cfgov/jobmanager/models/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ class Meta:
InlinePanel("major_cities", label="Major cities"),
]

def states_in_region(self):
return ", ".join(str(state) for state in self.states.all())

def major_city_names(self):
return "; ".join(str(city) for city in self.major_cities.all())


class State(models.Model):
name = models.CharField(max_length=255)
Expand Down
13 changes: 6 additions & 7 deletions cfgov/jobmanager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ class RegionViewSet(SnippetViewSet):
icon = "site"
menu_label = "Regions"

def states_in_region(self):
return ", ".join(str(state) for state in self.states.all())

def major_cities(self):
return "; ".join(str(city) for city in self.major_cities.all())

list_display = ["abbreviation", "name", states_in_region, major_cities]
list_display = [
"abbreviation",
"name",
"states_in_region",
"major_city_names",
]


class ServiceTypeViewSet(SnippetViewSet):
Expand Down
2 changes: 1 addition & 1 deletion cfgov/permissions_viewer/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def register_settings_menu_item():


@hooks.register("register_user_listing_buttons")
def user_listing_buttons(context, user):
def user_listing_buttons(user, request_user):
yield UserListingButton(
"View Permissions",
reverse("permissions:user", args=[user.pk]),
Expand Down
2 changes: 1 addition & 1 deletion requirements/wagtail.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
wagtail==6.0.5
wagtail==6.1.3
6 changes: 3 additions & 3 deletions test/cypress/integration/admin/admin-helpers.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export class AdminPage {
return cy.get('#listing-results').find('li');
}

tags() {
return cy.get('.tagfilter');
filters() {
return cy.get('.w-filter-button');
}

openDocumentsLibrary() {
Expand Down Expand Up @@ -119,7 +119,7 @@ export class AdminPage {
}

cleanUpRegulations() {
cy.get('table tr').last().contains('Delete').click({ force: true });
cy.get('table.listing tr').last().contains('Delete').click({ force: true });
this.submitForm();
}

Expand Down
2 changes: 1 addition & 1 deletion test/cypress/integration/admin/admin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Admin', () => {
it('should be able to open the Images library', () => {
admin.openImageGallery();
admin.getImages().should('be.visible');
admin.tags().should('be.visible');
admin.filters().should('be.visible');
});

it('should be able to open the Documents library', () => {
Expand Down

0 comments on commit 9880439

Please sign in to comment.