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

VAGOV-TEAM-100673: Removes navbar and replaces with subtitle. #20268

Merged
merged 2 commits into from
Jan 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
font-size: var(--vads-font-size-heading-level-2);
}

.form-builder-page-container h2 {
font-size: var(--vads-font-size-heading-level-2);
}

ryguyk marked this conversation as resolved.
Show resolved Hide resolved
.form-builder-page-container h3 {
font-size: var(--vads-font-size-heading-level-3);
}
Expand Down Expand Up @@ -53,43 +49,10 @@
margin-bottom: var(--units-1p5);
}

/* navbar */
.form-builder-navbar__nav {
display: flex;
}

.form-builder-navbar__tabs {
display: flex;
gap: var(--units-5);
list-style: none;
margin: 0;
}

.form-builder-navbar__tab {
min-width: 100px;
padding: var(--units-1);
position: relative;
text-align: center;
}

.form-builder-navbar__tab--active {
border-bottom: var(--units-0p5) solid var(--uswds-system-color-gold-vivid-20);
}

.form-builder-navbar__link {
color: var(--vads-color-white);
font-size: var(--font-size-lg);
font-weight: var(--font-weight-bold);
line-height: var(--vads-font-line-height-default);
text-decoration: none;
}

.form-builder-navbar__link:hover {
background: transparent;
color: var(--vads-color-white);
}

.form-builder-navbar__tab--active .form-builder-navbar__link,
.form-builder-navbar__tab--active .form-builder-navbar__link:hover {
color: var(--uswds-system-color-gold-vivid-20);
/* subtitle */
.form-builder-subtitle {
font-size: var(--vads-font-size-heading-level-3);
font-weight: 700;
line-height: var(--units-3);
padding: var(--units-1p5);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class VaGovFormBuilderController extends ControllerBase {
private $drupalFormBuilder;

/**
* The active tab in the form builder.
* The page subtitle.
*
* @var 'forms'|'content'|'layout'
* @var string
*/
private $activeTab;
private $subtitle;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -65,7 +65,7 @@ private function getFormPage($formName, $nid = NULL) {
'content' => $form,
// Add custom data.
'form_builder_page_data' => [
'active_tab' => $this->activeTab,
'subtitle' => $this->subtitle,
],
// Add styles.
'#attached' => [
Expand All @@ -87,23 +87,23 @@ public function entry() {
* Intro page.
*/
public function intro() {
$this->activeTab = 'forms';
$this->subtitle = 'Subtitle Placeholder';
return $this->getFormPage('Intro');
}

/**
* Start-conversion page.
*/
public function startConversion() {
$this->activeTab = 'forms';
$this->subtitle = 'Subtitle Placeholder';
return $this->getFormPage('StartConversion');
}

/**
* Name-and-date-of-birth page.
*/
public function nameAndDob($nid) {
$this->activeTab = 'content';
$this->subtitle = 'Subtitle Placeholder';
return $this->getFormPage('NameAndDob', $nid);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,8 @@
<div class="form-builder-page-container">
<header class="form-builder-header">
<div class="form-builder-layout-container">

<div class="form-builder-title">
<h1 class="form-builder-title__page-title">Form Builder</h1>
</div>

{% set active_tab = page.form_builder_page_data.active_tab %}
<div class="form-builder-navbar">
<nav class="form-builder-navbar__nav">
<ul class="form-builder-navbar__tabs">

<li class="form-builder-navbar__tab form-builder-navbar__tab--forms
{{
active_tab == 'forms' ? 'form-builder-navbar__tab--active'
: ''
}}"
>
<a href="#" class="form-builder-navbar__link">Forms</a>
</li>

<li class="form-builder-navbar__tab form-builder-navbar__tab--content
{{
active_tab == 'content' ? 'form-builder-navbar__tab--active'
: ''
}}">
<a href="#" class="form-builder-navbar__link">Content</a>
</li>

<li class="form-builder-navbar__tab form-builder-navbar__tab--layout
{{
active_tab == 'layout' ? 'form-builder-navbar__tab--active'
: ''
}}"
>
<a href="#" class="form-builder-navbar__link">Layout</a>
</li>
</ul>
</nav>
</div>
<h1 class="form-builder-title">Form Builder</h1>
<p class="form-builder-subtitle">{{ page.form_builder_page_data.subtitle }}</p>
</div>
</header>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ public function testFormDoesNotLoad() {
$this->sharedTestFormDoesNotLoad($this->getFormPageUrl());
}

/**
* Test that the active tab is correct.
*/
public function testActiveTab() {
$activeTab = $this->getSession()->getPage()->find('css', '.form-builder-navbar__tab--active');
$this->assertTrue($activeTab->hasClass('form-builder-navbar__tab--forms'), 'The expected tab is active.');
}

/**
* Test the 'Start conversion' button.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ public function testFormDoesNotLoad() {
$this->sharedTestFormDoesNotLoad($this->getFormPageUrl());
}

/**
* Test that the active tab is correct.
*/
public function testActiveTab() {
$activeTab = $this->getSession()->getPage()->find('css', '.form-builder-navbar__tab--active');
$this->assertTrue($activeTab->hasClass('form-builder-navbar__tab--content'), 'The expected tab is active.');
}

/**
* Test that the form submission adds a chapter when not already present.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ public function testFormDoesNotLoad() {
$this->sharedTestFormDoesNotLoad($this->getFormPageUrl());
}

/**
* Test that the active tab is correct.
*/
public function testActiveTab() {
$activeTab = $this->getSession()->getPage()->find('css', '.form-builder-navbar__tab--active');
$this->assertTrue($activeTab->hasClass('form-builder-navbar__tab--forms'), 'The expected tab is active.');
}

/**
* Test that the form submission succeeds.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testExpectedElementsExist() {
$containerElement = $this->cssSelect('.form-builder-page-container');
$this->assertCount(1, $containerElement);

$navbarElement = $this->cssSelect('.form-builder-navbar');
$navbarElement = $this->cssSelect('.form-builder-subtitle');
$this->assertCount(1, $navbarElement);
}

Expand Down
Loading