Skip to content

Commit

Permalink
Merge branch 'develop' into fix-trainee-single-page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismaelmurekezi authored Oct 13, 2024
2 parents 930911d + af249ad commit 14173fd
Show file tree
Hide file tree
Showing 104 changed files with 23,022 additions and 18,200 deletions.
Binary file modified .DS_Store
Binary file not shown.
38 changes: 19 additions & 19 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ checks:
file-lines:
enabled: true
config:
threshold: 250
threshold: 25000
method-complexity:
enabled: true
config:
threshold: 5
threshold: 50
method-count:
enabled: true
config:
threshold: 20
method-lines:
enabled: true
config:
threshold: 90
threshold: 900
nested-control-flow:
enabled: true
config:
Expand All @@ -41,20 +41,20 @@ checks:
config:
threshold: #language-specific defaults. overrides affect all languages.
plugins:
rubocop:
enabled: true
eslint:
enabled: false
channel: eslint-8
rubocop:
enabled: true
eslint:
enabled: false
channel: eslint-8
exclude_patterns:
- "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "**/vendor/"
- "**/*.d.ts"
- "config/"
- "db/"
- "dist/"
- "features/"
- "**/node_modules/"
- "script/"
- "**/spec/"
- "**/test/"
- "**/tests/"
- "**/vendor/"
- "**/*.d.ts"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coverage
dist
buildcoverage
package-lock.json
yarn.lock
.DS_Store
build/
yarn.lock
yarn.lock
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^3.3.0",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^5.10.11",
"@mui/x-date-pickers": "^5.0.6",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -86,6 +87,7 @@
"@types/react-i18next": "^8.1.0",
"@types/react-router": "^5.1.19",
"@types/react-router-dom": "^5.3.3",
"antd": "^5.21.2",
"axios": "^1.1.2",
"bootstrap": "^5.2.2",
"browser": "^0.2.6",
Expand Down Expand Up @@ -119,6 +121,8 @@
"react-i18next": "^11.18.6",
"react-icons": "^4.6.0",
"react-js-pagination": "^3.0.3",
"react-loader-spinner": "^6.1.6",
"react-modal": "^3.16.1",
"react-paginate": "^8.1.3",
"react-redux": "^8.0.4",
"react-render-html": "^0.6.0",
Expand All @@ -127,6 +131,7 @@
"react-select": "^5.7.4",
"react-table": "^7.8.0",
"react-toastify": "^9.0.8",
"recharts": "^2.12.7",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
"redux-state-sync": "^3.1.4",
Expand Down
Binary file modified src/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/Group (1).svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/Group.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/material-symbols_manage-accounts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/GoogleForm/ApplicationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const ApplicationForm = () => {
};

return (
<div>
<div className='flex justify-center'>
<div className='flex px-5 py-2 w-fit'>
<div className='flex justify-center'>
<div className='flex justify-between w-[62%]'>
<div className='flex py-4 w-fit'>
<button
onClick={() =>
window.open('https://docs.google.com/forms/u/0/', '_blank')
Expand Down
62 changes: 62 additions & 0 deletions src/components/GoogleForm/DeleteConfirmationModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react';
import { AiOutlineExclamation } from 'react-icons/ai'; // Ensure you have the correct import for icons

interface DeleteConfirmationModalProps {
isOpen: boolean;
onClose: () => void;
onDelete: () => void;
}

const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = ({
isOpen,
onClose,
onDelete,
}) => {
if (!isOpen) return null; // Render nothing if modal is not open

return (
<div>
<div className='fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75' />
<div className='fixed inset-0 z-10 overflow-y-auto'>
<div className='flex items-end justify-center min-h-full p-4 text-center sm:items-center sm:p-0'>
<div className='relative overflow-hidden text-left transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:w-full sm:max-w-lg'>
<div className='px-4 pt-5 pb-4 bg-white sm:p-6 sm:pb-4'>
<div className='sm:flex sm:items-start'>
<div className='flex items-center justify-center flex-shrink-0 w-12 h-12 mx-auto bg-red-100 rounded-full sm:mx-0 sm:h-10 sm:w-10'>
<AiOutlineExclamation className='w-6 h-6 text-red-600' />
</div>
<div className='mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left'>
<div className='text-lg font-medium leading-6 text-gray-900'>
Delete the Form
</div>
<div className='mt-2'>
<p className='text-sm text-gray-500'>
Are you sure you want to delete this item? All of the
form data will be permanently removed. This action cannot be undone.
</p>
</div>
</div>
</div>
</div>
<div className='px-4 py-3 bg-gray-50 sm:flex sm:flex-row-reverse sm:px-6'>
<button
type='button'
className='inline-flex justify-center w-full px-4 py-2 text-base font-medium text-white bg-red-600 border border-transparent rounded-md shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm'
onClick={onDelete}>
Delete
</button>
<button
type='button'
className='inline-flex justify-center w-full px-4 py-2 mt-3 text-base font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm'
onClick={onClose}>
Cancel
</button>
</div>
</div>
</div>
</div>
</div>
);
};

export default DeleteConfirmationModal;
47 changes: 47 additions & 0 deletions src/components/GoogleForm/InputField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
interface InputFieldProps {
id: string;
name: string;
label: string;
type?: string;
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
error?: string;
touched?: boolean;
classname?: string
}

const InputField = ({
id,
name,
label,
type = 'text',
value,
onChange,
onBlur,
error,
touched,
classname
}: InputFieldProps) => (
<div className={`${classname} g-red-200 sm:col-span-1`}>
<label className='block text-sm font-medium text-primary dark:text-secondary' htmlFor={id}>
{label}
</label>
<div className='mt-1'>
<input
autoComplete={name}
className={`block w-full dark:text-white dark:bg-dark-tertiary rounded-md border-gray-300 py-2 px-4 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 ${touched && error ? 'border-red-500' : ''
}`}
id={id}
name={name}
onChange={onChange}
onBlur={onBlur}
type={type}
value={value}
/>
{touched && error && <div className='text-red-500'>{error}</div>}
</div>
</div>
);

export default InputField;
Loading

0 comments on commit 14173fd

Please sign in to comment.