mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
Add missing getCsrfToken import
This commit is contained in:
parent
3b091b0dc3
commit
67a8cf425d
8 changed files with 12 additions and 17 deletions
|
@ -153,7 +153,7 @@ export function initApprovedDomain() {
|
|||
}
|
||||
|
||||
/**
|
||||
* A function for copy summary button (appears in DomainRegistry models)
|
||||
* A function for copy summary button
|
||||
*/
|
||||
export function initCopyRequestSummary() {
|
||||
const copyButton = document.getElementById('id-copy-to-clipboard-summary');
|
||||
|
|
|
@ -2,7 +2,7 @@ import { hideElement, showElement } from './helpers-admin.js';
|
|||
|
||||
/**
|
||||
* A function for dynamically changing some fields on the portfolio admin model
|
||||
* IMPORTANT NOTE: The logic in this function is paired handlePortfolioSelection and shoul be refactored
|
||||
* IMPORTANT NOTE: The logic in this function is paired handlePortfolioSelection and should be refactored once we solidify our requirements.
|
||||
*/
|
||||
export function initDynamicPortfolioFields(){
|
||||
|
||||
|
|
|
@ -27,9 +27,7 @@ export function loadInitialValuesForComboBoxes() {
|
|||
|
||||
// Override the default clear button behavior such that it no longer clears the input,
|
||||
// it just resets to the data-initial-value.
|
||||
|
||||
// Due to the nature of how uswds works, this is slightly hacky.
|
||||
|
||||
// Use a MutationObserver to watch for changes in the dropdown list
|
||||
const dropdownList = comboBox.querySelector(`#${input.id}--list`);
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
|
|
|
@ -47,8 +47,6 @@ function fetchJSON(endpoint, callback, url="/api/v1/") {
|
|||
if (xhr.status != 200) return;
|
||||
callback(JSON.parse(xhr.response));
|
||||
};
|
||||
// nothing, don't care
|
||||
// xhr.onerror = function() { };
|
||||
}
|
||||
|
||||
/** Modifies CSS and HTML when an input is valid/invalid. */
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
/**
|
||||
* Helper function to get the CSRF token from the cookie
|
||||
*
|
||||
*/
|
||||
export function getCsrfToken() {
|
||||
return document.querySelector('input[name="csrfmiddlewaretoken"]').value;
|
||||
}
|
||||
|
|
@ -67,3 +67,11 @@ export function debounce(handler, cooldown=600) {
|
|||
timeout = setTimeout(() => handler.apply(context, args), cooldown);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to get the CSRF token from the cookie
|
||||
*
|
||||
*/
|
||||
export function getCsrfToken() {
|
||||
return document.querySelector('input[name="csrfmiddlewaretoken"]').value;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { hideElement, showElement } from './helpers.js';
|
||||
import { hideElement, showElement, getCsrfToken } from './helpers.js';
|
||||
import { uswdsInitializeModals, uswdsUnloadModals } from './helpers-uswds.js';
|
||||
import { getCsrfToken } from './helpers-csrf-token.js';
|
||||
|
||||
import { BaseTable, addModal, generateKebabHTML } from './table-base.js';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hideElement, showElement } from './helpers.js';
|
||||
import { hideElement, showElement, getCsrfToken } from './helpers.js';
|
||||
import { uswdsInitializeModals, uswdsUnloadModals } from './helpers-uswds.js';
|
||||
import { BaseTable, addModal, generateKebabHTML } from './table-base.js';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue