Move back helpers into the watched folders

This commit is contained in:
Rachid Mrad 2024-11-19 19:57:27 -05:00
parent 58db81c41d
commit 71e6e9240e
No known key found for this signature in database
13 changed files with 45 additions and 38 deletions

View file

@ -1,4 +1,4 @@
import { hideElement, showElement, addOrRemoveSessionBoolean } from '../modules-common/helpers.js'; import { hideElement, showElement, addOrRemoveSessionBoolean } from './helpers-admin.js';
import { handlePortfolioSelection } from './helpers-portfolio-dynamic-fields.js'; import { handlePortfolioSelection } from './helpers-portfolio-dynamic-fields.js';
function displayModalOnDropdownClick(linkClickedDisplaysModal, statusDropdown, actionButton, valueToCheck){ function displayModalOnDropdownClick(linkClickedDisplaysModal, statusDropdown, actionButton, valueToCheck){

View file

@ -0,0 +1,17 @@
export function hideElement(element) {
console.log(element)
element.classList.add('display-none');
};
export function showElement(element) {
element.classList.remove('display-none');
};
// Adds or removes a boolean from our session
export function addOrRemoveSessionBoolean(name, add){
if (add) {
sessionStorage.setItem(name, "true");
}else {
sessionStorage.removeItem(name);
}
}

View file

@ -1,4 +1,4 @@
import { hideElement, showElement } from '../modules-common/helpers.js'; import { hideElement, showElement } from './helpers-admin.js';
/** /**
* Helper function that handles business logic for the suborganization field. * Helper function that handles business logic for the suborganization field.

View file

@ -1,4 +1,4 @@
import { hideElement, showElement } from '../modules-common/helpers.js'; import { hideElement, showElement } from './helpers-admin.js';
/** /**
* A function for dynamically changing some fields on the portfolio admin model * A function for dynamically changing some fields on the portfolio admin model

View file

@ -1,4 +1,4 @@
import { hideElement } from '../modules-common/helpers.js'; import { hideElement } from './helpers-admin.js';
/** An IIFE for toggling the overflow styles on django-admin__model-description (the show more / show less button) */ /** An IIFE for toggling the overflow styles on django-admin__model-description (the show more / show less button) */
export function initDescriptions() { export function initDescriptions() {
@ -8,6 +8,7 @@ export function initDescriptions() {
// Hide the toggle button if text content is less than 200 characters // Hide the toggle button if text content is less than 200 characters
// This is a little over 160 characters to give us some wiggle room if we // This is a little over 160 characters to give us some wiggle room if we
// change the font size marginally. // change the font size marginally.
if (toggleButton)
hideElement(toggleButton); hideElement(toggleButton);
} else { } else {
toggleButton.addEventListener('click', function() { toggleButton.addEventListener('click', function() {

View file

@ -1,4 +1,4 @@
import { hideElement, showElement } from '../modules-common/helpers.js'; import { hideElement, showElement } from './helpers.js';
export function loadInitialValuesForComboBoxes() { export function loadInitialValuesForComboBoxes() {
var overrideDefaultClearButton = true; var overrideDefaultClearButton = true;

View file

@ -67,12 +67,3 @@ export function debounce(handler, cooldown=600) {
timeout = setTimeout(() => handler.apply(context, args), cooldown); timeout = setTimeout(() => handler.apply(context, args), cooldown);
} }
} }
// Adds or removes a boolean from our session
export function addOrRemoveSessionBoolean(name, add){
if (add) {
sessionStorage.setItem(name, "true");
}else {
sessionStorage.removeItem(name);
}
}

View file

@ -1,4 +1,4 @@
import { hideElement, showElement } from '../modules-common/helpers.js'; import { hideElement, showElement } from './helpers.js';
/** A function that intializes the requesting entity page. /** A function 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

View file

@ -1,4 +1,4 @@
import { hideElement, showElement, toggleCaret } from '../modules-common/helpers.js'; import { hideElement, showElement, toggleCaret } from './helpers.js';
export class LoadTableBase { export class LoadTableBase {
constructor(sectionSelector) { constructor(sectionSelector) {

View file

@ -1,4 +1,4 @@
import { hideElement, showElement, scrollToElement } from '../modules-common/helpers.js'; import { hideElement, showElement, scrollToElement } from './helpers.js';
import { initializeModals, unloadModals } from './helpers-uswds.js'; import { initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './helpers-csrf-token.js'; import { getCsrfToken } from './helpers-csrf-token.js';

View file

@ -1,4 +1,4 @@
import { scrollToElement } from '../modules-common/helpers.js'; import { scrollToElement } from './helpers.js';
import { initializeTooltips } from './helpers-uswds.js'; import { initializeTooltips } from './helpers-uswds.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';

View file

@ -1,6 +1,4 @@
import { hideElement, showElement, scrollToElement, toggleCaret } from '../modules-common/helpers.js'; import { scrollToElement } from './helpers.js';
import { initializeTooltips, initializeModals, unloadModals } from './helpers-uswds.js';
import { getCsrfToken } from './helpers-csrf-token.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';

View file

@ -1,4 +1,4 @@
import { hideElement, showElement, scrollToElement } from '../modules-common/helpers.js'; import { hideElement, showElement, scrollToElement } from './helpers.js';
import { LoadTableBase } from './table-base.js'; import { LoadTableBase } from './table-base.js';