From c00117759ce70068d7bf18d5dd962cd09bb80416 Mon Sep 17 00:00:00 2001 From: Asmi Garg Date: Fri, 10 Jan 2025 13:05:40 +0530 Subject: [PATCH 1/3] Fix: Render markdown correctly for short descriptions --- babel-jest | 0 chokidar | 0 frontend/src/components/projectCard/priorityBox.js | 2 +- frontend/src/components/projectCard/projectCard.js | 8 +++++--- "fsevents@1.2.13\357\200\272" | 0 webpack-dev-server | 0 6 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 babel-jest create mode 100644 chokidar create mode 100644 "fsevents@1.2.13\357\200\272" create mode 100644 webpack-dev-server diff --git a/babel-jest b/babel-jest new file mode 100644 index 0000000000..e69de29bb2 diff --git a/chokidar b/chokidar new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frontend/src/components/projectCard/priorityBox.js b/frontend/src/components/projectCard/priorityBox.js index 6a28b7f4f2..5734c39029 100644 --- a/frontend/src/components/projectCard/priorityBox.js +++ b/frontend/src/components/projectCard/priorityBox.js @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl'; import messages from './messages'; import { ClockIcon } from '../svgIcons'; -export function PriorityBox({ priority, extraClasses, showIcon }: Object) { +export function PriorityBox({ priority, extraClasses, showIcon }) { let color = 'blue-grey b--blue-grey'; if (priority === 'URGENT') color = 'red b--red'; if (priority === 'HIGH') color = 'orange b--orange'; diff --git a/frontend/src/components/projectCard/projectCard.js b/frontend/src/components/projectCard/projectCard.js index e87de365b3..69f2f5c6a9 100644 --- a/frontend/src/components/projectCard/projectCard.js +++ b/frontend/src/components/projectCard/projectCard.js @@ -1,3 +1,4 @@ +import ReactMarkdown from 'react-markdown'; import { useState } from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; @@ -18,7 +19,7 @@ export function ProjectTeaser({ className, littleFont = 'f7', bigFont = 'f6', -}: Object) { +}) { /* outerDivStyles must have f6 even if sub-divs have f7 to fix grid issues*/ const outerDivStyles = 'f6 tl blue-grey truncate mb2'; @@ -63,7 +64,7 @@ export function ProjectCard({ percentValidated, totalContributors, showBottomButtons = false, -}: Object) { +}) { const [isHovered, setHovered] = useState(false); const linkCombo = 'link pa2 f6 ba b--grey-light di w-50 truncate tc'; @@ -126,7 +127,8 @@ export function ProjectCard({
- {shortDescription} {campaignTag ? ' · ' + campaignTag : ''} + {shortDescription} + {campaignTag ? ' · ' + campaignTag : ''}
diff --git "a/fsevents@1.2.13\357\200\272" "b/fsevents@1.2.13\357\200\272" new file mode 100644 index 0000000000..e69de29bb2 diff --git a/webpack-dev-server b/webpack-dev-server new file mode 100644 index 0000000000..e69de29bb2 From c7b92c030c8799c6e3d760560f8493ce5b60188e Mon Sep 17 00:00:00 2001 From: Asmi Garg Date: Fri, 10 Jan 2025 13:48:52 +0530 Subject: [PATCH 2/3] Made changes to improve maintainibily rating --- frontend/src/components/projectCard/priorityBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/projectCard/priorityBox.js b/frontend/src/components/projectCard/priorityBox.js index 5734c39029..6a28b7f4f2 100644 --- a/frontend/src/components/projectCard/priorityBox.js +++ b/frontend/src/components/projectCard/priorityBox.js @@ -3,7 +3,7 @@ import { FormattedMessage } from 'react-intl'; import messages from './messages'; import { ClockIcon } from '../svgIcons'; -export function PriorityBox({ priority, extraClasses, showIcon }) { +export function PriorityBox({ priority, extraClasses, showIcon }: Object) { let color = 'blue-grey b--blue-grey'; if (priority === 'URGENT') color = 'red b--red'; if (priority === 'HIGH') color = 'orange b--orange'; From 26d16b6a2cdf17fc10ae4be6aab3c4d0fb070745 Mon Sep 17 00:00:00 2001 From: Asmi Garg Date: Fri, 10 Jan 2025 13:57:04 +0530 Subject: [PATCH 3/3] improve maintainability factor --- frontend/src/components/projectCard/projectCard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/projectCard/projectCard.js b/frontend/src/components/projectCard/projectCard.js index 69f2f5c6a9..0790468a31 100644 --- a/frontend/src/components/projectCard/projectCard.js +++ b/frontend/src/components/projectCard/projectCard.js @@ -19,7 +19,7 @@ export function ProjectTeaser({ className, littleFont = 'f7', bigFont = 'f6', -}) { +}: Object) { /* outerDivStyles must have f6 even if sub-divs have f7 to fix grid issues*/ const outerDivStyles = 'f6 tl blue-grey truncate mb2'; @@ -64,7 +64,7 @@ export function ProjectCard({ percentValidated, totalContributors, showBottomButtons = false, -}) { +}: Object) { const [isHovered, setHovered] = useState(false); const linkCombo = 'link pa2 f6 ba b--grey-light di w-50 truncate tc';