Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Version 0.3.4 #375

Merged
merged 9 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules\\typescript\\lib"
}
2 changes: 2 additions & 0 deletions components/admin/requests/payment-information/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export default function PaymentDetailsForm({ paymentInformation }: PaymentDetail
name="paymentInformation.paymentMethod"
label="Payment method"
required
// Set default value to the payment method if paymentMethod is set in the form data
defaultValue={paymentInformation.paymentMethod || undefined}
>
<Stack>
<Radio value={'AMEX' as PaymentType}>{'American Express'}</Radio>
Expand Down
1 change: 1 addition & 0 deletions components/admin/requests/reason-for-replacement/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default function ReasonForReplacementForm({
value={'MAIL_LOST'}
onChange={() => {
setFieldValue('paymentInformation.processingFee', '0');
setFieldValue('paymentInformation.paymentMethod', 'CASH');
}}
>
{'Mail Lost'}
Expand Down
4 changes: 2 additions & 2 deletions components/applicant/FAQs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const OVERVIEW_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | strin
event that you find the lost permit you will return it to our office as the permit is no
longer valid. Any permit holder using a permit that has been reported lost is at risk of a
ticket or even towing of vehicle as this permit is no longer valid.{' '}
<NewTabLink href="https://www.rcdrichmond.org/Parking/PermitReplacementDeclarationForm_2022%20v.pdf">
<NewTabLink href="https://www.rcdrichmond.org/Parking/Permit_Replacement_Declaration_Form_Fillable_2024v.pdf">
Click here
</NewTabLink>{' '}
to download the Replacement Declaration Form.
Expand All @@ -220,7 +220,7 @@ const OVERVIEW_FAQs: ReadonlyArray<{ question: string; answer: ReactNode | strin
<p>
The police will also give you an incident or case number to include with your request for
a Replacement Permit.{' '}
<NewTabLink href="https://www.rcdrichmond.org/Parking/PermitReplacementDeclarationForm_2022%20v.pdf">
<NewTabLink href="https://www.rcdrichmond.org/Parking/Permit_Replacement_Declaration_Form_Fillable_2024v.pdf">
Click here
</NewTabLink>{' '}
to download the Replacement Declaration Form.
Expand Down
18 changes: 1 addition & 17 deletions pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
Wrap,
Tooltip,
HStack,
useDisclosure,
} from '@chakra-ui/react'; // Chakra UI
import { ChevronDownIcon, SearchIcon, AddIcon } from '@chakra-ui/icons'; // Chakra UI Icons
import Layout from '@components/admin/Layout'; // Layout component
Expand All @@ -43,7 +42,6 @@ import useDebounce from '@tools/hooks/useDebounce'; // Debounce hook
import { Column } from 'react-table';
import { formatFullName } from '@lib/utils/format'; // String formatter util
import { formatDateYYYYMMDDLocal } from '@lib/utils/date'; // Date Formatter Util
import GenerateReportModal from '@components/admin/requests/reports/GenerateModal'; // Generate report modal
import EmptyMessage from '@components/EmptyMessage';

// Placeholder columns
Expand All @@ -60,7 +58,7 @@ const COLUMNS: Column<ApplicationRow>[] = [
maxWidth="280"
whiteSpace="nowrap"
textOverflow="ellipsis"
overflow="hidden"
overflow="clip visible"
mb="4px"
>
{name}
Expand Down Expand Up @@ -129,13 +127,6 @@ const Requests: NextPage = () => {
// Router
const router = useRouter();

//Generate report modal
const {
isOpen: isGenerateReportModalOpen,
onOpen: onOpenGenerateReportModal,
onClose: onCloseGenerateReportModal,
} = useDisclosure();

// Filters
const [statusFilter, setStatusFilter] = useState<ApplicationStatus | null>('PENDING');
const [permitTypeFilter, setPermitTypeFilter] = useState<PermitType | null>(null);
Expand Down Expand Up @@ -212,9 +203,6 @@ const Requests: NextPage = () => {
<Flex justifyContent="space-between" alignItems="center" marginBottom="32px">
<Text textStyle="display-xlarge">Requests</Text>
<HStack spacing="12px">
<Button height="48px" variant="outline" onClick={onOpenGenerateReportModal}>
Generate a Report
</Button>
<Menu>
<MenuButton
as={Button}
Expand Down Expand Up @@ -417,10 +405,6 @@ const Requests: NextPage = () => {
</Box>
</Box>
</GridItem>
<GenerateReportModal
isOpen={isGenerateReportModalOpen}
onClose={onCloseGenerateReportModal}
/>
</Layout>
);
};
Expand Down
2 changes: 1 addition & 1 deletion pages/admin/permit-holders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const PermitHolders: NextPage = () => {
maxWidth="180"
whiteSpace="nowrap"
textOverflow="ellipsis"
overflow="hidden"
overflow="clip visible"
mb="4px"
>
{name}
Expand Down
27 changes: 26 additions & 1 deletion pages/admin/reports.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { GetServerSideProps } from 'next'; // Get server side props
import { getSession } from 'next-auth/client'; // Session management
import { Text, GridItem, Box, Flex, Input, Button, Spinner, useToast } from '@chakra-ui/react'; // Chakra UI
import {
Text,
GridItem,
Box,
Flex,
Input,
Button,
Spinner,
useToast,
useDisclosure,
} from '@chakra-ui/react'; // Chakra UI
import Layout from '@components/admin/Layout'; // Layout component
import { authorize } from '@tools/authorization'; // Page authorization
import { DownloadIcon } from '@chakra-ui/icons'; // Chakra UI icons
Expand All @@ -12,9 +22,16 @@ import {
GenerateAccountantReportResponse,
} from '@tools/admin/permit-holders/graphql/generate-report';
import EmptyMessage from '@components/EmptyMessage';
import GenerateReportModal from '@components/admin/requests/reports/GenerateModal'; // Generate report modal

// Internal home page
export default function Reports() {
//Generate report modal
const {
isOpen: isGenerateReportModalOpen,
onOpen: onOpenGenerateReportModal,
onClose: onCloseGenerateReportModal,
} = useDisclosure();
// const { dateRange, addDayToDateRange, dateRangeString } = useDateRangePicker();
const [startDate, setStartDate] = useState('');
const [endDate, setEndDate] = useState('');
Expand All @@ -25,6 +42,7 @@ export default function Reports() {
GenerateAccountantReportResponse,
GenerateAccountantReportRequest
>(GENERATE_ACCOUNTANT_REPORT_QUERY, {
fetchPolicy: 'network-only',
onCompleted: data => {
if (data.generateAccountantReport.ok && !!data.generateAccountantReport.url) {
const link = document.createElement('a');
Expand Down Expand Up @@ -61,6 +79,9 @@ export default function Reports() {
<GridItem colSpan={12}>
<Flex justifyContent="space-between" alignItems="center" marginBottom="32px">
<Text textStyle="display-xlarge">Accountant Reports</Text>
<Button height="48px" variant="outline" onClick={onOpenGenerateReportModal}>
Generate a Report
</Button>
</Flex>
<Box
border="1px solid"
Expand Down Expand Up @@ -139,6 +160,10 @@ export default function Reports() {
</Box>
</Box>
</GridItem>
<GenerateReportModal
isOpen={isGenerateReportModalOpen}
onClose={onCloseGenerateReportModal}
/>
</Layout>
);
}
Expand Down
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function Landing() {
</Box>
<VStack width="100%" alignItems={{ sm: 'center', lg: 'flex-start' }} spacing="32px">
<a
href="https://www.rcdrichmond.org/Parking/Parking_Permit_Application_Form_Fillable_2023v.pdf"
href="https://www.rcdrichmond.org/Parking/Parking_Permit_Application_Form_Fillable_2024v.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -146,7 +146,7 @@ export default function Landing() {
</Button>
</a>
<a
href="https://www.rcdrichmond.org/Parking/Permit_Replacement_Declaration_Form_Fillable_2023v.pdf"
href="https://www.rcdrichmond.org/Parking/Permit_Replacement_Declaration_Form_Fillable_2024v.pdf"
target="_blank"
rel="noopener noreferrer"
>
Expand Down
15 changes: 15 additions & 0 deletions prisma/dev-seed-utils/employees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ const employees = [
lastName: 'Chigbo',
email: '[email protected]',
},
{
firstName: 'Bowen',
lastName: 'Zhu',
email: '[email protected]',
},
{
firstName: 'Adil',
lastName: 'Kapadia',
Expand All @@ -94,6 +99,16 @@ const employees = [
lastName: 'Sreekaran',
email: '[email protected]',
},
{
firstName: 'Jenny',
lastName: 'Vong',
email: '[email protected]',
},
{
firstName: 'Jennifer',
lastName: 'Chen',
email: '[email protected]',
},
];

/**
Expand Down
Loading