formatting

This commit is contained in:
Rachid Mrad 2024-11-18 19:59:43 -05:00
parent 4dec61990c
commit 7d92949e46
No known key found for this signature in database
14 changed files with 1554 additions and 1610 deletions

View file

@ -1,10 +1,5 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hideElement, showElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
/**
* An IIFE that changes the default clear behavior on comboboxes to the input field.
* We want the search bar to act soley as a search bar.
*/
export function loadInitialValuesForComboBoxes() { export function loadInitialValuesForComboBoxes() {
var overrideDefaultClearButton = true; var overrideDefaultClearButton = true;
var isTyping = false; var isTyping = false;
@ -117,6 +112,4 @@ export function loadInitialValuesForComboBoxes() {
}); });
} }
} }
} }

View file

@ -1,10 +1,4 @@
// <<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>><<>>
// Event handlers.
var DEFAULT_ERROR = "Please check this field for errors."; var DEFAULT_ERROR = "Please check this field for errors.";
var INFORMATIVE = "info";
var WARNING = "warning";
var ERROR = "error"; var ERROR = "error";
var SUCCESS = "success"; var SUCCESS = "success";

View file

@ -1,7 +1,4 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hookupYesNoListener, hookupRadioTogglerListener } from './radios.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
import { hookupYesNoListener, hookupRadioTogglerListener } from './helpers-radios.js';
import { getCsrfToken } from './get-csrf-token.js';
import { initDomainValidators } from './domain-validators.js'; import { initDomainValidators } from './domain-validators.js';
import { initFormsetsForms, triggerModalOnDsDataForm, nameserversFormListener } from './formset-forms.js'; import { initFormsetsForms, triggerModalOnDsDataForm, nameserversFormListener } from './formset-forms.js';
import { initializeUrbanizationToggle } from './urbanization.js'; import { initializeUrbanizationToggle } from './urbanization.js';
@ -43,6 +40,3 @@ initDomainsTable();
initDomainRequestsTable(); initDomainRequestsTable();
initMembersTable(); initMembersTable();
initMemberDomainsTable(); initMemberDomainsTable();

View file

@ -1,5 +1,5 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hideElement, showElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
/** An IIFE that intializes the requesting entity page. /** An IIFE that intializes the requesting entity page.
* This page has a radio button that dynamically toggles some fields * This page has a radio button that dynamically toggles some fields
* Within that, the dropdown also toggles some additional form elements. * Within that, the dropdown also toggles some additional form elements.
@ -43,4 +43,4 @@ export function handleRequestingEntityFieldset() {
// Add event listener to the suborg dropdown to show/hide the suborg details section // Add event listener to the suborg dropdown to show/hide the suborg details section
select.addEventListener("change", () => toggleSuborganization()); select.addEventListener("change", () => toggleSuborganization());
} }

View file

@ -1,5 +1,4 @@
import { hideElement, showElement, toggleCaret } from './helpers.js'; import { hideElement, showElement, toggleCaret } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
export class LoadTableBase { export class LoadTableBase {
constructor(sectionSelector) { constructor(sectionSelector) {
@ -356,4 +355,4 @@ export class LoadTableBase {
} }
}); });
} }
} }

View file

@ -1,6 +1,6 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hideElement, showElement, scrollToElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js'; import { initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './get-csrf-token.js'; import { getCsrfToken } from './helpers-csrf-token.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';
@ -35,7 +35,7 @@ export class DomainRequestsTable extends LoadTableBase {
hideElement(exportButton); hideElement(exportButton);
} }
} }
} }
/** /**
* Loads rows in the domains list, as well as updates pagination around the domains list * Loads rows in the domains list, as well as updates pagination around the domains list
@ -389,14 +389,8 @@ export class DomainRequestsTable extends LoadTableBase {
}) })
.catch(error => console.error('Error fetching domain requests:', error)); .catch(error => console.error('Error fetching domain requests:', error));
} }
} }
/**
* An IIFE that listens for DOM Content to be loaded, then executes. This function
* initializes the domain requests list and associated functionality.
*
*/
export function initDomainRequestsTable() { export function initDomainRequestsTable() {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const domainRequestsSectionWrapper = document.getElementById('domain-requests'); const domainRequestsSectionWrapper = document.getElementById('domain-requests');

View file

@ -1,5 +1,5 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { scrollToElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js'; import { initializeTooltips } from './helpers-uswds.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';
@ -139,14 +139,8 @@ export class DomainsTable extends LoadTableBase {
}) })
.catch(error => console.error('Error fetching domains:', error)); .catch(error => console.error('Error fetching domains:', error));
} }
} }
/**
* An IIFE that listens for DOM Content to be loaded, then executes. This function
* initializes the domains list and associated functionality.
*
*/
export function initDomainsTable() { export function initDomainsTable() {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const isDomainsPage = document.getElementById("domains") const isDomainsPage = document.getElementById("domains")
@ -158,7 +152,4 @@ export function initDomainsTable() {
} }
} }
}); });
} }

View file

@ -1,6 +1,6 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js'; import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './get-csrf-token.js'; import { getCsrfToken } from './helpers-csrf-token.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';
@ -109,10 +109,9 @@ export class MemberDomainsTable extends LoadTableBase {
}) })
.catch(error => console.error('Error fetching domains:', error)); .catch(error => console.error('Error fetching domains:', error));
} }
} }
export function initMemberDomainsTable() {
export function initMemberDomainsTable() {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const isMemberDomainsPage = document.getElementById("member-domains") const isMemberDomainsPage = document.getElementById("member-domains")
if (isMemberDomainsPage){ if (isMemberDomainsPage){
@ -123,4 +122,4 @@ export class MemberDomainsTable extends LoadTableBase {
} }
} }
}); });
} }

View file

@ -1,6 +1,4 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js'; import { hideElement, showElement, scrollToElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './get-csrf-token.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';
@ -353,15 +351,8 @@ export class MembersTable extends LoadTableBase {
}) })
.catch(error => console.error('Error fetching members:', error)); .catch(error => console.error('Error fetching members:', error));
} }
} }
/**
* An IIFE that listens for DOM Content to be loaded, then executes. This function
* initializes the members list and associated functionality.
*
*/
export function initMembersTable() { export function initMembersTable() {
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const isMembersPage = document.getElementById("members") const isMembersPage = document.getElementById("members")

View file

@ -1,21 +1,10 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './get-csrf-token.js';
/**
* An IIFE that displays confirmation modal on the user profile page
*/
export function userProfileListener() { export function userProfileListener() {
const showConfirmationModalTrigger = document.querySelector('.show-confirmation-modal'); const showConfirmationModalTrigger = document.querySelector('.show-confirmation-modal');
if (showConfirmationModalTrigger) { if (showConfirmationModalTrigger) {
showConfirmationModalTrigger.click(); showConfirmationModalTrigger.click();
} }
} }
/**
* An IIFE that hooks up the edit buttons on the finish-user-setup page
*/
export function finishUserSetupListener() { export function finishUserSetupListener() {
function getInputField(fieldName){ function getInputField(fieldName){
@ -183,4 +172,4 @@ export function finishUserSetupListener() {
// Show the input fields if an error exists // Show the input fields if an error exists
showInputOnErrorFields(); showInputOnErrorFields();
} }