Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfinnarn committed Feb 9, 2024
1 parent 57ef05b commit 6acf98d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$form['build_request']['vets_website_git_ref']['#disabled'] = TRUE;
$form['build_request']['actions']['submit']['#disabled'] = TRUE;

$build_log_text = 'Build is in progress. View log file: ' .
'<a target="_blank" href="/sites/default/files/next-build.txt">Next Build Log</a>.';
$target_url = Url::fromUserInput("/sites/default/files/next-build.txt");
$build_log_text = Link::fromTextAndUrl('Build is in progress. View log file', $target_url);
}
else {
$build_log_text = 'Build is not in progress.';
Expand Down Expand Up @@ -239,8 +239,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
private function getFileLink(string $file_name): Link|string {
$file_path = $this->fileSystem->realpath("public://$file_name");
if (file_exists($file_path)) {
$targetUrl = Url::fromUserInput("/sites/default/files/$file_name");
return Link::fromTextAndUrl($file_name, $targetUrl);
$target_url = Url::fromUserInput("/sites/default/files/$file_name");
return Link::fromTextAndUrl($file_name, $target_url);
}
else {
return 'does not exist';
Expand All @@ -254,9 +254,9 @@ private function getFileLink(string $file_name): Link|string {
* The preview link.
*/
private function getPreviewLink(): Link {
$frontendBaseUrl = $this->settings->get('next.next_site.next_build_preview_server')['base_url'] ?? 'https://www.va.gov';
$targetUrl = Url::fromUri($frontendBaseUrl, ['attributes' => ['target' => '_blank']]);
return Link::fromTextAndUrl($this->t('View front end'), $targetUrl);
$frontend_base_url = $this->settings->get('next.next_site.next_build_preview_server')['base_url'] ?? 'https://www.va.gov';
$target_url = Url::fromUri($frontend_base_url, ['attributes' => ['target' => '_blank']]);
return Link::fromTextAndUrl($this->t('View front end'), $target_url);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,3 @@ va_gov_content_release.form:
description: 'Triggers content release'
parent: system.admin_content
route_name: 'va_gov_content_release.form'

va_gov_content_release.form.git:
title: 'Release content by git reference'
description: 'Triggers content release by git reference'
parent: system.admin_content
route_name: 'va_gov_content_release.form.git'

va_gov_content_release.form.next_git:
title: 'Next Build Manual Content Release'
description: 'Triggers content release by git reference'
parent: system.admin_content
route_name: 'va_gov_content_release.form.next_git'

va_gov_content_release.form.simple:
title: 'Release content by simple'
description: 'Triggers content release by simple'
parent: system.admin_content
route_name: 'va_gov_content_release.form.simple'
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class ApiClientFactory implements ApiClientFactoryInterface {
const VA_GOV_CMS = 'va.gov-cms';
const CONTENT_BUILD = 'content-build';
const VETS_WEBSITE = 'vets-website';

const NEXT_BUILD = 'next-build';

/**
Expand Down
7 changes: 6 additions & 1 deletion scripts/next-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ source ~/.bashrc
# Installs the content-build dependencies.

if [ ! -d next ]; then
# git clone --single-branch --depth 1 https://github.com/department-of-veterans-affairs/next-build.git next
# Clone full so git information is available for content release form.
# I don't think this should be necessary, but branch information was not
# available in the content release form until I pulled down all information.
git clone https://github.com/department-of-veterans-affairs/next-build.git next
else
echo "Repo next-build already cloned."
Expand All @@ -20,8 +22,11 @@ cd next

nvm install 18.17.0
nvm use 18.17.0

# These steps caused the build to fail for me so I disabled temporarily.
#corepack enable
#corepack prepare yarn@stable --activate

echo "Node $(node -v)"
echo "NPM $(npm -v)"
echo "Yarn $(yarn -v)"
Expand Down

0 comments on commit 6acf98d

Please sign in to comment.