Skip to content

Conversation

@andybroomfield
Copy link
Contributor

@andybroomfield andybroomfield commented Feb 5, 2021

This is the renaming work related to localgovdrupal/localgov_core#37

To apply this PR, the above PR in localgov_core must also be merged.

This renames the configuration files and references for fields that start
with field_ to the correctly namespaced localgov_ equivilents.
This also does a search and replace accross the localgov_services module to
replace references to the renamed fields with the localgov_ versions.
Also adds an update hook that uses the field rename helper utility in the
localgov_core PR to update existing configuration.

Thanks to @stephen-cox for starting this, hope ok to take over to do the renaming.

@andybroomfield
Copy link
Contributor Author

The tests will fail until localgov_core PR is also merged.
Have done the tests locally to verify with the localgov_core update.

lando phpunit web/modules/contrib/localgov_services
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

Testing web/modules/contrib/localgov_services
Drupal\Tests\localgov_services_landing\Functional\ServicesLandingPage
 ✔ Service landing page

Drupal\Tests\localgov_services_navigation\FunctionalJavascript\EntityReferenceServicesAutocomplete
 ✔ Services entity reference autocomplete widget
 ✔ Entity reference autocomplete widget
 ✔ Entity reference sublanding label widget

Drupal\Tests\localgov_services_navigation\FunctionalJavascript\LandingPageChildren
 ✔ Service landing page link
 ✔ Service landing page reference

Drupal\Tests\localgov_services_navigation\Kernel\ChildReferences
 ✔ Referenced children
 ✔ Add child target

Drupal\Tests\localgov_services_navigation\Kernel\ParentFieldPathauto
 ✔ Service parent addition

Drupal\Tests\localgov_services_page\Functional\ServicesPage
 ✔ Services page

Drupal\Tests\localgov_services_status\Functional\ServiceStatus
 ✔ Service status pages
 ✔ Service status listings
 ✔ Service status path

Drupal\Tests\localgov_services_status\Kernel\Path
 ✔ Process inbound
 ✔ Process outbound

Drupal\Tests\localgov_services_sublanding\Functional\ServiceSublanding
 ✔ Service sublanding pages

Drupal\Tests\localgov_services_sublanding\Functional\TopicListBuilder
 ✔ Topic list builder paragraph display

Drupal\tests\localgov_services_sublanding\Functional\UnpublishedLinkNodeReference
 ✔ Only list published child pages
 ✔ Highlight unpublished child pages

Drupal\Tests\localgov_services\Functional\PagesIntegration
 ✔ Config form
 ✔ Post link
 ✔ Service paths

Drupal\Tests\localgov_services\Functional\ServicesBlock
 ✔ Service core blocks display

Time: 1.75 hours, Memory: 8.00 MB

OK (23 tests, 349 assertions)

stephen-cox and others added 20 commits April 1, 2021 20:39
…ding

Renames the following:
  field_address_first_line         => localgov_address_first_line
  field_address                    => localgov_address
  field_contact_us_online          => localgov_contact_us_online
  field_destinations               => localgov_destination
  field_hearing_difficulties_phone => localgov_hearing_difficulties_ph
  field_link_to_map                => localgov_link_to_map
  field_opening_hours              => localgov_opening_hours
  field_other_team_contacts        => localgov_other_team_contacts
  field_popular_topics             => localgov_popular_topics

Uses the helper class in the updated version of localgov_core to
do the renaming.
Search and replace accross localgov_services for the old fields provided
by localgov_services_landing with field_ prefix to the localgov_ prefix
- Rename config field
- Rename field references
- Add updated hook in localgov_services_navigation
Renames:
 field_download_links         => localgov_download_links
 field_hide_related_topics    => localgov_hide_related_topics
 field_override_related_links => localgov_override_related_links
 field_related_links          => localgov_related_links
 field_service_status_on_list    => localgov_service_status_on_list
 field_enable_service_updates    => localgov_enable_service_updates
 field_service_status            => localgov_service_status
 field_service_status_on_landing => localgov_service_status_on_landi
Apply bulk rename accross the field config and the whole module
Replaces:
  field_facebook      => localgov_facebook
  field_twitter       => localgov_twitter
  field_email_address => localgov_email_address
  field_phone         => localgov_phone
This is to fix tests that look for specific elements.
@andybroomfield andybroomfield requested a review from finnlewis April 6, 2021 15:33
@andybroomfield andybroomfield marked this pull request as ready for review April 6, 2021 15:33
Copy link
Member

@finnlewis finnlewis left a comment

Choose a reason for hiding this comment

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

Based on our testing on localgovdrupal/localgov#189, and conversations in Technical group meetings, I'm happy to approve this.

@andybroomfield andybroomfield merged commit a523330 into master Apr 6, 2021
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.

4 participants