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

USAGOV-2085: PXBF release v0.8.0.beta.1 #2052

Merged
merged 15 commits into from
Nov 14, 2024
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
3 changes: 2 additions & 1 deletion .docker/src-cms/etc/nginx/partials/internal_redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
rewrite ^/analytics-usa-redirect$ https://analytics.usa.gov/ permanent;
rewrite ^/avisos-y-politicas-de-este-sitio$ /es/politicas-avisos-del-sitio-web permanent;
rewrite ^/benefits-grants-loans$ /benefits permanent;
rewrite ^/benefit-finder/([^/]+)/[^/]+$ /benefit-finder/$1 permanent;
rewrite ^/budget$ /federal-budget-process permanent;
rewrite ^/business$ /small-business permanent;
rewrite ^/buying-home$ /buying-home-programs permanent;
Expand Down Expand Up @@ -66,6 +67,7 @@
rewrite ^/espanol/ayuda-financiera-becas-beneficios$ /es/beneficios-gobierno permanent;
rewrite ^/espanol/ayuda-financiera-para-estudiantes$ /es/fafsa-ayuda-federal-estudiantes permanent;
rewrite ^/espanol/beneficios-familias-militares$ /es/beneficios-educativos-laborales-familiares permanent;
rewrite ^/es/buscador-beneficios/([^/]+)/[^/]+$ /es/buscador-beneficios/$1 permanent;
rewrite ^/espanol/cambie-registro-electoral$ /es/actualizar-registro-electoral permanent;
rewrite ^/espanol/chat$ /es/chat permanent;
rewrite ^/espanol/ciudadania-inmigracion-viajes$ /es/inmigracion-ciudadania-estados-unidos permanent;
Expand Down Expand Up @@ -261,6 +263,5 @@
rewrite ^/voting$ /voting-and-elections permanent;
rewrite ^/voting-laws-history$ /voting-laws permanent;


# Any ^espanol/* not otherwise specified links to /es/* (and may 404)
rewrite ^/espanol/(.+)$ /es/$1 permanent;
2 changes: 2 additions & 0 deletions .docker/src-www/etc/nginx/partials/internal_redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
rewrite ^/analytics-usa-redirect$ https://analytics.usa.gov/ permanent;
rewrite ^/avisos-y-politicas-de-este-sitio$ /es/politicas-avisos-del-sitio-web permanent;
rewrite ^/benefits-grants-loans$ /benefits permanent;
rewrite ^/benefit-finder/([^/]+)/[^/]+$ /benefit-finder/$1 permanent;
rewrite ^/budget$ /federal-budget-process permanent;
rewrite ^/business$ /small-business permanent;
rewrite ^/buying-home$ /buying-home-programs permanent;
Expand Down Expand Up @@ -66,6 +67,7 @@
rewrite ^/espanol/ayuda-financiera-becas-beneficios$ /es/beneficios-gobierno permanent;
rewrite ^/espanol/ayuda-financiera-para-estudiantes$ /es/fafsa-ayuda-federal-estudiantes permanent;
rewrite ^/espanol/beneficios-familias-militares$ /es/beneficios-educativos-laborales-familiares permanent;
rewrite ^/es/buscador-beneficios/([^/]+)/[^/]+$ /es/buscador-beneficios/$1 permanent;
rewrite ^/espanol/cambie-registro-electoral$ /es/actualizar-registro-electoral permanent;
rewrite ^/espanol/chat$ /es/chat permanent;
rewrite ^/espanol/ciudadania-inmigracion-viajes$ /es/inmigracion-ciudadania-estados-unidos permanent;
Expand Down
5 changes: 5 additions & 0 deletions config/sync/user.role.benefits_finder_content_manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ permissions:
- 'revert bears_criteria revisions'
- 'revert bears_life_event revisions'
- 'revert bears_life_event_form revisions'
- 'use basic_workflow transition archive'
- 'use basic_workflow transition create_new_draft'
- 'use basic_workflow transition move_to_review'
- 'use basic_workflow transition publish'
- 'use basic_workflow transition restore'
- 'view any unpublished content'
- 'view bears_agency revisions'
- 'view bears_benefit revisions'
- 'view bears_criteria revisions'
- 'view bears_life_event revisions'
- 'view bears_life_event_form revisions'
- 'view latest version'
- 'view own unpublished content'
- 'view the administration theme'
10 changes: 10 additions & 0 deletions config/sync/workflows.workflow.basic_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ status: true
dependencies:
config:
- node.type.basic_page
- node.type.bears_agency
- node.type.bears_benefit
- node.type.bears_criteria
- node.type.bears_life_event
- node.type.bears_life_event_form
module:
- content_moderation
id: basic_workflow
Expand Down Expand Up @@ -71,4 +76,9 @@ type_settings:
entity_types:
node:
- basic_page
- bears_agency
- bears_benefit
- bears_criteria
- bears_life_event
- bears_life_event_form
default_moderation_state: draft
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,11 @@ public function getData($id) {
if (empty($life_event_form_node)) {
$result = [];
$json = json_encode($result, JSON_PRETTY_PRINT);
print_r("<p>JSON Data<pre>");
print_r($json);
print_r("</pre>");
if ($this->displayData) {
print_r("<p>JSON Data<pre>");
print_r($json);
print_r("</pre>");
}
return $result;
}

Expand Down Expand Up @@ -320,6 +322,7 @@ public function getData($id) {
"benefits" => $benefits,
];
$json = json_encode($result, JSON_PRETTY_PRINT);
$json = htmlspecialchars($json);

if ($this->displayData) {
print_r("<p>JSON Data<pre>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@ use Drupal\usagov_benefit_finder_api\Controller\LifeEventController;
* @param Node $node
*/
function usagov_benefit_finder_api_node_update(Node $node) {
$generate_json_files = 1;
$url = _usagov_benefit_finder_api_get_current_page_url();

if (strpos($url, "/admin/content") === FALSE) {
if ($node->hasField('moderation_state')) {
$moderation_state = $node->get('moderation_state')->value;
if ($moderation_state == 'needs_review') {
$generate_json_files = 0;
}
}
}
else {
$generate_json_files = 0;
}

if ($generate_json_files == 1) {
_usagov_benefit_finder_api_batch_generate_json_data_files($node);
}
else {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading