Skip to content

Commit

Permalink
Delete non-realtime staff attendance support from employee-mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
akheron committed Dec 16, 2024
1 parent 246b1a6 commit 3f1b53b
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 998 deletions.
85 changes: 0 additions & 85 deletions frontend/src/e2e-test/pages/mobile/staff-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,91 +20,6 @@ import {
TextInput
} from '../../utils/page'

export default class StaffPage {
#staffCount: Element
#staffOtherCount: Element
#cancelButton: Element
#confirmButton: Element
#occupancyRealized: Element
#updated: Element
constructor(readonly page: Page) {
this.#staffCount = page.findByDataQa('staff-count')
this.#staffOtherCount = page.findByDataQa('staff-other-count')
this.#cancelButton = page.findByDataQa('cancel-button')
this.#confirmButton = page.findByDataQa('confirm-button')
this.#occupancyRealized = page.findByDataQa('realized-occupancy')
this.#updated = page.findByDataQa('updated')
}

private countButton(parent: Element, which: 'plus' | 'minus') {
return parent.find(`[data-qa="${which}-button"]`)
}

get staffCount() {
return this.#staffCount.find('[data-qa="value"]').text
}

get staffOtherCount() {
return this.#staffOtherCount.find('[data-qa="value"]').text
}

async incDecButtonsVisible(): Promise<boolean[]> {
return Promise.all(
[this.#staffCount, this.#staffOtherCount]
.map((parent) =>
(['plus', 'minus'] as const).map((which) =>
this.countButton(parent, which)
)
)
.flat()
.map((el) => el.visible)
)
}

async incStaffCount() {
return this.countButton(this.#staffCount, 'plus').click()
}

async decStaffCount() {
return this.countButton(this.#staffCount, 'minus').click()
}

async incStaffOtherCount() {
return this.countButton(this.#staffOtherCount, 'plus').click()
}

async decStaffOtherCount() {
return this.countButton(this.#staffOtherCount, 'minus').click()
}

async cancel() {
return this.#cancelButton.click()
}

async confirm() {
return this.#confirmButton.click()
}

get buttonsDisabled() {
return Promise.all([
this.#cancelButton.disabled,
this.#confirmButton.disabled
]).then(([cancel, confirm]) => cancel && confirm)
}

get buttonsEnabled() {
return this.buttonsDisabled.then((disabled) => !disabled)
}

get updated() {
return this.#updated.text
}

get occupancy() {
return this.#occupancyRealized.text
}
}

export class StaffAttendancePage {
editButton: Element
previousAttendancesButton: Element
Expand Down
126 changes: 0 additions & 126 deletions frontend/src/e2e-test/specs/6_mobile/staff.spec.ts

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/src/employee-mobile-frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import PairingWizard from './pairing/PairingWizard'
import { queryClient, QueryClientProvider } from './query'
import { RememberContext, RememberContextProvider } from './remember'
import { SettingsPage } from './settings/SettingsPage'
import StaffPage from './staff/StaffPage'
import ExternalStaffMemberPage from './staff-attendance/ExternalStaffMemberPage'
import MarkExternalStaffMemberArrivalPage from './staff-attendance/MarkExternalStaffMemberArrivalPage'
import StaffAttendanceEditPage from './staff-attendance/StaffAttendanceEditPage'
Expand Down Expand Up @@ -212,10 +211,6 @@ function GroupRouter({ unitId }: { unitId: DaycareId }) {
path="child-attendance/*"
element={<ChildAttendanceRouter unitOrGroup={unitOrGroup} />}
/>
<Route
path="staff/*"
element={<StaffRouter unitOrGroup={unitOrGroup} />}
/>
<Route
path="staff-attendance/*"
element={<StaffAttendanceRouter unitOrGroup={unitOrGroup} />}
Expand Down Expand Up @@ -305,14 +300,6 @@ function ChildRouter({ unitId }: { unitId: DaycareId }) {
)
}

function StaffRouter({ unitOrGroup }: { unitOrGroup: UnitOrGroup }) {
return (
<Routes>
<Route index element={<StaffPage unitOrGroup={unitOrGroup} />} />
</Routes>
)
}

function StaffAttendanceRouter({ unitOrGroup }: { unitOrGroup: UnitOrGroup }) {
return (
<Routes>
Expand Down Expand Up @@ -449,9 +436,6 @@ export const routes = {
childSensitiveInfo(unitId: UUID, child: UUID): Uri {
return uri`${this.child(unitId, child)}/info`
},
staff(unitOrGroup: UnitOrGroup): Uri {
return uri`${this.unitOrGroup(unitOrGroup)}/staff`
},
staffAttendanceRoot(unitOrGroup: UnitOrGroup): Uri {
return uri`${this.unitOrGroup(unitOrGroup)}/staff-attendance`
},
Expand Down
35 changes: 16 additions & 19 deletions frontend/src/employee-mobile-frontend/common/BottomNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,23 @@ export default function BottomNavbar({
/>
</BottomText>
</Button>
<Button data-qa="bottomnav-staff">
<BottomText
text={i18n.common.staff}
selected={selected === 'staff'}
onClick={() =>
selected !== 'staff' &&
navigate(
(unit.features.includes('REALTIME_STAFF_ATTENDANCE')
? routes.staffAttendances(unitOrGroup, 'absent')
: routes.staff(unitOrGroup)
).value
)
}
>
<CustomIcon
icon={selected === 'staff' ? fasUser : faUser}
{unit.features.includes('REALTIME_STAFF_ATTENDANCE') ? (
<Button data-qa="bottomnav-staff">
<BottomText
text={i18n.common.staff}
selected={selected === 'staff'}
/>
</BottomText>
</Button>
onClick={() =>
selected !== 'staff' &&
navigate(routes.staffAttendances(unitOrGroup, 'absent').value)
}
>
<CustomIcon
icon={selected === 'staff' ? fasUser : faUser}
selected={selected === 'staff'}
/>
</BottomText>
</Button>
) : null}
{unit.features.includes('MOBILE_MESSAGING') ? (
<Button data-qa="bottomnav-messages">
<BottomText
Expand Down

This file was deleted.

Loading

0 comments on commit 3f1b53b

Please sign in to comment.