From 1f8b61f9a673f4553cf88f437589b138732676ca Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Thu, 25 Oct 2018 07:45:22 +0200 Subject: [PATCH] load preferences --- public/app/features/org/OrgDetailsPage.tsx | 131 +++++++++++++++++++++ public/app/features/org/state/actions.ts | 40 +++++++ public/app/features/org/state/reducers.ts | 23 ++++ public/app/routes/routes.ts | 7 +- public/app/store/configureStore.ts | 2 + public/app/types/index.ts | 5 + public/app/types/organisation.ts | 15 +++ 7 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 public/app/features/org/OrgDetailsPage.tsx create mode 100644 public/app/features/org/state/actions.ts create mode 100644 public/app/features/org/state/reducers.ts create mode 100644 public/app/types/organisation.ts diff --git a/public/app/features/org/OrgDetailsPage.tsx b/public/app/features/org/OrgDetailsPage.tsx new file mode 100644 index 00000000000..08d98e1216e --- /dev/null +++ b/public/app/features/org/OrgDetailsPage.tsx @@ -0,0 +1,131 @@ +import React, { PureComponent } from 'react'; +import { hot } from 'react-hot-loader'; +import { connect } from 'react-redux'; +import PageHeader from '../../core/components/PageHeader/PageHeader'; +import { loadOrganisation } from './state/actions'; +import { NavModel, Organisation, OrganisationPreferences, StoreState } from 'app/types'; +import { getNavModel } from '../../core/selectors/navModel'; + +export interface Props { + navModel: NavModel; + organisation: Organisation; + preferences: OrganisationPreferences; + loadOrganisation: typeof loadOrganisation; +} + +interface State { + orgName: string; + hasSet: boolean; +} + +export class OrgDetailsPage extends PureComponent { + state = { + orgName: '', + hasSet: false, + }; + + async componentDidMount() { + await this.props.loadOrganisation(); + } + + onOrgNameChange = event => { + this.setState({ + orgName: event.target.value, + }); + }; + + onSubmitForm = event => {}; + + render() { + const { navModel, preferences } = this.props; + + const themes: any = [ + { value: '', text: 'Default' }, + { value: 'dark', text: 'Dark' }, + { value: 'light', text: 'Light' }, + ]; + + return ( +
+ +
+

Organisation profile

+
+
+
+ Organization name + +
+
+ +
+ +
+
+
+

Preferences

+ +
+ UI Theme +
+ +
+
+ +
+ + Home Dashboard + {/**/} + {/*Not finding dashboard you want? Star it first, then it should appear in this select box.*/} + {/**/} + + {/**/} +
+ +
+ +
+