Skip to content

Commit 8dbe53c

Browse files
authored
Merge pull request #938 from AppQuality/insights-card-fixes
fixed observation cards UI
2 parents fc28188 + 8fdc94a commit 8dbe53c

File tree

4 files changed

+30
-22
lines changed

4 files changed

+30
-22
lines changed

src/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@
768768
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_QUOTES_LABEL": "Quotes",
769769
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_SELECT_BUTTON_LABEL": "Select observation",
770770
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_TAGS_LABEL": "Extra tags",
771-
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_VIEW_DETAILS": "View details",
771+
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_VIEW_DETAILS": "View more",
772772
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_CANCEL": "Cancel",
773773
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_CREATE_INSIGHT": "Create insight",
774774
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_EDIT_INSIGHT": "Update insight",

src/locales/it/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@
795795
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_QUOTES_LABEL": "",
796796
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_SELECT_BUTTON_LABEL": "",
797797
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_LIGHTBOX_TAGS_LABEL": "",
798-
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_VIEW_DETAILS": "",
798+
"__INSIGHTS_COLLECTION_OBSERVATION_CARD_VIEW_DETAILS": "Vedi di più",
799799
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_CANCEL": "Annulla",
800800
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_CREATE_INSIGHT": "",
801801
"__INSIGHTS_PAGE_ACTION_BAR_BUTTON_EDIT_INSIGHT": "",

src/pages/Campaign/pageHeader/Meta/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export const Metas = ({ campaign }: { campaign: CampaignWithOutput }) => {
7979

8080
const { start_date, end_date, type, status, outputs, family } = campaign;
8181
const { t } = useTranslation();
82-
const { sorted: videos } = useVideo(campaign.id.toString() ?? '');
82+
const {
83+
sorted: videos,
84+
isLoading: isLoadingVideos,
85+
isFetching: isFetchingVideos,
86+
} = useVideo(campaign.id.toString() ?? '');
8387
const { hasFeatureFlag } = useFeatureFlag();
8488
const hasTaggingToolFeature = hasFeatureFlag(FEATURE_FLAG_TAGGING_TOOL);
8589

@@ -101,7 +105,8 @@ export const Metas = ({ campaign }: { campaign: CampaignWithOutput }) => {
101105
}
102106
}, [videos]);
103107

104-
if (isLoading || isFetching) return <Skeleton width="200px" height="20px" />;
108+
if (isLoading || isFetching || isLoadingVideos || isFetchingVideos)
109+
return <Skeleton width="500px" height="20px" />;
105110

106111
return (
107112
<FooterContainer>

src/pages/Insights/Collection/ObservationCard.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ import {
99
SpecialCard,
1010
Tag,
1111
} from '@appquality/unguess-design-system';
12+
import { FieldArray, FieldArrayRenderProps, useFormikContext } from 'formik';
13+
import { useMemo, useState } from 'react';
1214
import { useTranslation } from 'react-i18next';
1315
import { appTheme } from 'src/app/theme';
14-
import { Grape, VideoTag } from 'src/features/api';
16+
import { ReactComponent as TrashIcon } from 'src/assets/icons/trash-stroke.svg';
17+
import { getDeviceIcon } from 'src/common/components/BugDetail/Meta';
1518
import { Pipe } from 'src/common/components/Pipe';
16-
import { useMemo, useState } from 'react';
1719
import { getColorWithAlpha } from 'src/common/utils';
20+
import { Grape, VideoTag } from 'src/features/api';
1821
import { styled } from 'styled-components';
19-
import { FieldArray, FieldArrayRenderProps, useFormikContext } from 'formik';
20-
import { getDeviceIcon } from 'src/common/components/BugDetail/Meta';
21-
import { ReactComponent as TrashIcon } from 'src/assets/icons/trash-stroke.svg';
22-
import { LightboxContainer } from './Lightbox';
2322
import { InsightFormValues } from '../FormProvider';
23+
import { LightboxContainer } from './Lightbox';
2424

2525
const StyledTag = styled(Tag)`
2626
user-select: none;
@@ -29,6 +29,7 @@ const StyledTag = styled(Tag)`
2929

3030
const StyledAnchor = styled(Anchor)`
3131
user-select: none;
32+
font-size: ${appTheme.fontSizes.sm};
3233
`;
3334

3435
const StyledSpecialCard = styled(SpecialCard)<{
@@ -41,11 +42,6 @@ const StyledSpecialCard = styled(SpecialCard)<{
4142
`
4243
border-color: ${severity.tag.style};
4344
`}
44-
${({ isChecked }) =>
45-
isChecked &&
46-
`
47-
border-color: ${appTheme.palette.blue[600]};
48-
`}
4945
border-width: 2px;
5046
`;
5147

@@ -54,8 +50,9 @@ const Quotes = styled.span<{ isChecked: boolean }>`
5450
cursor: text;
5551
${({ isChecked }) =>
5652
`color: ${
57-
isChecked ? appTheme.palette.blue[600] : appTheme.palette.grey[700]
53+
isChecked ? appTheme.palette.blue[600] : appTheme.palette.grey[800]
5854
};`}
55+
font-size: ${appTheme.fontSizes.md};
5956
`;
6057

6158
export const ObservationCard = ({
@@ -68,7 +65,7 @@ export const ObservationCard = ({
6865
const { t } = useTranslation();
6966
const [isLightboxOpen, setIsLightboxOpen] = useState(false);
7067
const { values, setFieldValue } = useFormikContext<InsightFormValues>();
71-
const quotesMaxChars = 50;
68+
const quotesMaxChars = 250;
7269

7370
const severity = observation.tags.find(
7471
(tag) => tag.group.name === 'severity'
@@ -152,7 +149,9 @@ export const ObservationCard = ({
152149
{observation.deviceType && (
153150
<>
154151
{!hideCheckbox && <Pipe />}
155-
{getDeviceIcon(observation.deviceType)}
152+
<Tag size="large" isRound>
153+
{getDeviceIcon(observation.deviceType)}
154+
</Tag>
156155
</>
157156
)}
158157
{observation.usecaseTitle && (
@@ -173,7 +172,12 @@ export const ObservationCard = ({
173172
</SpecialCard.Meta>
174173

175174
<SpecialCard.Header>
176-
<SpecialCard.Header.Label style={{ userSelect: 'none' }}>
175+
<SpecialCard.Header.Label
176+
style={{
177+
userSelect: 'none',
178+
color: appTheme.palette.grey[600],
179+
}}
180+
>
177181
{title}
178182
</SpecialCard.Header.Label>
179183
<SpecialCard.Header.Title
@@ -201,7 +205,7 @@ export const ObservationCard = ({
201205
{observation.uploaderId > 0 && (
202206
<SM
203207
style={{
204-
color: appTheme.palette.grey[600],
208+
color: appTheme.palette.grey[700],
205209
marginBottom: appTheme.space.xs,
206210
}}
207211
>
@@ -211,7 +215,7 @@ export const ObservationCard = ({
211215
<div style={{ display: 'flex', alignItems: 'center' }}>
212216
{severity && (
213217
<StyledTag
214-
size="small"
218+
size="medium"
215219
color={severity.tag.style}
216220
style={{
217221
backgroundColor: getColorWithAlpha(
@@ -252,7 +256,6 @@ export const ObservationCard = ({
252256

253257
<SpecialCard.Footer>
254258
<StyledAnchor
255-
isExternal
256259
onClick={(e) => {
257260
e.stopPropagation();
258261
setIsLightboxOpen(true);

0 commit comments

Comments
 (0)