-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from DSACMS/mg-employer-search
Simplified Employer Search
- Loading branch information
Showing
12 changed files
with
135 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Borrowed from https://github.com/18F/identity-idp/blob/59bc8bb6c47402f386d9248bfad3c0803f68187e/app/javascript/packages/request/index.ts#L25-L59 | ||
export default class CSRF { | ||
static get token(): string | null { | ||
return this.#tokenMetaElement?.content || null; | ||
} | ||
|
||
static set token(value: string | null) { | ||
if (!value) { | ||
return; | ||
} | ||
|
||
if (this.#tokenMetaElement) { | ||
this.#tokenMetaElement.content = value; | ||
} | ||
|
||
this.#paramInputElements.forEach((input) => { | ||
input.value = value; | ||
}); | ||
} | ||
|
||
static get param(): string | undefined { | ||
return this.#paramMetaElement?.content; | ||
} | ||
|
||
static get #tokenMetaElement(): HTMLMetaElement | null { | ||
return document.querySelector('meta[name="csrf-token"]'); | ||
} | ||
|
||
static get #paramMetaElement(): HTMLMetaElement | null { | ||
return document.querySelector('meta[name="csrf-param"]'); | ||
} | ||
|
||
static get #paramInputElements(): NodeListOf<HTMLInputElement> { | ||
return document.querySelectorAll(`input[name="${this.param}"]`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= turbo_frame_tag 'employers' do %> | ||
<div class="usa-card-group"> | ||
<% @employers.each do |employer| %> | ||
<div class="usa-card usa-card--flag usa-card--media-right flex-1"> | ||
<div class="usa-card__container"> | ||
<div class="usa-card__header"> | ||
<h2 class="usa-card__heading"><%= employer['name'] %></h2> | ||
</div> | ||
<div class="display-none usa-card__media usa-card__media--inset"> | ||
<div class="usa-card__img"> | ||
<img | ||
src="<%= employer['logo_url'] %>" | ||
alt="A placeholder image" | ||
/> | ||
</div> | ||
</div> | ||
<div class="usa-card__footer"> | ||
<button | ||
data-action="click->cbv-flows#select" | ||
data-item-id="<%= employer['id'] %>" | ||
class="usa-button usa-button--outline" | ||
type="button" | ||
> | ||
Select | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.