Skip to content

Commit

Permalink
Merge pull request #855 from culturecreates/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sahalali authored Dec 11, 2023
2 parents 52e1dd4 + 2e58f4e commit 98df1be
Show file tree
Hide file tree
Showing 24 changed files with 655 additions and 198 deletions.
12 changes: 11 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,17 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Footlight Calendar</title>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA34hPcJ7CKANXj1ZPcEMX5d89563wexsw&libraries=places"></script>
<script>
window.myCallbackFunc = function () {
window.initOne && window.initOne();
window.initTwo && window.initTwo();
};
</script>
<script
async
defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA34hPcJ7CKANXj1ZPcEMX5d89563wexsw&libraries=places&callback=myCallbackFunc"
></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
14 changes: 14 additions & 0 deletions src/components/DatePicker/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ import frLocale from 'antd/es/date-picker/locale/fr_CA';
import enLocale from 'antd/es/date-picker/locale/en_US';

function DatePickerStyled(props) {
const handleDateChange = (value) => {
if (value && value.isValid()) {
datePickerRef.current.blur();
}
if (props.onChange) {
props.onChange(value);
}
};

const datePickerRef = React.createRef();

return (
<DatePicker
ref={datePickerRef}
format="DD/MM/YYYY"
size="large"
locale={i18n?.language === 'en' ? enLocale : i18n?.language === 'fr' && frLocale}
className="date-picker-wrapper"
{...props}
changeOnBlur={true}
placeholder={i18n?.language === 'en' ? 'DD/MM/YYYY' : 'JJ/MM/AAAA'}
showToday={false}
popupClassName="date-picker-calendar"
getPopupContainer={(trigger) => trigger.parentNode}
onChange={handleDateChange}
/>
);
}
Expand Down
4 changes: 0 additions & 4 deletions src/components/DatePicker/datePicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
border-radius: 4px;
}

.date-picker-calendar .ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before {
border: 0px;
}

.date-picker-calendar .ant-picker-header {
border-bottom: 1px solid #b6c1c9;
}
Expand Down
20 changes: 18 additions & 2 deletions src/components/DraggableTree/DraggableTree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,15 @@ const DraggableTree = ({
onChange={(e) => {
setNewConceptName({ ...newConceptName, fr: e.target.value });
}}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '423px' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '423px',
}}
size="large"
/>
</Form.Item>
Expand All @@ -486,7 +494,15 @@ const DraggableTree = ({
setNewConceptName({ ...newConceptName, en: e.target.value });
}}
placeholder={t('dashboard.taxonomy.addNew.concepts.placeHolderEn')}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '423px' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '423px',
}}
size="large"
/>
</Form.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import NoContent from '../../NoContent/NoContent';
import LoadingIndicator from '../../LoadingIndicator';

function SearchableCheckbox(props) {
const { children, allowSearch, data, onFilterChange, open, value, loading = false } = props;
const { children, allowSearch, data, onFilterChange, open, value, loading = false, selectedData, setOpen } = props;
const { t } = useTranslation();
let items = data ?? [];

useEffect(() => {
if (allowSearch) {
props.searchImplementation();
if (allowSearch && props?.searchKey != undefined) {
props.searchImplementation(props?.searchKey, selectedData);
}
}, [props.searchKey]);

Expand All @@ -28,6 +28,7 @@ function SearchableCheckbox(props) {
multiple: true,
}}
open={open}
onOpenChange={(open) => setOpen(open)}
trigger={['click']}
dropdownRender={() => (
<div className="searchable-checkbox-dropdown-wrapper">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,15 @@ function QuickCreateOrganization(props) {
placeholder={t(
'dashboard.events.addEditEvent.quickCreate.quickCreateOrganization.namePlaceholder',
)}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="input-quick-create-organization-name-french"
/>
Expand Down Expand Up @@ -376,7 +384,15 @@ function QuickCreateOrganization(props) {
placeholder={t(
'dashboard.events.addEditEvent.quickCreate.quickCreateOrganization.namePlaceholder',
)}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="input-quick-create-organization-name-english"
/>
Expand All @@ -394,7 +410,7 @@ function QuickCreateOrganization(props) {
]}
data-cy="form-item-quick-create-organizer-website-label">
<StyledInput
addonBefore="https://"
addonBefore="URL"
autoComplete="off"
placeholder={t(
'dashboard.events.addEditEvent.quickCreate.quickCreateOrganization.websitePlaceholder',
Expand Down
22 changes: 19 additions & 3 deletions src/components/Modal/QuickCreatePerson/QuickCreatePerson.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,15 @@ function QuickCreatePerson(props) {
autoSize
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.quickCreate.quickCreatePerson.namePlaceholder')}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="input-quick-create-person-name-french"
/>
Expand Down Expand Up @@ -338,7 +346,15 @@ function QuickCreatePerson(props) {
autoSize
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.quickCreate.quickCreatePerson.namePlaceholder')}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="input-quick-create-person-name-english"
/>
Expand Down Expand Up @@ -394,7 +410,7 @@ function QuickCreatePerson(props) {
]}
data-cy="form-item-quick-create-person-website-label">
<StyledInput
addonBefore="https://"
addonBefore="URL"
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.quickCreate.quickCreatePerson.websitePlaceholder')}
data-cy="input-quick-create-person-website"
Expand Down
27 changes: 24 additions & 3 deletions src/components/Modal/QuickCreatePlace/QuickCreatePlace.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,15 @@ function QuickCreatePlace(props) {
autoSize
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.location.quickCreatePlace.namePlaceholder')}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="text-area-quick-create-place-name-french"
/>
Expand Down Expand Up @@ -409,7 +417,15 @@ function QuickCreatePlace(props) {
autoSize
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.location.quickCreatePlace.namePlaceholder')}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '100%' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL
? '4px solid #E8E8E8'
: '1px solid #b6c1c9'
}`,
width: '100%',
}}
size="large"
data-cy="text-area-quick-create-place-name-english"
/>
Expand All @@ -427,7 +443,12 @@ function QuickCreatePlace(props) {
]}
required
data-cy="form-item-quick-create-place-address-label">
<PlacesAutocomplete value={address} onChange={handleChange} onSelect={handleSelect}>
<PlacesAutocomplete
searchOptions={{ componentRestrictions: { country: 'CA' } }}
value={address}
onChange={handleChange}
onSelect={handleSelect}
googleCallbackName="initOne">
{({ getInputProps, suggestions, getSuggestionItemProps }) => (
<Dropdown
open={dropdownOpen}
Expand Down
12 changes: 10 additions & 2 deletions src/components/Search/Events/EventsSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import React from 'react';
import React, { useEffect, useRef } from 'react';
import './eventsSearch.css';
import { Input } from 'antd';
import { SearchOutlined } from '@ant-design/icons';

function EventsSearch(props) {
function EventsSearch({ autoFocus, ...props }) {
const inputRef = useRef();
useEffect(() => {
if (autoFocus) {
inputRef.current.focus();
}
}, []);

return (
<Input
{...props}
ref={inputRef}
className="events-search"
bordered={true}
prefix={<SearchOutlined className="events-search-icon" style={{ color: props?.defaultValue && '#1B3DE6' }} />}
Expand Down
5 changes: 5 additions & 0 deletions src/components/TextEditor/TextEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ function TextEditor(props) {
placeholder={placeholder}
className="text-editor"
modules={modules}
style={{
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL ? '4px solid #E8E8E8' : '1px solid #b6c1c9'
}`,
}}
preserveWhitespace
onChange={onChange}
data-cy="text-editor"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Username/username.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.event-list-status-userdetail {
text-decoration: underline;
/* text-decoration: underline; */
font-weight: 600;
text-transform: lowercase;
}
28 changes: 23 additions & 5 deletions src/constants/formFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ export const formFieldValue = [
autoSize
autoComplete="off"
placeholder={placeholder?.fr}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '423px' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL ? '4px solid #E8E8E8' : '1px solid #b6c1c9'
}`,
width: '423px',
}}
size="large"
data-cy={`input-text-area-${mappedField}-french`}
/>
Expand Down Expand Up @@ -148,7 +154,13 @@ export const formFieldValue = [
autoSize
autoComplete="off"
placeholder={placeholder?.en}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '423px' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL ? '4px solid #E8E8E8' : '1px solid #b6c1c9'
}`,
width: '423px',
}}
size="large"
data-cy={`input-text-area-${mappedField}-english`}
/>
Expand All @@ -159,7 +171,7 @@ export const formFieldValue = [
else if (datatype === dataTypes.URI_STRING)
return (
<StyledInput
addonBefore="https://"
addonBefore="URL"
autoComplete="off"
style={{ width: '423px' }}
placeholder={t('dashboard.events.addEditEvent.otherInformation.contact.placeHolderWebsite')}
Expand Down Expand Up @@ -198,7 +210,7 @@ export const formFieldValue = [
},
]}>
<StyledInput
addonBefore="https://"
addonBefore="URL"
autoComplete="off"
placeholder={t('dashboard.events.addEditEvent.otherInformation.contact.placeHolderWebsite')}
data-cy={`input-${mappedField}-${field.key}`}
Expand Down Expand Up @@ -255,7 +267,13 @@ export const formFieldValue = [
interfaceLanguage: user?.interfaceLanguage?.toLowerCase(),
calendarContentLanguage: calendarContentLanguage,
})}
style={{ borderRadius: '4px', border: '4px solid #E8E8E8', width: '423px' }}
style={{
borderRadius: '4px',
border: `${
calendarContentLanguage === contentLanguage.BILINGUAL ? '4px solid #E8E8E8' : '1px solid #b6c1c9'
}`,
width: '423px',
}}
size="large"
data-cy={`input-text-area-${mappedField}`}
/>
Expand Down
12 changes: 6 additions & 6 deletions src/constants/standardFieldsTranslations.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { Translation } from 'react-i18next';

export const PLACE = [
{
label: <Translation>{(t) => t('dashboard.taxonomy.standardFields.place.inLanguage')}</Translation>,
key: 'inLanguage',
en: 'Language of event',
fr: "Langue de l'événement",
},
{
label: <Translation>{(t) => t('dashboard.taxonomy.standardFields.place.PlaceAccessibility')}</Translation>,
key: 'PlaceAccessibility',
Expand Down Expand Up @@ -46,6 +40,12 @@ export const EVENT = [
en: 'Event type',
fr: "Type d'événement",
},
{
label: <Translation>{(t) => t('dashboard.taxonomy.standardFields.place.inLanguage')}</Translation>,
key: 'inLanguage',
en: 'Language of event',
fr: "Langue de l'événement",
},
// {
// label: <Translation>{(t) => t('dashboard.taxonomy.standardFields.Event.PerformerRole')}</Translation>,
// key: 'PerformerRole',
Expand Down
Loading

0 comments on commit 98df1be

Please sign in to comment.