Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Oct 17, 2023
1 parent 7ff8a06 commit d126414
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion public-typescript/admin.users.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
}
uidCounter += 1;
const uid = 'permissionValue_' + uidCounter.toString();
const uid = `permissionValue_${uidCounter.toString()}`;
tableRowElement.innerHTML = `<td class="is-vcentered">
<label for="${uid}">
${permissionKey}
Expand Down
2 changes: 1 addition & 1 deletion public-typescript/admin.users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ declare const cityssm: cityssmGlobal
}

uidCounter += 1
const uid = 'permissionValue_' + uidCounter.toString()
const uid = `permissionValue_${uidCounter.toString()}`

tableRowElement.innerHTML = `<td class="is-vcentered">
<label for="${uid}">
Expand Down
8 changes: 4 additions & 4 deletions public-typescript/main.callOuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
function openCallOutList(listId, onUpdateCallbackFunction) {
currentListId = listId;
currentCallOutListMembers = [];
let callOutListMemberEmployeeNumbers = [];
let availableEmployees = [];
let callOutListCloseModalFunction;
const callOutList = getCurrentCallOutList();
let callOutListModalElement;
Expand Down Expand Up @@ -358,8 +360,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
}
let callOutListMemberEmployeeNumbers = [];
let availableEmployees = [];
function addCallOutListMember(clickEvent) {
clickEvent.preventDefault();
const employeeNumber = clickEvent.currentTarget
Expand Down Expand Up @@ -533,7 +533,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
panelBlockElement.addEventListener('click', openCallOutListMemberByClick);
panelElement.append(panelBlockElement);
// Current Members (Management)
if (!canManage) {
if (!canManage || currentPanelElement === undefined) {
continue;
}
// Track employee number
Expand All @@ -553,7 +553,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
callOutListMembersContainer.innerHTML = '';
callOutListMembersContainer.append(panelElement);
if (canManage) {
if (canManage && currentPanelElement !== undefined) {
callOutListCurrentMembersContainer.innerHTML = '';
callOutListCurrentMembersContainer.append(currentPanelElement);
}
Expand Down
18 changes: 9 additions & 9 deletions public-typescript/main.callOuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ declare const cityssm: cityssmGlobal
currentListId = listId
currentCallOutListMembers = []

let callOutListMemberEmployeeNumbers: string[] = []
let availableEmployees: Employee[] = []

let callOutListCloseModalFunction: () => void

const callOutList = getCurrentCallOutList()
Expand Down Expand Up @@ -647,9 +650,6 @@ declare const cityssm: cityssmGlobal
}
}

let callOutListMemberEmployeeNumbers: string[] = []
let availableEmployees: Employee[] = []

function addCallOutListMember(clickEvent: MouseEvent): void {
clickEvent.preventDefault()

Expand Down Expand Up @@ -852,7 +852,7 @@ declare const cityssm: cityssmGlobal
const panelElement = document.createElement('div')
panelElement.className = 'panel'

let currentPanelElement: HTMLElement
let currentPanelElement: HTMLElement | undefined

if (canManage) {
currentPanelElement = document.createElement('div')
Expand Down Expand Up @@ -888,7 +888,7 @@ declare const cityssm: cityssmGlobal
<i class="fas fa-phone-volume" aria-hidden="true"></i> ${
member.callOutDateTimeMax === null
? '(No Recent Call Out)'
: new Date(member.callOutDateTimeMax!).toLocaleDateString()
: new Date(member.callOutDateTimeMax as string).toLocaleDateString()
}
</span>
</div>
Expand All @@ -903,7 +903,7 @@ declare const cityssm: cityssmGlobal

// Current Members (Management)

if (!canManage) {
if (!canManage || currentPanelElement === undefined) {
continue
}

Expand All @@ -927,15 +927,15 @@ declare const cityssm: cityssmGlobal
deleteCallOutListMember
)

currentPanelElement!.append(currentPanelBlockElement)
currentPanelElement.append(currentPanelBlockElement)
}

callOutListMembersContainer.innerHTML = ''
callOutListMembersContainer.append(panelElement)

if (canManage) {
if (canManage && currentPanelElement !== undefined) {
callOutListCurrentMembersContainer.innerHTML = ''
callOutListCurrentMembersContainer.append(currentPanelElement!)
callOutListCurrentMembersContainer.append(currentPanelElement)
}
}

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/admin.users.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d126414

Please sign in to comment.