Skip to content

Commit

Permalink
Merge branch 'main' into MET-task#2106
Browse files Browse the repository at this point in the history
  • Loading branch information
jadmsaadaot committed Sep 13, 2023
2 parents 29b7ec8 + 2b89a3d commit 33e1b58
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion met-api/src/met_api/models/staff_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class StaffUser(BaseModel):
email_address = Column(db.String(100), nullable=True)
contact_number = Column(db.String(50), nullable=True)
external_id = Column(db.String(50), nullable=False, unique=True)
status_id = db.Column(db.Integer, ForeignKey('user_status.id'), nullable=False, server_default='1')
status_id = db.Column(db.Integer, ForeignKey('user_status.id'), nullable=False, default=1)
tenant_id = db.Column(db.Integer, db.ForeignKey('tenant.id'), nullable=True)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion met-api/src/met_api/utils/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def local_datetime():
"""Get the local (Pacific Timezone) datetime."""
utcmoment = datetime.utcnow().replace(tzinfo=pytz.utc)
now = utcmoment.astimezone(pytz.timezone('America/Vancouver'))
now = utcmoment.astimezone(pytz.timezone('US/Pacific'))
return now


Expand Down
4 changes: 4 additions & 0 deletions met-web/src/components/Form/formio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -644,3 +644,7 @@ div[disabled] {
overflow-y: auto !important;
max-height: 200px !important;
}

.choices__list--dropdown .choices__list {
overflow: visible;
}
17 changes: 17 additions & 0 deletions met-web/src/components/FormioModalListener/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

const FormioModalListener = () => {
const { pathname } = useLocation();

useEffect(() => {
const formioModal = document.querySelector('.formio-dialog');
if (formioModal) {
formioModal.remove();
}
}, [pathname]);

return null;
};

export default FormioModalListener;
2 changes: 1 addition & 1 deletion met-web/src/components/common/dateHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const formatToUTCTimeZone = (date: string, fmt: string) => dayjs(date).utc().for

export const formatDate = (date: Dayjs | string, formatString = 'YYYY-MM-DD') => {
if (date) {
return formatToPacificTimeZone(date.toString(), formatString, 'America/Los_Angeles');
return formatToPacificTimeZone(date.toString(), formatString, 'US/Pacific');
} else {
return '';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const InPersonEventFormDrawer = () => {
} = useContext(EventsContext);
const [isCreating, setIsCreating] = useState(false);
const eventItemToEdit = eventToEdit ? eventToEdit.event_items[0] : null;
const startDate = dayjs(eventItemToEdit ? eventItemToEdit?.start_date : '').tz('America/Vancouver');
const endDate = dayjs(eventItemToEdit ? eventItemToEdit?.end_date : '').tz('America/Vancouver');
const startDate = dayjs(eventItemToEdit ? eventItemToEdit?.start_date : '').tz('US/Pacific');
const endDate = dayjs(eventItemToEdit ? eventItemToEdit?.end_date : '').tz('US/Pacific');
const methods = useForm<InPersonEventForm>({
resolver: yupResolver(schema),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const VirtualSessionFormDrawer = () => {
} = useContext(EventsContext);
const [isCreating, setIsCreating] = useState(false);
const eventItemToEdit = eventToEdit ? eventToEdit.event_items[0] : null;
const startDate = dayjs(eventItemToEdit ? eventItemToEdit?.start_date : '').tz('America/Vancouver');
const endDate = dayjs(eventItemToEdit ? eventItemToEdit?.end_date : '').tz('America/Vancouver');
const startDate = dayjs(eventItemToEdit ? eventItemToEdit?.start_date : '').tz('US/Pacific');
const endDate = dayjs(eventItemToEdit ? eventItemToEdit?.end_date : '').tz('US/Pacific');
const methods = useForm<VirtualSessionForm>({
resolver: yupResolver(schema),
});
Expand Down
2 changes: 2 additions & 0 deletions met-web/src/routes/AuthenticatedRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ import { USER_ROLES } from 'services/userService/constants';
import UserProfile from 'components/userManagement/userDetails';
import ScrollToTop from 'components/scrollToTop';
import ReportSettings from 'components/survey/report';
import FormioModalListener from 'components/FormioModalListener';

const AuthenticatedRoutes = () => {
return (
<>
<ScrollToTop />
<FormioModalListener />
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/engagements" element={<EngagementListing />} />
Expand Down

0 comments on commit 33e1b58

Please sign in to comment.