Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0284299
group live choices
niteshbhardwaj02 May 2, 2025
b4e0fbb
filter changes
niteshbhardwaj02 May 6, 2025
d5533ec
live choices
niteshbhardwaj02 May 6, 2025
402912f
fix group name issue
niteshbhardwaj02 May 7, 2025
951266d
filter optimization
niteshbhardwaj02 May 9, 2025
f8cd149
multi dropdown filter
niteshbhardwaj02 May 13, 2025
98a963f
country dense dot fix
niteshbhardwaj02 May 13, 2025
0819a59
filter multiple issue in filters
niteshbhardwaj02 May 14, 2025
0357272
fix chip issue
niteshbhardwaj02 May 14, 2025
050a93f
country disclaimer
niteshbhardwaj02 May 21, 2025
6820b3c
country disclaimer notification
niteshbhardwaj02 May 21, 2025
3710b60
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 May 27, 2025
e32fccd
improve filter changes
niteshbhardwaj02 May 27, 2025
d060f32
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Jun 2, 2025
95f2df9
disclaimer changes
niteshbhardwaj02 Jun 2, 2025
6f14302
some Css fixes
himsehra Jun 4, 2025
218d629
fixed
himsehra Jun 9, 2025
1b19610
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
himsehra Jun 9, 2025
2e7b193
school popup portal
niteshbhardwaj02 Jun 3, 2025
e0b1320
school popup fix
niteshbhardwaj02 Jun 18, 2025
750d22b
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Jun 18, 2025
9eb9b1a
fix ui changes
niteshbhardwaj02 Jun 18, 2025
473cdb2
fix sidepanel collapse
niteshbhardwaj02 Jun 18, 2025
0788677
searchbar changes
himsehra Jun 11, 2025
427627b
fix search bar
niteshbhardwaj02 Jun 18, 2025
a6fecf9
enhance school popup
niteshbhardwaj02 Jun 19, 2025
fc3bba7
school popup tap handling
niteshbhardwaj02 Jun 19, 2025
2bdc517
popup top placement
niteshbhardwaj02 Jun 19, 2025
ffa9026
replace date with week interval
niteshbhardwaj02 Jun 20, 2025
8ebd785
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Jun 24, 2025
03561c2
remove filter tag
niteshbhardwaj02 Jun 24, 2025
c3e3f97
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Jun 24, 2025
5345b45
disclaimer color update
niteshbhardwaj02 Jun 24, 2025
d951dd3
fix popup issue alignment
niteshbhardwaj02 Jun 24, 2025
dd677c1
swipe effect update
niteshbhardwaj02 Jun 25, 2025
ec060d5
fix search icon
niteshbhardwaj02 Jun 25, 2025
added98
hide disclaimer on mobile
niteshbhardwaj02 Jun 30, 2025
4473070
fix school live selection
niteshbhardwaj02 Jul 1, 2025
67a84d5
search api changes and country limit increase
niteshbhardwaj02 Jul 8, 2025
9eaef01
load more result implementation
niteshbhardwaj02 Jul 10, 2025
e7cd869
revert search changes
niteshbhardwaj02 Jul 15, 2025
57927f2
search result fix
niteshbhardwaj02 Jul 16, 2025
ce7397e
discalimer changes
niteshbhardwaj02 Jul 28, 2025
ca57130
updated privacy
niteshbhardwaj02 Jul 28, 2025
88d0f57
search within country and global
niteshbhardwaj02 Jul 29, 2025
e63c127
search ordering fields
niteshbhardwaj02 Aug 18, 2025
c12719a
giga meter country list
niteshbhardwaj02 Aug 29, 2025
d793465
env updated
niteshbhardwaj02 Sep 1, 2025
f160a89
updated request popup copy
niteshbhardwaj02 Sep 1, 2025
a5a71c3
updated countries path
niteshbhardwaj02 Sep 1, 2025
9696e45
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Sep 2, 2025
365b62d
popup ui changes
niteshbhardwaj02 Sep 2, 2025
7908aba
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Sep 2, 2025
0c4d6ed
country disclaimer updated
niteshbhardwaj02 Sep 2, 2025
d0f5a47
revert legend fontsize
niteshbhardwaj02 Sep 3, 2025
555462e
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Sep 3, 2025
42ee986
Merge branch 'feature/country-desclaimer' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
b0ddc3b
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Sep 4, 2025
c5106c8
Merge branch 'feature/improve-filter-ui' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
8986e9f
Merge branch 'improvements/feedbacks' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
8aa6517
Merge branch 'feature/school-popup-osm-final' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
15ba347
license and disclaimer text updated
niteshbhardwaj02 Sep 4, 2025
05d422f
Merge branch 'feature/giga-meter-api-changes' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
bceddb3
Merge branch 'staging' of https://github.com/unicef/giga-maps-fronten…
niteshbhardwaj02 Sep 4, 2025
7869378
Merge branch 'feature/country-dense-dots' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
70d6bf1
remove yarn lock
vipulbhavsar94 Sep 3, 2025
6ed6516
data-source-in-popup
vipulbhavsar94 Sep 3, 2025
23453a8
Merge branch 'feature/search-improvement' into release-merge-04-09
niteshbhardwaj02 Sep 4, 2025
85b41ea
botswana to malawi
niteshbhardwaj02 Sep 4, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Dependencies
node_modules
yarn.lock

# Build files
build
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ARG MATOMO_SITE_ID
ENV MATOMO_SITE_ID=$MATOMO_SITE_ID
ARG AIRTABLE_API_KEY
ENV AIRTABLE_API_KEY=$AIRTABLE_API_KEY
ARG GIGA_METER_API_HOST
ENV GIGA_METER_API_HOST=$GIGA_METER_API_HOST

RUN echo $RECAPTCHA_KEY \
&& echo $API_MAPBOX_ACCESS_TOKEN \
Expand Down
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ steps:
--build-arg=ENV=$(ENV_DEV)
--build-arg=MATOMO_SITE_ID=$(MATOMO_SITE_ID_DEV)
--build-arg=AIRTABLE_API_KEY=$(AIRTABLE_API_KEY)
--build-arg=GIGA_METER_API_HOST=$(GIGA_METER_API_HOST_DEV)
tags: |
$(tag)

Expand Down Expand Up @@ -96,6 +97,7 @@ steps:
--build-arg=ENV=$(ENV_STG)
--build-arg=MATOMO_SITE_ID=$(MATOMO_SITE_ID_STG)
--build-arg=AIRTABLE_API_KEY=$(AIRTABLE_API_KEY)
--build-arg=GIGA_METER_API_HOST=$(GIGA_METER_API_HOST_STG)
tags: |
$(tag)
condition:
Expand Down Expand Up @@ -129,6 +131,7 @@ steps:
--build-arg=ENV=$(ENV_PROD)
--build-arg=MATOMO_SITE_ID=$(MATOMO_SITE_ID_PROD)
--build-arg=AIRTABLE_API_KEY=$(AIRTABLE_API_KEY)
--build-arg=GIGA_METER_API_HOST=$(GIGA_METER_API_HOST_PROD)
tags: |
$(tag)
condition:
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "doasync",
"private": true,
"scripts": {
"start:dev": "cross-env NODE_ENV=development webpack-dev-server --config webpack/config.dev.ts",
"start": "cross-env NODE_ENV=development webpack-dev-server --config webpack/config.dev.ts",
"build": "cross-env NODE_ENV=production webpack --config webpack/config.prod.ts",
"build-info": "webpack --config webpack/config.info.ts",
Expand Down Expand Up @@ -162,6 +163,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^15.0.2",
"react-infinite-scroll-component": "^6.1.0",
"react-perfect-scrollbar": "1.5.8",
"react-transition-group": "^4.4.5",
"styled-components": "^6.0.7",
Expand Down
1 change: 1 addition & 0 deletions src/@/admin/constants/country-summary.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const defaultCountryForm = {
"last_weekly_status": null,
"date_of_join": null,
'iso3_format': '',
"country_disclaimer": "",
benchmark_metadata: {
live_layer: {},
layer_descriptions: {},
Expand Down
10 changes: 8 additions & 2 deletions src/@/admin/effects/filter-fx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEffect } from "effector"
import { createRequestAuthFx } from "~/core/auth/effects/common.fx"
import { APIListType } from "~/api/types"
import { FilterConfiguration, FilterListType } from "../types/filter-list.type"
import { ColumnDBChoicesType, FilterConfiguration, FilterListType } from "../types/filter-list.type"
import { FilterAllValueType } from "../types/filter-list-type"

export const getFilterListFx = createEffect(({ page, pageSize, search }: { page: number, pageSize: number, search?: string }) => {
Expand Down Expand Up @@ -61,4 +61,10 @@ export const publishFilterFx = createEffect(({ id }: { id: number }) => {
method: 'PUT',
url: `accounts/adv_filters/${id}/publish/`,
}) as Promise<FilterListType>
})
})

export const getFilterChoicesFx = createEffect(({ id }: { id: number }) => {
return createRequestAuthFx({
url: `accounts/column_configurations/${id}/choices/`,
}) as Promise<ColumnDBChoicesType>
})
14 changes: 11 additions & 3 deletions src/@/admin/models/filter-list.model.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { $notification } from '~/@/common/Toast/toast.model';
import { $appConfigValues } from '~/@/admin/models/admin-model';
import { createEvent, createStore, merge, restore, sample } from "effector";
import { addFilterFx, editFilterFx, filterColumnListFx, getFilterListFx, getFilterListIdFx, getFilterPublishedListFx } from "../effects/filter-fx";
import { addFilterFx, editFilterFx, filterColumnListFx, getFilterChoicesFx, getFilterListFx, getFilterListIdFx, getFilterPublishedListFx } from "../effects/filter-fx";
import { setPayload, setPayloadResults } from "~/lib/effector-kit";
import { FilterConfiguration, FilterListType } from "../types/filter-list.type";
import { ColumnDBChoicesType, FilterConfiguration, FilterListType } from "../types/filter-list.type";
import { FilterAllValueType, FilterValueType } from '../types/filter-list-type';
import { addAdminFilter, editAdminFilter } from '~/core/routes';

Expand All @@ -27,6 +27,10 @@ export const $filterListCount = createStore(0);
export const onReloadFilterList = createEvent<object>();
export const $reloadFiler = restore(onReloadFilterList, null);

export const $columnDBChoices = createStore<ColumnDBChoicesType['values']>([]);

$columnDBChoices.on(getFilterChoicesFx.doneData, (_, payload: ColumnDBChoicesType) => payload?.values ?? []);

$filterListResponse.on(getFilterListFx.doneData, setPayloadResults);
$filterListCount.on(getFilterListFx.doneData, (_, response) => response?.count || 0);

Expand Down Expand Up @@ -59,6 +63,8 @@ export const $filterStatusChoices = $appConfigValues.map((config) => {
}
})

export const onSetFilterValidationError = createEvent<string>();
export const $filterValidationError = restore(onSetFilterValidationError, '');
export const onSetFilterForm = createEvent();
export const onUdpateFilterForm = createEvent<[string, FilterValueType]>();
export const $formFilterData = createStore<FilterAllValueType>(defaultFilterData);
Expand Down Expand Up @@ -113,4 +119,6 @@ sample({
clock: addFilterFx.done,
fn: () => ({ title: 'Created!', kind: 'success', subtitle: 'Filter created successfully' }),
target: $notification
})
})

$filterValidationError.reset(onUdpateFilterForm)
1 change: 1 addition & 0 deletions src/@/admin/types/filter-list-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type FilterAllValueType = {
options: {
placeholder?: string
live_choices?: boolean
group_choices?: boolean
range_auto_compute?: boolean
choices?: { label: string, value: string }[],
minPlaceholder?: string
Expand Down
8 changes: 8 additions & 0 deletions src/@/admin/types/filter-list.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ export interface FilterListType {
active_countries_list: number[]
}

export interface ColumnDBChoicesType {
values: {
label: string
value: string
}[]
}

export interface FilterOptionsField {
live_choices?: boolean
group_choices?: boolean
choices?: { label: string; value: string }[]
placeholder?: string
range_auto_compute?: boolean
Expand Down
187 changes: 187 additions & 0 deletions src/@/admin/ui/common/multi-select-dropdown-adv.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
import React, { useEffect, useRef, useState } from "react";
import { Button } from "@carbon/react";
import { FilterableMultiSelect } from "@carbon/react";
import styled, { css } from "styled-components";
import { selectAll } from "@testing-library/user-event/dist/types/event";

// Types
export interface MultiSelectItem {
// id: string | number;
// name: string;
[key: string]: any; // Allow for additional properties
}

export interface MultiSelectDropdownAdvProps {
items: MultiSelectItem[];
onSelectItems: (selectedItems: any[]) => void;
initialSelectedItems?: any[];
titleText?: string;
placeholder?: string;
id?: string;
name?: string;
height?: string;
showSelectAllButton?: boolean;
selectAllButtonPosition?: "top-right" | "bottom-right" | "bottom-left" | "top-left";
disabled?: boolean;
theme?: "light" | "dark";
customStyles?: React.CSSProperties;
itemToElement?: (item: MultiSelectItem) => React.ReactNode;
[key: string]: any; // Allow for additional props to be passed
}

// Styled components with theme support
interface StyledMultiSelectProps {
height?: string;
theme?: "light" | "dark";
}


const darkTheme = css`
.cds--multi-select {

background-color: #333333;
}
.cds--text-input {
color: #c0c0c0;
}
.cds--text-input::placeholder {
color: #c0c0c0;
opacity: 0.8;
}
// .cds--list-box__label {
// color: #c0c0c0;
// }
.cds--list-box__menu-icon svg {
fill: #c0c0c0;
}
.cds--label {
color: #c0c0c0;
}

`;

const StyledMultiSelect = styled(FilterableMultiSelect) <StyledMultiSelectProps>`
margin-top: 1.5rem;

.cds--list-box__menu {
height: ${(props) => props.height || "8rem"} !important;
max-height: 10rem !important;
overflow-y: auto;
}

${(props) => (props.theme === "dark" ? darkTheme : undefined)}
`;

const MultiSelectContainer = styled.div<{ selectAllButtonPosition?: string }>`
width: 100%;
position: relative;

.select-all-button {
position: absolute;
${(props) => {
switch (props.selectAllButtonPosition) {
case "bottom-right":
return `
bottom: -2.5rem;
right: 0;
`;
case "bottom-left":
return `
bottom: -2.5rem;
left: 0;
`;
case "top-left":
return `
top: -0.5rem;
left: 0;
`;
case "top-right":
default:
return `
top: -0.5rem;
right: 0;
`;
}
}}
}
`;

/**
* Advanced Multi-Select Dropdown component
*
*/
export const MultiSelectDropdownAdv: React.FC<MultiSelectDropdownAdvProps> = ({
items,
onSelectItems,
selectedItems,
initialSelectedItems = [],
titleText = "Select Items",
placeholder = "Select Items",
id = "multi-select-dropdown",
name = "multiSelectDropdown",
height = "8rem",
showSelectAllButton = true,
selectAllButtonPosition = "top-right",
disabled = false,
theme = "light",
customStyles = {},
itemToString,
itemToElement,
...others
}) => {
const isSelectedAll = selectedItems.length === items.length;
// Handle select/clear all functionality
const handleSelectAllToggle = () => {
if (isSelectedAll) {
onSelectItems([]);
} else {
onSelectItems([...items]);
}
};

// Default item renderer if none provided
const defaultItemToElement = (item: MultiSelectItem) => (
<span>{item?.name}</span>
);

return (
<MultiSelectContainer
selectAllButtonPosition={selectAllButtonPosition}
style={customStyles}
>
<StyledMultiSelect
key={`multi-select-${isSelectedAll}`}
height={height}
id={id}
name={name}
titleText={titleText}
placeholder={placeholder}
items={items}
itemToString={itemToString}
initialSelectedItems={initialSelectedItems}
selectedItems={selectedItems}
itemToElement={itemToElement || defaultItemToElement}
onChange={({ selectedItems }: { selectedItems: MultiSelectItem[] }) => {
onSelectItems(selectedItems);
}}
disabled={disabled}
theme={theme}
{...others}
/>

{showSelectAllButton && (
<Button
className="select-all-button"
kind="ghost"
size="sm"
onClick={handleSelectAllToggle}
disabled={disabled}
>
{isSelectedAll ? 'Clear all' : 'Select all'}
</Button>
)}
</MultiSelectContainer>
);
};

export default MultiSelectDropdownAdv;
Loading