From 08680b9c3f31ac913b6bfd05fe94670578e77cb6 Mon Sep 17 00:00:00 2001 From: phpfs Date: Tue, 13 Jul 2021 18:43:52 +0200 Subject: [PATCH 1/4] Add sync button --- .../ActivityIndicator/ActivityIndicator.View.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx index b59bfb77..3a9f600c 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx @@ -1,6 +1,8 @@ -import { IonSpinner } from '@ionic/react'; +import { IonIcon, IonSpinner } from '@ionic/react'; import { ActivityIndicatorProps } from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps'; import styles from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css'; +import { doRefreshCentralResources } from 'apps/SnowmanApp/store/CentralResourcesDoActions'; +import { refreshOutline } from 'ionicons/icons'; import React from 'react'; const ActivityIndicatorView = ({ @@ -9,7 +11,15 @@ const ActivityIndicatorView = ({ <> {existsActiveRequest ? ( - ) : null} + ) : ( + doRefreshCentralResources()} + /> + )} ); From 387981d8604c431959341dfd222929337b8d7f4c Mon Sep 17 00:00:00 2001 From: phpfs Date: Tue, 13 Jul 2021 18:45:53 +0200 Subject: [PATCH 2/4] Add proper styling --- .../components/ActivityIndicator/ActivityIndicator.View.tsx | 2 +- .../ActivityIndicator/ActivityIndicatorStyles.module.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx index 3a9f600c..0e60cc90 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx @@ -16,7 +16,7 @@ const ActivityIndicatorView = ({ icon={refreshOutline} slot="icon-only" size="large" - className={styles.spinnerWhite} + className={styles.buttonWhite} onClick={() => doRefreshCentralResources()} /> )} diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css index 6c82f0e0..a2239954 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css @@ -1,3 +1,8 @@ .spinnerWhite { color: #fff !important; } + +.buttonWhite { + color: #fff !important; + cursor: pointer; +} From 730dd3577253be63c1f7d280bd76fcc51fe3d596 Mon Sep 17 00:00:00 2001 From: phpfs Date: Tue, 13 Jul 2021 18:55:24 +0200 Subject: [PATCH 3/4] Implement proper HoC --- .../ActivityIndicator/ActivityIndicator.View.tsx | 4 ++-- .../ActivityIndicator/ActivityIndicator.tsx | 15 +++++++++++++-- .../ActivityIndicator/ActivityIndicatorProps.ts | 7 ++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx index 0e60cc90..fdc3db1a 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View.tsx @@ -1,12 +1,12 @@ import { IonIcon, IonSpinner } from '@ionic/react'; import { ActivityIndicatorProps } from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps'; import styles from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorStyles.module.css'; -import { doRefreshCentralResources } from 'apps/SnowmanApp/store/CentralResourcesDoActions'; import { refreshOutline } from 'ionicons/icons'; import React from 'react'; const ActivityIndicatorView = ({ existsActiveRequest, + triggerRefresh, }: ActivityIndicatorProps): JSX.Element => ( <> {existsActiveRequest ? ( @@ -17,7 +17,7 @@ const ActivityIndicatorView = ({ slot="icon-only" size="large" className={styles.buttonWhite} - onClick={() => doRefreshCentralResources()} + onClick={triggerRefresh} /> )} diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.tsx b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.tsx index 49ae68ff..16192b61 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.tsx +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.tsx @@ -1,8 +1,13 @@ import ActivityIndicatorView from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicator.View'; -import { ActivityIndicatorStateProps } from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps'; +import { + ActivityIndicatorDispatchProps, + ActivityIndicatorStateProps, +} from 'apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps'; +import { refreshCentralResources } from 'apps/SnowmanApp/store/CentralResourcesActions'; import { SnowmanAppMagistrate } from 'apps/SnowmanApp/store/SnowmanAppStore'; import { SnowmanAppModel } from 'apps/SnowmanApp/types/SnowmanAppModel'; import { connect } from 'react-redux'; +import { SnowmanDispatch } from 'types/SnowmanDispatch'; import GenericStoreComponentFactory from 'utils/GenericStoreComponentFactory'; const mapStateToProps = ( @@ -11,9 +16,15 @@ const mapStateToProps = ( existsActiveRequest: state.ActionLogicStore.ongoingRequestsCount > 0, }); +const mapDispatchToProps = ( + dispatch: SnowmanDispatch +): ActivityIndicatorDispatchProps => ({ + triggerRefresh: () => dispatch(refreshCentralResources()), +}); + export const ActivityIndicator = GenericStoreComponentFactory( SnowmanAppMagistrate, - connect(mapStateToProps)(ActivityIndicatorView) + connect(mapStateToProps, mapDispatchToProps)(ActivityIndicatorView) ); export default ActivityIndicator; diff --git a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps.ts b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps.ts index e33ae228..966c91c6 100644 --- a/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps.ts +++ b/app/src/apps/SnowmanApp/components/ActivityIndicator/ActivityIndicatorProps.ts @@ -2,4 +2,9 @@ export interface ActivityIndicatorStateProps { existsActiveRequest: boolean; } -export type ActivityIndicatorProps = ActivityIndicatorStateProps; +export interface ActivityIndicatorDispatchProps { + triggerRefresh: () => void; +} + +export type ActivityIndicatorProps = ActivityIndicatorStateProps & + ActivityIndicatorDispatchProps; From 0c5d377e85bbb78d98399337c68b174733c2793e Mon Sep 17 00:00:00 2001 From: phpfs Date: Tue, 13 Jul 2021 19:04:11 +0200 Subject: [PATCH 4/4] Raise version number --- app/package.json | 2 +- package.json | 2 +- wrapper/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/package.json b/app/package.json index bbe843fd..1ece11ec 100644 --- a/app/package.json +++ b/app/package.json @@ -2,7 +2,7 @@ "name": "snowman-app", "author": "Snowman Team", "description": "Compare data matching algorithms with each other", - "version": "3.1.0", + "version": "3.2.1", "license": "MIT", "homepage": "./", "scripts": { diff --git a/package.json b/package.json index 318cbc88..faa87d62 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "snowman", "author": "Snowman Team", "description": "Compare data matching algorithms with each other", - "version": "3.1.0", + "version": "3.2.1", "license": "MIT", "repository": "https://github.com/HPI-Information-Systems/snowman", "scripts": { diff --git a/wrapper/package.json b/wrapper/package.json index 5194f4c8..91dde86d 100644 --- a/wrapper/package.json +++ b/wrapper/package.json @@ -2,7 +2,7 @@ "name": "snowman-wrapper", "author": "Snowman Team", "description": "Compare data matching algorithms with each other", - "version": "3.1.0", + "version": "3.2.1", "license": "MIT", "main": "dist/main.js", "scripts": {