diff --git a/frontend/app/components/shared/Filters/FilterItem/FilterItem.tsx b/frontend/app/components/shared/Filters/FilterItem/FilterItem.tsx index 95cac0b9a..d848ffa58 100644 --- a/frontend/app/components/shared/Filters/FilterItem/FilterItem.tsx +++ b/frontend/app/components/shared/Filters/FilterItem/FilterItem.tsx @@ -2,11 +2,11 @@ import React from 'react'; import FilterOperator from '../FilterOperator'; import FilterSelection from '../FilterSelection'; import FilterValue from '../FilterValue'; -import { Button } from 'UI'; +import { Button } from 'antd'; import FilterSource from '../FilterSource'; import { FilterKey, FilterType } from 'App/types/filter/filterType'; import SubFilterItem from '../SubFilterItem'; -import {toJS} from "mobx"; +import { CircleMinus } from 'lucide-react'; interface Props { filterIndex?: number; @@ -153,12 +153,12 @@ function FilterItem(props: Props) {
} diff --git a/frontend/app/components/shared/Filters/FilterList/FilterList.tsx b/frontend/app/components/shared/Filters/FilterList/FilterList.tsx index 272a525fb..0cffebc75 100644 --- a/frontend/app/components/shared/Filters/FilterList/FilterList.tsx +++ b/frontend/app/components/shared/Filters/FilterList/FilterList.tsx @@ -124,6 +124,8 @@ function FilterList(props: Props) { disabled: eventsOrderSupport && !eventsOrderSupport.includes('or'), }, ]; + + const eventsNum = filters.filter((i: any) => i.isEvent).size return (
{hasEvents && ( @@ -174,16 +176,18 @@ function FilterList(props: Props) { hoveredItem.position === 'bottom' ? '1.5rem' : '0.5rem', + marginLeft: '-1.25rem', + width: 'calc(100% + 2.5rem)', }} className={ - 'hover:bg-active-blue -mx-5 px-5 gap-2 items-center flex w-full' + 'hover:bg-active-blue px-5 gap-2 items-center flex' } id={`${filter.key}-${filterIndex}`} onDragOver={(e) => handleDragOverEv(e, filterIndex)} onDrop={(e) => handleDrop(e)} key={`${filter.key}-${filterIndex}`} > - {!!props.onFilterMove ? ( + {!!props.onFilterMove && eventsNum > 1 ? (
{ if (props.beforeOpen) { props.beforeOpen(); - history.push(withSiteId(link + (props.query ? props.query : ''), props.siteId)); + history.push( + withSiteId(link + (props.query ? props.query : ''), props.siteId) + ); } }; const onLinkClick = props.beforeOpen ? handleBeforeOpen : onClick; + + const onLeave = () => { + toggleHover(false); + }; + const onOver = () => { + toggleHover(true); + }; return ( toggleHover(true)} - onMouseLeave={() => toggleHover(false)} + onMouseOver={onOver} + onMouseOut={onLeave} target={props.newTab ? '_blank' : undefined} rel={props.newTab ? 'noopener noreferrer' : undefined} > @@ -68,7 +77,6 @@ function PlayLink(props: Props) { ); } - export default connect((state: any, props: Props) => ({ - siteId: props.siteId || state.getIn([ 'site', 'siteId' ]) -}))(PlayLink); \ No newline at end of file + siteId: props.siteId || state.getIn(['site', 'siteId']), +}))(PlayLink); diff --git a/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx b/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx index 283b2c811..c7a83005a 100644 --- a/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx +++ b/frontend/app/components/shared/SessionSearchField/AiSessionSearchField.tsx @@ -33,6 +33,7 @@ interface Props { appliedFilter: any; edit: typeof edit; clearSearch: typeof clearSearch; + setFocused?: (focused: boolean) => void; } function SessionSearchField(props: Props) { @@ -63,10 +64,12 @@ function SessionSearchField(props: Props) { const onFocus = () => { setShowModal(true); + props.setFocused?.(true); }; const onBlur = () => { setTimeout(() => { setShowModal(false); + props.setFocused?.(false); }, 200); }; return ( @@ -82,7 +85,7 @@ function SessionSearchField(props: Props) { id="search" type="search" autoComplete="off" - className="px-2 py-1 text-lg placeholder-lg !border-0 rounded-r-lg focus:!border-0 focus:ring-0" + className="px-2 py-1 text-lg placeholder-lg !border-0 rounded-r-lg nofocus" /> {showModal && ( @@ -143,7 +146,7 @@ const AiSearchField = observer( value={searchQuery} style={{ minWidth: 360, height: 33 }} autoComplete="off" - className="px-2 py-1 text-lg placeholder-lg !border-0 rounded-r-lg focus:!border-0 focus:ring-0" + className="px-2 py-1 text-lg placeholder-lg !border-0 rounded-r-lg nofocus" leadingButton={ searchQuery !== '' ? (
{ @@ -180,11 +184,15 @@ function AiSessionSearchField(props: Props) { setTab(newTab); localStorage.setItem(tabKey, newTab); }; + + const boxStyle = tab === 'ask' + ? gradientBox + : isFocused ? regularBoxFocused : regularBoxUnfocused; return (
) : ( - + )} ({ appliedFilter: state.getIn(['search', 'instance']), diff --git a/frontend/app/constants/countries.js b/frontend/app/constants/countries.js index d78494729..68610f3a5 100644 --- a/frontend/app/constants/countries.js +++ b/frontend/app/constants/countries.js @@ -1,5 +1,18 @@ export const threeLetter = {BD: 'BGD', BE: 'BEL', BF: 'BFA', BG: 'BGR', BA: 'BIH', BB: 'BRB', WF: 'WLF', BL: 'BLM', BM: 'BMU', BN: 'BRN', BO: 'BOL', BH: 'BHR', BI: 'BDI', BJ: 'BEN', BT: 'BTN', JM: 'JAM', BV: 'BVT', BW: 'BWA', WS: 'WSM', BQ: 'BES', BR: 'BRA', BS: 'BHS', JE: 'JEY', BY: 'BLR', BZ: 'BLZ', RU: 'RUS', RW: 'RWA', RS: 'SRB', TL: 'TLS', RE: 'REU', TM: 'TKM', TJ: 'TJK', RO: 'ROU', TK: 'TKL', GW: 'GNB', GU: 'GUM', GT: 'GTM', GS: 'SGS', GR: 'GRC', GQ: 'GNQ', GP: 'GLP', JP: 'JPN', GY: 'GUY', GG: 'GGY', GF: 'GUF', GE: 'GEO', GD: 'GRD', GB: 'GBR', GA: 'GAB', SV: 'SLV', GN: 'GIN', GM: 'GMB', GL: 'GRL', GI: 'GIB', GH: 'GHA', OM: 'OMN', TN: 'TUN', JO: 'JOR', HR: 'HRV', HT: 'HTI', HU: 'HUN', HK: 'HKG', HN: 'HND', HM: 'HMD', VE: 'VEN', PR: 'PRI', PS: 'PSE', PW: 'PLW', PT: 'PRT', SJ: 'SJM', PY: 'PRY', IQ: 'IRQ', PA: 'PAN', PF: 'PYF', PG: 'PNG', PE: 'PER', PK: 'PAK', PH: 'PHL', PN: 'PCN', PL: 'POL', PM: 'SPM', ZM: 'ZMB', EH: 'ESH', EE: 'EST', EG: 'EGY', ZA: 'ZAF', EC: 'ECU', IT: 'ITA', VN: 'VNM', SB: 'SLB', ET: 'ETH', SO: 'SOM', ZW: 'ZWE', SA: 'SAU', ES: 'ESP', ER: 'ERI', ME: 'MNE', MD: 'MDA', MG: 'MDG', MF: 'MAF', MA: 'MAR', MC: 'MCO', UZ: 'UZB', MM: 'MMR', ML: 'MLI', MO: 'MAC', MN: 'MNG', MH: 'MHL', MK: 'MKD', MU: 'MUS', MT: 'MLT', MW: 'MWI', MV: 'MDV', MQ: 'MTQ', MP: 'MNP', MS: 'MSR', OR: 'SEÑ', IM: 'IMN', UG: 'UGA', TZ: 'TZA', IS: 'MYS', MX: 'MEX', IL: 'ISR', FR: 'FRA', IO: 'IOT', SH: 'SHN', FI: 'FIN', FJ: 'FJI', FK: 'FLK', FM: 'FSM', FO: 'FRO', NI: 'NIC', NL: 'NLD', NO: 'NOR', NA: 'NAM', VU: 'VUT', NC: 'NCL', NE: 'NER', NF: 'NFK', NG: 'NGA', NZ: 'NZL', NP: 'NPL', NR: 'NRU', NU: 'NIU', CK: 'COK', XK: 'XKX', CI: 'CIV', CH: 'CHE', CO: 'COL', CN: 'CHN', CM: 'CMR', CL: 'CHL', CC: 'CCK', CA: 'CAN', CG: 'COG', CF: 'CAF', CD: 'COD', CZ: 'CZE', CY: 'CYP', CX: 'CXR', CR: 'CRI', CW: 'CUW', CV: 'CPV', CU: 'CUB', SZ: 'SWZ', SY: 'SYR', SX: 'SXM', KG: 'KGZ', KE: 'KEN', SS: 'SSD', SR: 'SUR', KI: 'KIR', KH: 'KHM', KN: 'KNA', KM: 'COM', ST: 'STP', SK: 'SVK', KR: 'KOR', SI: 'SVN', KP: 'PRK', KW: 'KWT', SN: 'SEN', SM: 'SMR', SL: 'SLE', SC: 'SYC', KZ: 'KAZ', KY: 'CYM', SG: 'SGP', SE: 'SWE', SD: 'SDN', DO: 'DOM', DM: 'DMA', DJ: 'DJI', DK: 'DNK', VG: 'VGB', DE: 'DEU', YE: 'YEM', DZ: 'DZA', US: 'USA', UY: 'URY', YT: 'MYT', UM: 'UMI', LB: 'LBN', LC: 'LCA', LA: 'LAO', TV: 'TUV', TW: 'TWN', TT: 'TTO', TR: 'TUR', LK: 'LKA', LI: 'LIE', LV: 'LVA', TO: 'TON', LT: 'LTU', LU: 'LUX', LR: 'LBR', LS: 'LSO', TH: 'THA', TF: 'ATF', TG: 'TGO', TD: 'TCD', TC: 'TCA', LY: 'LBY', VA: 'VAT', VC: 'VCT', AE: 'ARE', AD: 'AND', AG: 'ATG', AF: 'AFG', AI: 'AIA', VI: 'VIR', IS: 'ISL', IR: 'IRN', AM: 'ARM', AL: 'ALB', AO: 'AGO', AQ: 'ATA', AS: 'ASM', AR: 'ARG', AU: 'AUS', AT: 'AUT', AW: 'ABW', IN: 'IND', AX: 'ALA', AZ: 'AZE', IE: 'IRL', ID: 'IDN', UA: 'UKR', QA: 'QAT', MZ: 'MOZ'} -export default { + +function sortObjectValuesAlphabetically(obj) { + let values = Object.values(obj); + values.sort(); + let sortedObj = {}; + let keys = Object.keys(obj); + values.forEach((value, index) => { + sortedObj[keys[index]] = value; + }); + + return sortedObj; +} + +const countries = { AC: 'Ascension Island', AD: 'Andorra', AE: 'United Arab Emirates', @@ -281,3 +294,6 @@ export default { ZR: 'Zaire', ZW: 'Zimbabwe', }; + + +export default sortObjectValuesAlphabetically(countries) \ No newline at end of file diff --git a/frontend/app/styles/reset.css b/frontend/app/styles/reset.css index 744203955..307c21f31 100644 --- a/frontend/app/styles/reset.css +++ b/frontend/app/styles/reset.css @@ -26,7 +26,7 @@ button { } textarea:focus, -input:not(.ant-input-number-input):focus { +input:not(.ant-input-number-input, .nofocus):focus { border: solid thin $teal !important; }