Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jun 25, 2024
1 parent fe49c7a commit 3d6ec0e
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 35 deletions.
13 changes: 9 additions & 4 deletions public-typescript/adminTables.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"use strict";
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const los = exports.los;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function refreshFontAwesomeIcon(changeEvent) {
var _a;
const inputElement = changeEvent.currentTarget;
const fontAwesomeIconClass = inputElement.value;
inputElement
.closest('.field')
.querySelectorAll('.button.is-static')[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
((_a = inputElement.closest('.field')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.button.is-static'
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
))[1].innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
}
"use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Expand Down Expand Up @@ -187,6 +190,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
renderWorkOrderTypes();

// eslint-disable-next-line no-secrets/no-secrets
"use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
Expand Down Expand Up @@ -537,6 +541,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
renderLotStatuses();

// eslint-disable-next-line no-secrets/no-secrets
"use strict";
/* eslint-disable @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
Expand Down
13 changes: 9 additions & 4 deletions public-typescript/adminTables/adminTables.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
"use strict";
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */
Object.defineProperty(exports, "__esModule", { value: true });
(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const los = exports.los;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function refreshFontAwesomeIcon(changeEvent) {
var _a;
const inputElement = changeEvent.currentTarget;
const fontAwesomeIconClass = inputElement.value;
inputElement
.closest('.field')
.querySelectorAll('.button.is-static')[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
((_a = inputElement.closest('.field')) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.button.is-static'
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
))[1].innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`;
}
//=include adminTablesWorkOrderTypes.js
// eslint-disable-next-line no-secrets/no-secrets
//=include adminTablesWorkOrderMilestoneTypes.js
//=include adminTablesLotStatuses.js
// eslint-disable-next-line no-secrets/no-secrets
//=include adminTablesLotOccupantTypes.js
})();
23 changes: 17 additions & 6 deletions public-typescript/adminTables/adminTables.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* eslint-disable spaced-comment, @typescript-eslint/no-non-null-assertion, unicorn/prefer-module */
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable unicorn/prefer-module */

import type * as globalTypes from '../../types/globalTypes'
import type * as globalTypes from '../../types/globalTypes.js'

declare const exports: Record<string, unknown>
;(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const los = exports.los as globalTypes.LOS
Expand All @@ -11,15 +14,23 @@ import type * as globalTypes from '../../types/globalTypes'

const fontAwesomeIconClass = inputElement.value

inputElement
.closest('.field')!
.querySelectorAll(
// eslint-disable-next-line no-unsanitized/property
;(
inputElement.closest('.field')?.querySelectorAll(
'.button.is-static'
)[1].innerHTML = `<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
) as NodeListOf<HTMLButtonElement>
)[1].innerHTML =
`<i class="fas fa-fw fa-${fontAwesomeIconClass}" aria-hidden="true"></i>`
}

//=include adminTablesWorkOrderTypes.js

// eslint-disable-next-line no-secrets/no-secrets
//=include adminTablesWorkOrderMilestoneTypes.js

//=include adminTablesLotStatuses.js

// eslint-disable-next-line no-secrets/no-secrets
//=include adminTablesLotOccupantTypes.js
})()
12 changes: 6 additions & 6 deletions public-typescript/workOrderEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
bulmaJS.confirm({
title: 'Complete Milestone',
message: 'Are you sure you want to complete this milestone?' +
(workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''),
message: `Are you sure you want to complete this milestone?
${workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''}`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
Expand Down
12 changes: 6 additions & 6 deletions public-typescript/workOrderEdit/workOrderEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
bulmaJS.confirm({
title: 'Complete Milestone',
message: 'Are you sure you want to complete this milestone?' +
(workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''),
message: `Are you sure you want to complete this milestone?
${workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''}`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
Expand Down
15 changes: 8 additions & 7 deletions public-typescript/workOrderEdit/workOrderEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,14 @@ declare const exports: Record<string, unknown>

bulmaJS.confirm({
title: 'Complete Milestone',
message:
'Are you sure you want to complete this milestone?' +
(workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''),
message: `Are you sure you want to complete this milestone?
${
workOrderMilestone.workOrderMilestoneDateString !== undefined &&
workOrderMilestone.workOrderMilestoneDateString !== '' &&
workOrderMilestone.workOrderMilestoneDateString > currentDateString
? '<br /><strong>Note that this milestone is expected to be completed in the future.</strong>'
: ''
}`,
messageIsHtml: true,
contextualColorName: 'warning',
okButton: {
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/adminTables.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/javascripts/workOrderEdit.min.js

Large diffs are not rendered by default.

0 comments on commit 3d6ec0e

Please sign in to comment.