Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev into master #1011

Merged
merged 39 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9b7b9fb
[Feat-885] Add selection for stack bar graphs (#935)
shaked-hayek Nov 26, 2022
15ff26a
add conditional label, refactor utils (#938)
danielsh28 Nov 26, 2022
57e0788
Update .env.staging (#947)
atalyaalon Feb 8, 2023
1a372a2
Add critical indication (#948)
carmelp16 Mar 1, 2023
dcdb07d
add alt attrinbte on image tag (#951)
EyalIlan Mar 3, 2023
a3833ea
Update .env.staging (#952)
atalyaalon Mar 5, 2023
8c0fd68
Make critical filter non local (#958)
carmelp16 Mar 22, 2023
4e536ab
Update News.tsx (#961)
atalyaalon Apr 25, 2023
dd9febf
Update news-flash-store.ts (#962)
atalyaalon Apr 25, 2023
7b67d07
Update News.tsx
atalyaalon Apr 25, 2023
a06502e
Update thank-you-names.csv
atalyaalon May 29, 2023
61a492e
transaction dialog box (#966)
atalyaalon Jun 24, 2023
78a9b5d
Merge branch 'master' into dev
atalyaalon Jun 24, 2023
c0132b1
[Feat-925] Add location approval feature (#969)
shaked-hayek Jul 12, 2023
63826f0
Feature add transcrption 4 widgets 957 (#968)
EyalIlan Jul 13, 2023
54922d7
Merge branch 'master' into dev
atalyaalon Jul 13, 2023
f6e4673
add widget vision_10_30_90 (#972)
EyalIlan Aug 2, 2023
0eeb69a
Feature widget vision zero 10 50 90 (#975)
EyalIlan Aug 2, 2023
6cc8984
Merge branch 'master' into dev
atalyaalon Aug 2, 2023
97794f6
change the location of the start command in package.json (#977)
Shai2022 Aug 16, 2023
95ed077
add logo (#979)
atalyaalon Aug 29, 2023
f37a40f
add natun square logo (#982)
atalyaalon Sep 4, 2023
6b0c6c3
add widget lower bar (#981)
EyalIlan Sep 5, 2023
9101077
Merge branch 'master' into dev
atalyaalon Sep 5, 2023
69fb2af
update logo (#980)
atalyaalon Sep 8, 2023
3eb5bcb
Update Footer.tsx (#986)
atalyaalon Sep 8, 2023
f3fb4b9
add data-for-change (#988)
atalyaalon Sep 8, 2023
f09d197
Delete src/assets/hasadna.png (#989)
atalyaalon Sep 8, 2023
672afe7
Merge branch 'master' into dev
atalyaalon Sep 8, 2023
93ecda1
Bug click twice to change news backround (#984)
EyalIlan Sep 13, 2023
f659f41
Add dev-to-prod auth server change (#950)
BarVolunteering Sep 27, 2023
24e2992
Spliting title and subtitle, making title bold (#995)
shaked-hayek Dec 24, 2023
d432d0e
Change design in bar widgets (#996)
shaked-hayek Dec 24, 2023
19f4cea
Remove margin from bottom of bar charts (#1001)
shaked-hayek Dec 26, 2023
ce668f8
Add check for user authentication in NewsFlash (#990) (#1003)
shaked-hayek Dec 26, 2023
21b0955
Merge branch 'master' into dev
atalyaalon Dec 26, 2023
9d1cabb
Fix subtitle param in CardEditor (#1005) (#1006)
shaked-hayek Dec 26, 2023
ab01c7c
Remove padding from bottom of stack bars (#1008) (#1009)
shaked-hayek Dec 27, 2023
81875d9
Open new widgets to production (#1012) (#1013)
shaked-hayek Dec 27, 2023
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
2 changes: 1 addition & 1 deletion src/components/molecules/GenericBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const BarChartContainer: FC<IBarChartBaseProps> = ({ data, textLabel, subtitle,
style={{ fill: blackColor }}
/>
<Tooltip />
{isStacked && <Legend verticalAlign="bottom" align="right" iconType="circle" height={35} />}
{isStacked && <Legend verticalAlign="bottom" align="right" iconType="circle" height={5} />}
{children}
</BarChart>
</ResponsiveContainer>
Expand Down
11 changes: 5 additions & 6 deletions src/components/molecules/NewsFlashComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import LocationApprove from 'components/organisms/LocationApproveWindow';
import {locationQualificationOptions} from 'components/organisms/LocationApproveWindow';
import { INewsFlash } from 'models/NewFlash';
import {useParams} from 'react-router-dom'
import { observer } from "mobx-react-lite";

const ICON_HEIGHT = 18

Expand All @@ -38,7 +39,6 @@ const NewsFlashComp: FC<IProps> = ({ news }) => {
const locale = useLocale();
const { userStore, settingsStore } = store;
const { t } = useTranslation();
const userAllowedChange = userStore.isUserAuthenticated && userStore.isAdmin;

function getVerificationIcon(verificationText: string) {
if (verificationText === locationQualificationOptions.REJECTED) {
Expand All @@ -58,16 +58,16 @@ const NewsFlashComp: FC<IProps> = ({ news }) => {
const criticalIcon = news.critical && <CriticalIcon className={classes.icon} />;
const {newsId} = useParams()
const newsID = newsId ? parseInt(newsId) : ''

const className = news.id === newsID ? classes.activeNewsFlash : '';

const date = news.date == null ? '' : dateFormat(new Date(news.date.replace(/-/g, '/')), locale);
const handleLocationEditorOpen = () => setOpen(true);
const handleLocationEditorClose = () => setOpen(false);
const locationChangeButton = userAllowedChange &&

const locationChangeButton = userStore.isUserAdmin &&
<Button.Small onClick={handleLocationEditorOpen} buttonHeight={ICON_HEIGHT}>
{t('changeLocationButton')}
</Button.Small>

return (
<Link key={news.id} to={`${settingsStore.currentLanguageRouteString}/newsflash/${news.id}`}>
<Box border={1} borderColor={silverSmokeColor} p={1} className={className}>
Expand All @@ -84,8 +84,7 @@ const NewsFlashComp: FC<IProps> = ({ news }) => {
<LocationApprove isOpen={isOpen} onClose={handleLocationEditorClose}
newFlashTitle={date.concat(", ", news.display_source)} news={news} />
</Link>

);
}

export default NewsFlashComp;
export default observer(NewsFlashComp);
3 changes: 2 additions & 1 deletion src/components/organisms/CardEditorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const CardEditor: FC<IProps> = ({ isOpen, onClose, widgetName, text }) => {
actionButtons={false}
sizeOptions={sizeOptions}
dateComment={dateComment}
title={text}
title={widget?.data?.text?.title}
subtitle={widget?.data?.text?.subtitle}
>
<MetaTag>{widgetName}</MetaTag>
<ErrorBoundary>{widgetComponent}</ErrorBoundary>
Expand Down
8 changes: 6 additions & 2 deletions src/const/cards.const.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { WidgetName } from 'models/WidgetName';
import orYarokLogo from 'assets/greenlight.png';

// cards is this least will be avaiaable for operation environments (all non-staging environments)
// cards in this list will be available for operation environments (all non-staging environments)
export const operationalCards: WidgetName[] = [
WidgetName.accident_count_by_severity,
WidgetName.most_severe_accidents_table,
WidgetName.most_severe_accidents,
WidgetName.head_on_collisions_comparison_percentage,
WidgetName.vision_zero_2_plus_1,
WidgetName.injured_count_by_severity,
WidgetName.accidents_heat_map
WidgetName.accidents_heat_map,
WidgetName.accident_count_by_accident_year,
WidgetName.injured_count_by_accident_year,
WidgetName.accident_count_by_driver_type,
WidgetName.accident_count_by_day_night
];

export type OrgLogoData = {key : string, path:string} ;
Expand Down
4 changes: 4 additions & 0 deletions src/store/user.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default class UserStore {
return this.userInfo?.data.organizations;
}

get isUserAdmin(){
return this.isUserAuthenticated && this.isAdmin;
}

get usersManagementTableData(): any {
return this.usersInfoList?.map((user) => ({
name: `${user.first_name} ${user.last_name}`,
Expand Down