From b1d01c5840e3f68dafeed37a710c77509dc0c142 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Tue, 25 Jun 2024 16:11:06 +0545 Subject: [PATCH 01/12] Remove `Footer` in `Create New Partner` page --- frontend/src/components/footer/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/footer/index.js b/frontend/src/components/footer/index.js index 6e135b4e39..0aa8118eac 100644 --- a/frontend/src/components/footer/index.js +++ b/frontend/src/components/footer/index.js @@ -45,6 +45,7 @@ export function Footer() { 'manage/projects/new', 'manage/categories/new', 'manage/licenses/new', + 'manage/partners/new', 'teams/:id/membership', '/api-docs/', ]; From 07ec1884a62e8f4ffff1eddf100927a33eea11ac Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Wed, 26 Jun 2024 12:16:16 +0545 Subject: [PATCH 02/12] Remove grain background in `Manage Partners` section --- frontend/src/components/partners/partners.js | 80 ++++++++++---------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/frontend/src/components/partners/partners.js b/frontend/src/components/partners/partners.js index c1dee02b10..602cb2fda1 100644 --- a/frontend/src/components/partners/partners.js +++ b/frontend/src/components/partners/partners.js @@ -25,51 +25,47 @@ export function PartnersManagement({ partners, isAdmin, isPartnersFetched }) { ); return ( -
- }} - /> - } - showAddButton={isAdmin} - userOnlyLabel={} + }} + /> + } + showAddButton={isAdmin} + userOnlyLabel={} + > + - -
- setSearchQuery('')} - /> -
-
- {isAdmin ? ( - filteredPartners?.length ? ( - filteredPartners.map((partner) => ( - - )) - ) : ( -
- -
- ) +
+ setSearchQuery('')} + /> +
+
+ {isAdmin ? ( + filteredPartners?.length ? ( + filteredPartners.map((partner) => ) ) : ( -
- +
+
- )} -
- - -
+ ) + ) : ( +
+ +
+ )} +
+
+
); } From cd3b1bcdf66e13955a02c12f2a8e10cc920f51f0 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Fri, 28 Jun 2024 09:02:31 +0545 Subject: [PATCH 03/12] Do not fetch data if current projects is null in `Partners Page` --- frontend/src/components/partners/currentProjects.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/partners/currentProjects.js b/frontend/src/components/partners/currentProjects.js index 7266875ba0..4fdcf3f52c 100644 --- a/frontend/src/components/partners/currentProjects.js +++ b/frontend/src/components/partners/currentProjects.js @@ -65,6 +65,7 @@ export function CurrentProjects({ currentProjects }) { }; useEffect(() => { + if (!currentProjects) return; fetchData(); // eslint-disable-next-line react-hooks/exhaustive-deps From b59613702d3331cba98cd0c38a011c8556927a00 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Fri, 28 Jun 2024 09:07:16 +0545 Subject: [PATCH 04/12] Add `no current projects` placeholder text for no projects in `Partners Page` --- frontend/src/components/partners/currentProjects.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/components/partners/currentProjects.js b/frontend/src/components/partners/currentProjects.js index 4fdcf3f52c..18e43e8a7d 100644 --- a/frontend/src/components/partners/currentProjects.js +++ b/frontend/src/components/partners/currentProjects.js @@ -71,6 +71,9 @@ export function CurrentProjects({ currentProjects }) { // eslint-disable-next-line react-hooks/exhaustive-deps }, [currentProjects]); + if (!currentProjects) + return

There are no current projects.

; + return ( Date: Tue, 2 Jul 2024 13:13:06 +0545 Subject: [PATCH 05/12] Left align Add/Edit Partners content --- frontend/src/views/partnersManagement.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/partnersManagement.js b/frontend/src/views/partnersManagement.js index f31058650d..8e117cbedf 100644 --- a/frontend/src/views/partnersManagement.js +++ b/frontend/src/views/partnersManagement.js @@ -89,16 +89,9 @@ export function CreatePartner() { onSubmit={(values) => createPartner(values)} render={({ handleSubmit, pristine, form, submitting, values }) => { return ( -
+
-

+

@@ -213,8 +206,8 @@ export function EditPartners() { ready={!error && loading === false && typeof partner === 'object'} > {userDetails.role === 'ADMIN' ? ( -
-
+
+

From 62208509d3ffb4ec83397f3aa3538de1db6bf316 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Tue, 2 Jul 2024 14:54:54 +0545 Subject: [PATCH 06/12] Adjust content spacing in `Partners Page` --- frontend/src/components/partners/partners.js | 5 ++--- frontend/src/views/partnersManagement.js | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/partners/partners.js b/frontend/src/components/partners/partners.js index 602cb2fda1..ef9058f19a 100644 --- a/frontend/src/components/partners/partners.js +++ b/frontend/src/components/partners/partners.js @@ -41,7 +41,7 @@ export function PartnersManagement({ partners, isAdmin, isPartnersFetched }) { delay={10} ready={isPartnersFetched} > -
+
setSearchQuery('')} />
-
+
{isAdmin ? ( filteredPartners?.length ? ( filteredPartners.map((partner) => ) @@ -76,7 +76,6 @@ export function PartnersCard({ details }) { style={{ backgroundColor: '#ffffff', color: '#002366', - margin: '0.5rem', padding: '1rem', borderRadius: '0.25rem', border: '1px solid #cbd5e0', diff --git a/frontend/src/views/partnersManagement.js b/frontend/src/views/partnersManagement.js index 8e117cbedf..49bbcfc94e 100644 --- a/frontend/src/views/partnersManagement.js +++ b/frontend/src/views/partnersManagement.js @@ -90,8 +90,8 @@ export function CreatePartner() { render={({ handleSubmit, pristine, form, submitting, values }) => { return ( -
-

+
+

@@ -207,13 +207,13 @@ export function EditPartners() { > {userDetails.role === 'ADMIN' ? (
-
+

-
+
Date: Wed, 10 Jul 2024 17:10:19 +0545 Subject: [PATCH 07/12] Changes in `Partners Page` Design - Design improvements to Partners Statistics Page - Fix UI misalignments - Related to #6462 --- frontend/src/assets/styles/_colors.scss | 3 + frontend/src/assets/styles/_extra.scss | 6 +- .../components/partners/currentProjects.js | 104 ++++++++++++------ frontend/src/components/partners/messages.js | 8 +- .../components/partners/partnersActivity.js | 60 +++++----- .../components/partners/partnersProgresBar.js | 95 ++++++++++++---- .../src/components/partners/partnersStats.js | 57 +++++----- frontend/src/components/partners/styles.scss | 28 ++--- .../src/components/teamsAndOrgs/management.js | 2 +- frontend/src/views/partnersStats.js | 95 +++++++++------- 10 files changed, 287 insertions(+), 171 deletions(-) diff --git a/frontend/src/assets/styles/_colors.scss b/frontend/src/assets/styles/_colors.scss index 47b072fe96..b312340dc2 100644 --- a/frontend/src/assets/styles/_colors.scss +++ b/frontend/src/assets/styles/_colors.scss @@ -102,6 +102,9 @@ Background colors .bg-grey-light { background-color: $grey-light; } +.bg-grey-dark { + background-color: #43474e; +} .bg-white { background-color: $white; } diff --git a/frontend/src/assets/styles/_extra.scss b/frontend/src/assets/styles/_extra.scss index 0604459af1..c68f4802d4 100644 --- a/frontend/src/assets/styles/_extra.scss +++ b/frontend/src/assets/styles/_extra.scss @@ -448,12 +448,12 @@ a[href="https://www.mapbox.com/map-feedback/"] .two-column { grid-template-columns: 6fr 4fr; } -.graphics-container{ +.graphics-container { display: grid; - grid-template-columns: repeat(auto-fill, minmax(250px, 600px)); + grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } -.input-container{ +.input-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 600px)); } diff --git a/frontend/src/components/partners/currentProjects.js b/frontend/src/components/partners/currentProjects.js index 18e43e8a7d..dd6b58e8d5 100644 --- a/frontend/src/components/partners/currentProjects.js +++ b/frontend/src/components/partners/currentProjects.js @@ -1,15 +1,16 @@ import React, { useEffect, useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { TasksMap } from '../taskSelection/map'; +import { Link } from 'react-router-dom'; +import ReactPlaceholder from 'react-placeholder'; import { Pagination } from 'swiper/modules'; import { Swiper, SwiperSlide } from 'swiper/react'; + +import { TasksMap } from '../taskSelection/map'; import { Button } from '../button'; -import { Link } from 'react-router-dom'; import { API_URL } from '../../config'; - import messages from './messages'; -import ReactPlaceholder from 'react-placeholder'; import ProjectProgressBar from '../projectCard/projectProgressBar'; +import { HeaderLine } from '../projectDetail/header'; // Import Swiper styles import './styles.scss'; @@ -24,13 +25,9 @@ export function CurrentProjects({ currentProjects }) { const [error, setError] = useState(false); const pagination = { clickable: true, - renderBullet: function (index, className) { - return '' + (index + 1) + ''; - }, + el: '.swiper-custom-pagination', }; - const text = `This remote mapping of buildings will support the implementation of planned activities and - largely the generation of data for humanitarian activities in the identified provinces. `; const fetchData = async () => { try { const projectIds = currentProjects.split(',').map((id) => parseInt(id.trim(), 10)); @@ -54,6 +51,7 @@ export function CurrentProjects({ currentProjects }) { percentMapped: jsonInfo.percentMapped, percentValidated: jsonInfo.percentValidated, percentBadImagery: jsonInfo.percentBadImagery, + organisationName: jsonInfo.organisationName, }; }); @@ -88,48 +86,88 @@ export function CurrentProjects({ currentProjects }) { pagination={pagination} modules={[Pagination]} swipeHandler={{ draggable: false }} + className="shadow-4" style={{ backgroundColor: 'white', width: '100%', borderColor: 'gray', - borderRadius: 5, - height: 500, - border: '1px solid', }} > {projectsData.map((project) => ( - - -
-

- {project.id} - {project.info.name} -

- - - + +
+ +
+

+ {project.info && project.info.name} +

+
+
+
+ + + + + + + +
+ +
+
-
- + -

{text}

- - - +
))} )} + +
); } diff --git a/frontend/src/components/partners/messages.js b/frontend/src/components/partners/messages.js index 1701f64714..9128d2930e 100644 --- a/frontend/src/components/partners/messages.js +++ b/frontend/src/components/partners/messages.js @@ -55,7 +55,7 @@ export default defineMessages({ }, editsStats: { id: 'management.partners.filter.editsStats', - defaultMessage: 'Total Edits', + defaultMessage: 'Total map edits', }, noPartnersGroup: { id: 'partners.group.zero', @@ -67,7 +67,7 @@ export default defineMessages({ }, buildings: { id: 'management.partners.activity.buildings', - defaultMessage: 'Buildings Added', + defaultMessage: 'Buildings mapped', }, roads: { id: 'management.partners.activity.roads', @@ -84,7 +84,7 @@ export default defineMessages({ learnToMap: { id: 'management.partners.learnToMap', defaultMessage: 'Learn to Map', - }, + }, myPartners: { id: 'management.filter.buttons.myPartners', defaultMessage: 'My Partners', @@ -109,7 +109,7 @@ export default defineMessages({ id: 'management.partners.titles.partner_information', defaultMessage: 'Partner information', }, - permalink:{ + permalink: { id: 'management.partners.titles.partner_permalink', defaultMessage: 'Permalink', }, diff --git a/frontend/src/components/partners/partnersActivity.js b/frontend/src/components/partners/partnersActivity.js index a9a2667c86..e0ffa15c57 100644 --- a/frontend/src/components/partners/partnersActivity.js +++ b/frontend/src/components/partners/partnersActivity.js @@ -1,10 +1,10 @@ import React, { useEffect, useState } from 'react'; -import { OHSOME_STATS_BASE_URL } from '../../config'; import { FormattedMessage } from 'react-intl'; - import ReactPlaceholder from 'react-placeholder'; + import PartnersProgresBar from './partnersProgresBar'; import messages from './messages'; +import { OHSOME_STATS_BASE_URL } from '../../config'; export const Activity = ({ partner }) => { const [data, setData] = useState(null); @@ -49,7 +49,7 @@ export const Activity = ({ partner }) => { } groupedData[secondary].push({ - primary: primary, + primary, secondary: typeof value === 'string' ? parseFloat(value) : value, }); } @@ -69,10 +69,12 @@ export const Activity = ({ partner }) => { } useEffect(() => { + if (!partner.id) return; fetchData(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, [partner]); + return (
@@ -83,33 +85,34 @@ export const Activity = ({ partner }) => { 0, ); return ( -
-

- -

-
+
+
+

Team

+

+ +

+
+
{series.data.map((dataItem) => ( diff --git a/frontend/src/components/partners/partnersProgresBar.js b/frontend/src/components/partners/partnersProgresBar.js index cc70f97a1d..2d0a0661dd 100644 --- a/frontend/src/components/partners/partnersProgresBar.js +++ b/frontend/src/components/partners/partnersProgresBar.js @@ -1,31 +1,78 @@ import React from 'react'; -import { FormattedMessage } from 'react-intl'; +import { OHSOME_STATS_BASE_URL } from '../../config'; -import messages from './messages'; -import { ProgressBar } from '../progressBar'; +const height = '1.65rem'; -export default function PartnersProgresBar({ - totalData, - percentValidated, - label, - value, - small = true, -}: Object) { +const ProgressBar = ({ className, firstBarValue, secondBarValue = 0, children, data }) => { + return ( +
+
+ +
100 ? 100 : firstBarValue}%`, + height, + borderRadius: '6px', + }} + role="progressbar" + aria-valuenow={firstBarValue} + aria-valuemin="0" + aria-valuemax="100" + /> +
100 ? 100 : secondBarValue}%`, + height, + borderRadius: '6px', + }} + role="progressbar" + aria-valuenow={secondBarValue} + aria-valuemin="0" + aria-valuemax="100" + /> +
+
+
+ ); +}; +export default function PartnersProgresBar({ data, totalData, percentValidated, label, value }) { return ( - -

- {value}{" "} - -

-
+ ); } diff --git a/frontend/src/components/partners/partnersStats.js b/frontend/src/components/partners/partnersStats.js index f18225d539..d254422e44 100644 --- a/frontend/src/components/partners/partnersStats.js +++ b/frontend/src/components/partners/partnersStats.js @@ -2,7 +2,11 @@ import { FormattedMessage, FormattedNumber } from 'react-intl'; import shortNumber from 'short-number'; import messages from './messages'; -import { RoadIcon, HomeIcon, UserIcon, EditIcon } from '../svgIcons'; +import { StatsCard } from '../statsCard'; +import { MappingIcon, EditIcon, RoadIcon, HomeIcon } from '../svgIcons'; + +const iconClass = 'h-50 w-50'; +const iconStyle = { height: '45px' }; export const StatsNumber = (props) => { const value = shortNumber(props.value); @@ -38,31 +42,32 @@ export const StatsColumn = ({ label, value, icon }: Object) => { }; export const StatsSection = ({ partner }) => { - return ( - <> -
- } - /> - } - /> - } - /> - } - /> -
- +
+ } + description={} + value={partner ? partner.users : '-'} + className={'w-25-l w-50-m w-100 mv1'} + /> + } + description={} + value={partner ? partner.edits : '-'} + className={'w-25-l w-50-m w-100 mv1'} + /> + } + description={} + value={partner ? partner.buildings : '-'} + className={'w-25-l w-50-m w-100 mv1'} + /> + } + description={} + value={partner ? partner.roads : '-'} + className={'w-25-l w-50-m w-100 mv1'} + /> +
); }; diff --git a/frontend/src/components/partners/styles.scss b/frontend/src/components/partners/styles.scss index 312dbe3ed3..a0d09b7350 100644 --- a/frontend/src/components/partners/styles.scss +++ b/frontend/src/components/partners/styles.scss @@ -1,15 +1,15 @@ .swiper-pagination-bullet { - width: 20px !important; - height: 20px !important; - text-align: center; - line-height: 20px; - font-size: 12px ; - color: #000; - opacity: 1; - background: rgba(0, 0, 0, 0.2); - } - - .swiper-pagination-bullet-active { - color: #fff !important; - background: #D73F3F !important; - } \ No newline at end of file + width: 14px !important; + height: 14px !important; + text-align: center; + line-height: 20px; + font-size: 12px; + color: #000; + opacity: 1; + background: rgba(0, 0, 0, 0.8) !important; +} + +.swiper-pagination-bullet-active { + color: #fff !important; + background: #8d8d8d !important; +} diff --git a/frontend/src/components/teamsAndOrgs/management.js b/frontend/src/components/teamsAndOrgs/management.js index 244e35b7aa..ec7b9561c5 100644 --- a/frontend/src/components/teamsAndOrgs/management.js +++ b/frontend/src/components/teamsAndOrgs/management.js @@ -68,7 +68,7 @@ export function Management(props) { // admin users can switch between all teams/orgs and only their teams/orgs return (
-
+

{props.title}

{props.showAddButton && ( diff --git a/frontend/src/views/partnersStats.js b/frontend/src/views/partnersStats.js index d00cc801f1..da7f60a924 100644 --- a/frontend/src/views/partnersStats.js +++ b/frontend/src/views/partnersStats.js @@ -6,12 +6,13 @@ import messages from './messages'; import { NotFound } from './notFound'; import { useFetch } from '../hooks/UseFetch'; import { StatsSection } from '../components/partners/partnersStats'; -import LearnMapNowLogo from '../assets/img/learn-MapNow.svg'; -import { Resources } from '../components/partners/partnersResources'; import { Activity } from '../components/partners/partnersActivity'; import { CurrentProjects } from '../components/partners/currentProjects'; import { OHSOME_STATS_BASE_URL } from '../config'; import { Button } from '../components/button'; +import { TwitterIcon, FacebookIcon, InstagramIcon } from '../components/svgIcons'; + +const socialIconsStyle = { height: '24px', width: '24px' }; export const PartnersStats = () => { const { id } = useParams(); @@ -25,7 +26,7 @@ export const PartnersStats = () => { hashtag = hashtag.slice(1); } hashtag = hashtag.toLowerCase(); - const response = await fetch(OHSOME_STATS_BASE_URL+'/stats/hashtags/' + hashtag); + const response = await fetch(OHSOME_STATS_BASE_URL + '/stats/hashtags/' + hashtag); if (response.ok) { const jsonData = await response.json(); if (jsonData.result !== undefined && Object.keys(jsonData.result).length !== 0) @@ -54,46 +55,64 @@ export const PartnersStats = () => { {!loading && error ? ( ) : ( -
-
-

{partner.name}

- {partner.primary_hashtag} +
+
+ {/* logo */} + logo + + +
-
-
- + {/* social logos */} + -
-

- -

-
- -
- - - - - -
+ + + + +
+

+ +

+
-
-

- -

- -
-
-

- -

- -
)} From a6e5e5dec51a21f4bf8f0ab0b432787b5c3cceb8 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Thu, 11 Jul 2024 16:59:50 +0545 Subject: [PATCH 08/12] Add `Resources` tab for other links in `Partners Page` --- .../components/partners/partnersResources.js | 54 +-------------- frontend/src/views/partnersStats.js | 65 ++++++++++++------- 2 files changed, 44 insertions(+), 75 deletions(-) diff --git a/frontend/src/components/partners/partnersResources.js b/frontend/src/components/partners/partnersResources.js index bbe35855a8..05a327fcc3 100644 --- a/frontend/src/components/partners/partnersResources.js +++ b/frontend/src/components/partners/partnersResources.js @@ -1,47 +1,6 @@ -import { TwitterIcon, FacebookIcon, InstagramIcon } from '../svgIcons'; import { CustomButton } from '../button'; export const Resources = ({ partner }) => { - const renderSocialButtons = () => { - const socialLinks = [ - { - name: 'link_x', - label: 'Twitter', - icon: , - }, - { name: 'link_meta', label: 'Facebook', icon: }, - { - name: 'link_instagram', - label: 'Instagram', - icon: , - }, - ]; - - return ( -
- {socialLinks.map( - (link) => - partner[link.name] && ( - - - {link.label} - - - ), - )} -
- ); - }; - const renderWebsiteLinks = () => { if (!partner || !Object.keys(partner).length) { return null; @@ -53,7 +12,7 @@ export const Resources = ({ partner }) => { url: partner[urlKeys[index]], })); return ( -
+ ); }; - return ( - <> - {renderSocialButtons()} - {renderWebsiteLinks()} - - ); + return renderWebsiteLinks(); }; diff --git a/frontend/src/views/partnersStats.js b/frontend/src/views/partnersStats.js index da7f60a924..238582a7f2 100644 --- a/frontend/src/views/partnersStats.js +++ b/frontend/src/views/partnersStats.js @@ -2,12 +2,14 @@ import React, { useEffect, useState } from 'react'; import { Link, useParams } from 'react-router-dom'; import ReactPlaceholder from 'react-placeholder'; import { FormattedMessage } from 'react-intl'; + import messages from './messages'; import { NotFound } from './notFound'; import { useFetch } from '../hooks/UseFetch'; import { StatsSection } from '../components/partners/partnersStats'; import { Activity } from '../components/partners/partnersActivity'; import { CurrentProjects } from '../components/partners/currentProjects'; +import { Resources } from '../components/partners/partnersResources'; import { OHSOME_STATS_BASE_URL } from '../config'; import { Button } from '../components/button'; import { TwitterIcon, FacebookIcon, InstagramIcon } from '../components/svgIcons'; @@ -75,30 +77,36 @@ export const PartnersStats = () => { ?.join(', ')}

- - - - - - - - - + {!!partner.link_x && ( + + + + )} + {!!partner.link_meta && ( + + + + )} + {!!partner.link_instagram && ( + + + + )}
@@ -106,6 +114,15 @@ export const PartnersStats = () => { + {/* resources section */} +
+

+ +

+ +
+ + {/* activity section */}

From 736cd5fa394296dc4d565196b094b738c8370475 Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Thu, 11 Jul 2024 17:00:16 +0545 Subject: [PATCH 09/12] Show `Resources` tab only when links are available --- frontend/src/views/partnersStats.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/partnersStats.js b/frontend/src/views/partnersStats.js index 238582a7f2..0a990931f3 100644 --- a/frontend/src/views/partnersStats.js +++ b/frontend/src/views/partnersStats.js @@ -115,12 +115,14 @@ export const PartnersStats = () => { {/* resources section */} -
-

- -

- -
+ {Object.keys(partner).some((key) => key.includes('name_')) && ( +
+

+ +

+ +
+ )} {/* activity section */}
From 04efae7e1c752aaf7fa7388238155ffe590e5e5e Mon Sep 17 00:00:00 2001 From: royallsilwallz Date: Thu, 11 Jul 2024 17:07:44 +0545 Subject: [PATCH 10/12] Fix grey background color in switch component --- frontend/src/components/formInputs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/formInputs.js b/frontend/src/components/formInputs.js index fa4a390ed2..1fc24302c9 100644 --- a/frontend/src/components/formInputs.js +++ b/frontend/src/components/formInputs.js @@ -29,7 +29,7 @@ export const SwitchToggle = ({ labelPosition, small = false, }: Object) => ( -
+
{label && labelPosition !== 'right' && {label}}
Date: Thu, 11 Jul 2024 17:28:49 +0545 Subject: [PATCH 11/12] Show only 2 primary hashtags in `Partners` card view --- frontend/src/components/partners/partners.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/partners/partners.js b/frontend/src/components/partners/partners.js index ef9058f19a..8b8007869b 100644 --- a/frontend/src/components/partners/partners.js +++ b/frontend/src/components/partners/partners.js @@ -94,7 +94,9 @@ export function PartnersCard({ details }) {

{details.name}

-

{details.primary_hashtag}

+

+ {details?.primary_hashtag?.split(',')?.slice(0, 2)?.join(',')} +

From af1b0a8de037be446b9ff9699e17713dc314fd9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:46:21 +0000 Subject: [PATCH 12/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/pull_request_template.md | 2 +- .github/workflows/ecs-deploy.yml | 3 --- docs/sysadmins/ci-cd.md | 2 +- docs/sysadmins/deployment.md | 4 ++-- frontend/src/locales/en.json | 2 +- .../tasking-manager.template.js | 24 +++++++++---------- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index eb790148c2..7c560f4e9f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -36,6 +36,6 @@ Notes for the reviewer. How to test this change? - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages. - 📗 Update any related documentation and include any relevant screenshots. -- 🔠 Does this PR introduce or change any environment variables? If so, make sure to specify this change in the description. +- 🔠 Does this PR introduce or change any environment variables? If so, make sure to specify this change in the description. ## [optional] What gif best describes this PR or how it makes you feel? diff --git a/.github/workflows/ecs-deploy.yml b/.github/workflows/ecs-deploy.yml index 1958b26c80..25e355e557 100644 --- a/.github/workflows/ecs-deploy.yml +++ b/.github/workflows/ecs-deploy.yml @@ -97,6 +97,3 @@ jobs: service: ${{ env.ECS_SERVICE }} cluster: ${{ env.ECS_CLUSTER }} wait-for-service-stability: true - - - diff --git a/docs/sysadmins/ci-cd.md b/docs/sysadmins/ci-cd.md index 5c15ff5b0c..95d9a19345 100644 --- a/docs/sysadmins/ci-cd.md +++ b/docs/sysadmins/ci-cd.md @@ -10,7 +10,7 @@ We use CircleCI to manage Continuous Integration and Continuous Deployment. | TeachOSM | deployment/teachosm-tasking-manager | | Indonesia | deployment/id-tasking-manager | -Each environment has its own set of environment variables which are stored as secrets in the CircleCI Organization Settings under Contexts. At the moment, these variables are for the frontend builds only. See the [deployment docs](deployment.md) for updating backend variables. +Each environment has its own set of environment variables which are stored as secrets in the CircleCI Organization Settings under Contexts. At the moment, these variables are for the frontend builds only. See the [deployment docs](deployment.md) for updating backend variables. - OPSGENIE_API - TM_APP_API_URL diff --git a/docs/sysadmins/deployment.md b/docs/sysadmins/deployment.md index 0186668318..d33cf445b3 100644 --- a/docs/sysadmins/deployment.md +++ b/docs/sysadmins/deployment.md @@ -36,7 +36,7 @@ aws s3 sync build/ --delete When deploying updates to the infrastructure or code, follow the steps below. #### Backup Database -Before updating it's always recommended to backup the database. You can make a snapshot in AWS RDS console, or run the database dump directly. You will need sufficient access to a server on the same VPC as the RDS instance in order to connect to it directly. +Before updating it's always recommended to backup the database. You can make a snapshot in AWS RDS console, or run the database dump directly. You will need sufficient access to a server on the same VPC as the RDS instance in order to connect to it directly. ``` PGPASSWORD= pg_dump -Fc \ @@ -48,7 +48,7 @@ PGPASSWORD= pg_dump -Fc \ #### Update backend infrastructure -If the deployment contains any changes to the cloudformation template, including new or changes to environment variables, then we must update the infrastructure prior to deployment. These changes are deliberately set outside the CI/CD process to prevent accidental deletion of data. For the HOT Tasking Manager, only staff with sufficient AWS privileges have the ability to perform these functions. +If the deployment contains any changes to the cloudformation template, including new or changes to environment variables, then we must update the infrastructure prior to deployment. These changes are deliberately set outside the CI/CD process to prevent accidental deletion of data. For the HOT Tasking Manager, only staff with sufficient AWS privileges have the ability to perform these functions. 1. Pull the latest changes locally 2. Run the `cfn-config update` command, keeping in mind to update any new parameters that were added. diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 4141ede5e1..d49f245145 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -1329,4 +1329,4 @@ "pages.edit_project.sections.custom_editor": "Custom Editor", "pages.create_campaign.duplicate": "A campaign with the same name already exists", "pages.create_campaign.error": "There was an error saving this campaign." -} \ No newline at end of file +} diff --git a/scripts/aws/cloudformation/tasking-manager.template.js b/scripts/aws/cloudformation/tasking-manager.template.js index ae1025b03d..d5dc21ec30 100644 --- a/scripts/aws/cloudformation/tasking-manager.template.js +++ b/scripts/aws/cloudformation/tasking-manager.template.js @@ -654,10 +654,10 @@ const Resources = { SecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'elbs-security-group', cf.region]))], Subnets: cf.ref('ELBSubnets'), Type: 'application', - Tags: [ { - "Key": "stack_name", - "Value": cf.stackName - }, + Tags: [ { + "Key": "stack_name", + "Value": cf.stackName + }, { Key: 'project', Value: 'tasking-manager' @@ -726,11 +726,11 @@ const Resources = { Port: 8000, Protocol: 'HTTP', VpcId: cf.importValue(cf.join('-', ['hotosm-network-production', 'default-vpc', cf.region])), - Tags: [ - { - "Key": "stack_name", - "Value": cf.stackName - }, + Tags: [ + { + "Key": "stack_name", + "Value": cf.stackName + }, { Key: 'project', Value: 'tasking-manager' @@ -809,7 +809,7 @@ const Resources = { DBSnapshotIdentifier: cf.if('UseASnapshot', cf.ref('DBSnapshot'), cf.noValue), VPCSecurityGroups: [cf.importValue(cf.join('-', ['hotosm-network-production', cf.ref('NetworkEnvironment'), 'ec2s-security-group', cf.region]))], PubliclyAccessible: false, - Tags: [ + Tags: [ { Key: 'project', Value: 'tasking-manager' @@ -838,7 +838,7 @@ const Resources = { IndexDocument: 'index.html' }, AccessControl: "Private", - Tags: [ + Tags: [ { Key: 'project', Value: 'tasking-manager' @@ -985,7 +985,7 @@ const Resources = { SslSupportMethod: 'sni-only' } }, - Tags: [ + Tags: [ { Key: 'project', Value: 'tasking-manager'