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

Themes #208

Open
wants to merge 300 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
104c5b2
Created button component
aswinm Apr 6, 2021
27453a7
Add button component
aswinm Apr 8, 2021
0660205
PR Comments fixes
aswinm Apr 8, 2021
1b8f7f5
PR Comments fixes
aswinm Apr 8, 2021
dd762d7
Temporary rename
aswinm Apr 8, 2021
418015f
Rename Shared to shared
aswinm Apr 8, 2021
ef2927e
Make branch mergeable
aswinm Apr 8, 2021
e59b55a
Title and Dialogue components
aswinm Apr 12, 2021
d050515
Close button component
aswinm Apr 14, 2021
927f529
PR comments
aswinm Apr 14, 2021
1502800
Formatting changes
aswinm Apr 14, 2021
631ff1d
Rebase related changes
aswinm Apr 14, 2021
d4b9180
PR Comments
aswinm Apr 15, 2021
c25c838
PR Comments
aswinm Apr 15, 2021
fc1a4a5
Icon Button
aswinm Apr 15, 2021
8bd3607
PR Comments
aswinm Apr 15, 2021
8151a8c
List compoenent added
aswinm Apr 20, 2021
ad7a446
Update checkboxlist component
aswinm Apr 21, 2021
85cf3a8
PR comments
aswinm Apr 22, 2021
eb457b0
Radio Button
aswinm Apr 22, 2021
de7e830
PR comments
aswinm Apr 22, 2021
0c16b1e
Project list component
aswinm May 3, 2021
a37c413
PR comments
aswinm May 3, 2021
814cdfe
Project list display
aswinm May 4, 2021
26c6610
Apply state
aswinm May 4, 2021
2b35dbc
PR comments
aswinm May 5, 2021
ed38baf
Project list styling
aswinm May 5, 2021
aa02f34
Project list Fixes
aswinm May 8, 2021
ceb299f
Data Selector component
aswinm May 10, 2021
79ddcc5
New Project button
aswinm May 10, 2021
541c730
Create ProjectListItem component
aswinm May 10, 2021
47d8601
Get permalink for project in list
aswinm May 10, 2021
1c6b457
Code refactor
aswinm May 10, 2021
089ebf2
Load checkboxes from Meta API
aswinm May 11, 2021
c57a8ac
Comments
aswinm May 12, 2021
d58b0cb
Popup
aswinm May 12, 2021
57d7d57
MapDecorator
aswinm May 17, 2021
115b9c7
Bugs
mapcentia May 18, 2021
01a4039
Layer switcher hooked up
mapcentia May 25, 2021
0216f61
Formatting changes
aswinm May 27, 2021
b11d046
Code cleanup
aswinm May 27, 2021
f9e7473
Code cleanup
aswinm May 28, 2021
f030833
Clean up
mapcentia May 30, 2021
9edd2dd
The two buttons "Pesticider" and "Nitrat" is now active. The last two…
mapcentia Jun 17, 2021
bfca812
Dashboard shell
aswinm May 25, 2021
dd0bcd1
Svgs added, ChemicalsListItem added
aswinm May 26, 2021
354fcca
Dashboard shell
aswinm May 28, 2021
8793bf2
React context
aswinm Jun 2, 2021
3937745
Use Context to share info
aswinm Jun 3, 2021
90e02fa
PlotComponent decoupling, populating checkbox list based on chart items
aswinm Jun 7, 2021
29d0f4f
Delete measurement functionality
aswinm Jun 9, 2021
4f05345
Remove drag and drop context code in old modal
aswinm Jun 18, 2021
61440f5
Drag and drop functionality
aswinm Jun 21, 2021
27563e7
Move functionality
aswinm Jun 21, 2021
f5a1cef
Remove profiles and plots feature
aswinm Jun 22, 2021
897cb8c
Allow dashboard mode to be set from outside
aswinm Jun 22, 2021
6f7c7b9
Allow adding a plot to dashboard via openDashboard function
aswinm Jun 23, 2021
3be6087
Searching in chemicals list
aswinm Jun 23, 2021
7ec7ff3
Accordion for chemicals list
aswinm Jun 23, 2021
b6a89ae
Fix issue with dashboard open
aswinm Jun 24, 2021
33c9889
Top Bar
aswinm Jun 25, 2021
3cc2482
Search
aswinm Jun 25, 2021
36cd853
Top bar with changes
aswinm Jun 28, 2021
e2cf677
Subscription dialogue
aswinm Jun 30, 2021
72d9f6d
Design changes
aswinm Jul 2, 2021
9a2adda
Design changes to right side menu
aswinm Jul 13, 2021
7a6d3ce
Merge remote-tracking branch 'origin/themes' into themes
mapcentia Aug 5, 2021
ee208fd
Packages
mapcentia Aug 6, 2021
44cc34a
window.Calypso.render
aswinm Aug 7, 2021
dc9d730
Show time series now works
mapcentia Aug 16, 2021
d094c92
Add to dashboard in pop-up
mapcentia Aug 17, 2021
c8540ea
Start of "Selected" list in Dashboard
mapcentia Aug 18, 2021
0f63113
Change chemicals display as per new format
aswinm Aug 31, 2021
6e84df1
Enable calculations
aswinm Sep 3, 2021
9fa4422
TODO
mapcentia Sep 13, 2021
3cc05cc
Fix schema issue
aswinm Sep 16, 2021
dd304df
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Sep 18, 2021
0b3050d
Fix data format issue
aswinm Sep 20, 2021
ed3b1c9
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Sep 20, 2021
3cc5300
Add empty onclick to avoid warning
mapcentia Sep 20, 2021
3da35e7
Add empty onclick to avoid warning
mapcentia Sep 20, 2021
0b8fc3e
Make sure key is unique
mapcentia Sep 20, 2021
d4deefd
Use locname instead of loc_id
mapcentia Sep 20, 2021
d35af6e
Don't have a fixed height on buttons
mapcentia Sep 20, 2021
4d8d047
Loop all time series and add them
mapcentia Sep 20, 2021
9f25192
Add functionality to Ny graf button
aswinm Sep 23, 2021
1a4af9c
Fetch plot layout from config
mapcentia Sep 27, 2021
130904c
Use of trace object from database
mapcentia Sep 27, 2021
5d118b6
More room for plots
mapcentia Sep 27, 2021
05bbb6b
Bug fixes
aswinm Oct 4, 2021
b7d3ed9
Fix multiple deletion issues
aswinm Oct 5, 2021
36954cb
Use of time-series names in pop-up and dashboard
mapcentia Oct 5, 2021
7ed7c49
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Oct 5, 2021
1382414
Drag and drop issue fix
aswinm Oct 6, 2021
0ee288d
Adjustments to the plot height
mapcentia Oct 11, 2021
fd232da
Open category by default and removal of hardcoded lists
mapcentia Oct 11, 2021
b55ceb5
Adjustments
mapcentia Oct 27, 2021
da86de9
Set correct name
mapcentia Oct 27, 2021
bacedb1
Buggy plot card dnd and sort is fixed
mapcentia Nov 19, 2021
2689a36
Using data property directly
mapcentia Dec 3, 2021
05b816a
Using data property directly
mapcentia Dec 7, 2021
da512d1
Using data property directly
mapcentia Dec 7, 2021
a2ef18d
Big clean up
mapcentia Dec 10, 2021
199becf
Ready for lazy load
mapcentia Dec 10, 2021
12f7702
Ready for lazy load
mapcentia Dec 10, 2021
fb92c4e
Fix
mapcentia Dec 20, 2021
eea8aaf
Fix
mapcentia Dec 20, 2021
2a7a8b0
Fix of lazy load of all ts
mapcentia Dec 20, 2021
e950cfc
Fix of lazy load of all ts
mapcentia Dec 20, 2021
09d0f7c
Clean up
mapcentia Dec 20, 2021
b8192fd
Clean up
mapcentia Dec 20, 2021
0508ee9
Ready for a description
mapcentia Dec 20, 2021
5da019f
Reformatted and changed fonts to Open Sans
MathiasBuus Jan 12, 2022
384a055
Removed scrollbars
MathiasBuus Jan 13, 2022
bcc8bab
Undefined vars for full screen stripped
mapcentia Feb 1, 2022
7d911a2
Fixed layout and started my stations
MathiasBuus Feb 3, 2022
a805670
Update DashboardContent.js
MathiasBuus Feb 4, 2022
9015145
Fixed scrollbars and formatting of dashboard
MathiasBuus Feb 4, 2022
140e8c0
Tilføjet fullscreen funktionalitet til plots
MathiasBuus Feb 6, 2022
565b64b
Update DashboardContent.js
MathiasBuus Feb 6, 2022
162118d
Added logic for session props
MathiasBuus Feb 8, 2022
394ba1d
Undefined vars for full screen stripped
mapcentia Feb 10, 2022
1e42979
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Feb 10, 2022
045df40
Dashboard is now store in snapshot, but without lazy loading data
mapcentia Feb 12, 2022
17dd96f
Dashboard is now store in snapshot and lazy load data
mapcentia Feb 14, 2022
24b8a8b
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
MathiasBuus Feb 14, 2022
841bad6
Dashboard is now store in snapshot and lazy load data
mapcentia Feb 15, 2022
7158d6a
Added Getter for session properties
mapcentia Feb 15, 2022
d40f897
Added type ahead search and deleting of Valgte Datakilder
MathiasBuus Feb 15, 2022
641f860
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
MathiasBuus Feb 15, 2022
07bc597
Update DashboardContent.js
MathiasBuus Feb 15, 2022
2adcd6b
Relation names are now a property of plot, so they can be use in fetc…
mapcentia Feb 17, 2022
49f4d1b
Merge
mapcentia Feb 17, 2022
c59f978
Handling of undefined
mapcentia Feb 17, 2022
daa2874
Colors
mapcentia Feb 18, 2022
1c7f1a2
Started image carousel
MathiasBuus Mar 1, 2022
c72fe1e
Fixed multiple small things
MathiasBuus Mar 3, 2022
d662e6b
Fixed plotting
MathiasBuus Mar 4, 2022
2df3d9b
Search and theme
mapcentia Mar 7, 2022
2a09924
Update PlotComponent.js
MathiasBuus Mar 8, 2022
362cf66
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
MathiasBuus Mar 8, 2022
bb3adda
Styling and plotcomponent
MathiasBuus Mar 8, 2022
bb5a210
Update PlotComponent.js
MathiasBuus Mar 8, 2022
cab47bb
Aggregation and chemical layer functionality
MathiasBuus Mar 9, 2022
96c6dd6
Cardlist layout and aggregation
MathiasBuus Mar 10, 2022
feaa0ce
Sum functionality
MathiasBuus Mar 10, 2022
99e1c40
Bugs in source state (mixed up titles) and roboto as standard font
mapcentia Mar 14, 2022
ba5f12e
Font weight set to 300
mapcentia Mar 14, 2022
6f07ec0
Fixed image spacing and Graph spacing
MathiasBuus Mar 14, 2022
14924b1
Bug fixed
mapcentia Mar 14, 2022
3bd1d6b
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Mar 14, 2022
ecf334e
Added license functionality
MathiasBuus Mar 15, 2022
d832bb1
Fixed language, disable dashboard on free, and added state to searchbox
MathiasBuus Mar 15, 2022
31283b8
Loading spinner, DnD for all parameters and more
MathiasBuus Mar 16, 2022
93c3041
Removed unnessesary console.log
MathiasBuus Mar 16, 2022
0bffd4e
Clean up
mapcentia Mar 21, 2022
170d894
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Mar 21, 2022
4749dba
Fixed UUID and mapdecorator and chemical list with new naming convention
MathiasBuus Mar 22, 2022
09ce831
Added locname to all cachedData
MathiasBuus Mar 22, 2022
f5ba5ff
Lazy load of sources
mapcentia Mar 23, 2022
48b2172
Lazy load of sources
mapcentia Mar 28, 2022
a2e74c8
Merge
mapcentia Mar 29, 2022
17805b7
Locname, title and unit is set all places
mapcentia Mar 29, 2022
ab713ad
Profile tool re-added
mapcentia Apr 4, 2022
d375a59
Profile tool re-added
mapcentia Apr 4, 2022
fd781a3
Fixed merge conflicts, styling of graph name, and fix of fullscreen
MathiasBuus Apr 4, 2022
3753846
Profile tool re-added
mapcentia Apr 6, 2022
50ee4d8
Save and Save As
mapcentia Apr 6, 2022
528574c
Fixed SQL
mapcentia Apr 6, 2022
de7b5d4
Fixed merging errors
MathiasBuus Apr 6, 2022
ba1d2d5
Fixed plotting issue, and titles, etc
MathiasBuus Apr 20, 2022
dd53abd
Update DashboardPlotCard.js
MathiasBuus Apr 20, 2022
60b6523
Clear dashboard function
mapcentia Apr 25, 2022
949cdae
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia Apr 25, 2022
f81a998
Clear dashboard function
mapcentia Apr 25, 2022
4c0fcfb
More simple flex-box grid in Dashboard header
mapcentia Apr 25, 2022
4cd0401
Fixed fullscreen functionality
MathiasBuus Apr 28, 2022
e17d5e6
Added profiles functionality
MathiasBuus Apr 29, 2022
429d70e
Fixed local endpoints
MathiasBuus Apr 29, 2022
0dd68d7
Remove console log
mapcentia May 2, 2022
f87f0dd
Absolute favicon url
mapcentia May 2, 2022
b4b16d6
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia May 2, 2022
16bf2b7
Colors in baselayer widget
mapcentia May 2, 2022
7b47627
Make sure that right panel is on top on start
mapcentia May 2, 2022
2e0d360
Fixed error when ts_id is uuid
MathiasBuus May 3, 2022
78ab10a
Re-added sum instead of mean for precipitation
MathiasBuus May 3, 2022
6b9e606
Show all timeseries also adds location to dashboard
MathiasBuus May 3, 2022
4808c8f
Rollback aggregate for sum
MathiasBuus May 3, 2022
4e54a63
Profiles in snapshot with lazy load of the data property
mapcentia May 20, 2022
0da007b
Fixed zoom error on profiles
MathiasBuus May 30, 2022
ad9bc69
Check if undefined
mapcentia May 31, 2022
345e1df
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
mapcentia May 31, 2022
b1af20c
Remove of console.log
mapcentia May 31, 2022
a7b4bea
Decode base64 encoded project json
mapcentia Jun 7, 2022
5708ab1
Profile features
MathiasBuus Jun 7, 2022
e9137ff
Merge branch 'themes' of https://github.com/mapcentia/watsonc into th…
MathiasBuus Jun 7, 2022
0ea3949
New graph and new profile opens dashboard and scrolls
MathiasBuus Jun 7, 2022
e1ac36c
Styling i grafvindue #251
MathiasBuus Jun 7, 2022
8be0501
Fixet #252
MathiasBuus Jun 8, 2022
213034e
Fixed license issue for profiles
MathiasBuus Jun 10, 2022
2a2fb58
Fixed #253
MathiasBuus Jun 10, 2022
ac77ed9
#260 Implemented my stations
MathiasBuus Jun 13, 2022
22fd9cd
Added subscription logic for dashboard header
MathiasBuus Jun 13, 2022
021fbdb
#257 Fixed
MathiasBuus Jun 13, 2022
a2bcf64
Fixed data selector layout for dashboards
MathiasBuus Jun 13, 2022
f666e4c
Layout changes
MathiasBuus Jun 14, 2022
0d2ac15
#242 Added groups for Jupiter layers
MathiasBuus Jun 14, 2022
18bb315
Hide button
mapcentia Jun 15, 2022
d06b06e
Layout and translations
MathiasBuus Jun 15, 2022
e3c99e8
More translations
MathiasBuus Jun 15, 2022
72a3673
Styling af lagmenu
MathiasBuus Jun 16, 2022
9a6c78a
#265 Added clearing when pressing icon
MathiasBuus Jun 16, 2022
7cc3206
#264 Fixed download data button
MathiasBuus Jun 16, 2022
7592136
#266 Selects data source when adding to dashboard
MathiasBuus Jun 16, 2022
f5602c2
Fixed groups coming in other stations than Jupiter
MathiasBuus Jun 16, 2022
7732932
selectedBorehole clean up
MathiasBuus Jun 16, 2022
141bfa5
#267 Added clickable icon on Jupiter boreholes
MathiasBuus Jun 17, 2022
0ea3f39
Added disabled style to Start button
MathiasBuus Jun 17, 2022
53fbdcd
Removed logs
MathiasBuus Jun 17, 2022
7db871b
Location info in Pop up menu
MathiasBuus Jun 17, 2022
f7270e3
Increased size of popup
MathiasBuus Jun 17, 2022
d147d86
Clear Dashboard button now works
mapcentia Jun 20, 2022
cd7eb21
About and log in buttons removed
mapcentia Jun 20, 2022
27d0a72
Navigation button text color
mapcentia Jun 20, 2022
64450a2
Hide more info button and made MapDecorator bigger
MathiasBuus Jun 21, 2022
eb61b25
Fixed bug with DMP download
MathiasBuus Jun 22, 2022
23b5388
Added timeseries info to more info.
MathiasBuus Jun 22, 2022
6cc8817
Now checks if not premium for license checking
MathiasBuus Jun 23, 2022
edecc90
Translations
MathiasBuus Jun 23, 2022
4583d68
Added state refresh of all user specific data on relog
MathiasBuus Jun 23, 2022
6145d73
Added fullscreen icon and disabled some scrollbars
MathiasBuus Jun 23, 2022
9acdf74
Better layout logic for precipitation and start of graph
MathiasBuus Jun 27, 2022
69cc662
Added login functionality in Calypso LARGE COMMIT
MathiasBuus Jun 28, 2022
47d4bac
Added Særskilte lag logic
MathiasBuus Jun 28, 2022
4467b7d
Update README.md
mapcentia Aug 15, 2022
62c5937
Update README.md
mapcentia Aug 15, 2022
a1e776f
Fixed summing of precipitation and hardcoded yaxis
MathiasBuus Mar 17, 2023
566babe
Fixed sorting of hardcoded axes
MathiasBuus Mar 20, 2023
7787e02
Updated names in cardlistitem
MathiasBuus Sep 19, 2023
eae0742
Fixed projects not showing in data selector
MathiasBuus Mar 7, 2024
4c55176
Fixed not being able to plot all graphs
MathiasBuus Mar 7, 2024
ee09160
Changed URL for Kontakt
MathiasBuus Mar 7, 2024
470fe40
Added Enter logs in
MathiasBuus Mar 7, 2024
b34f14b
Fixed title in Profiles and closing of them
MathiasBuus Mar 7, 2024
071781a
Added aggregate to snapshots
MathiasBuus Mar 7, 2024
5aa55a3
Fixed bugs with adding dashboard items to dashboard
MathiasBuus Mar 7, 2024
18ad472
Only add boreholes not already in list
MathiasBuus Mar 11, 2024
e73202a
Fixed renaming of plots hopefully
MathiasBuus Apr 29, 2024
15b2967
Update DashboardContent.js
MathiasBuus Apr 30, 2024
3928234
Update show_subscriptionDialogue.js
MathiasBuus Apr 30, 2024
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
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
}
}
],
"@babel/preset-react"
]
}
52 changes: 52 additions & 0 deletions browser/api/baseApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

export default class BaseApi {

get(url = "") {
try {

// Default options are marked with *
return fetch(url, {
method: 'GET', // *GET, POST, PUT, DELETE, etc.
// mode: 'cors', // no-cors, *cors, same-origin
// cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
// credentials: 'same-origin', // include, *same-origin, omit
// headers: {
// 'Content-Type': 'application/json; charset=utf-8'
// },
// redirect: 'follow', // manual, *follow, error
// referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
// body: JSON.stringify(query) // body data type must match "Content-Type" header
});


} catch (error) {
// console.log("BaseApi error", error);
return "";
}
}

post(url = "", body = "") {

try {

// Default options are marked with *
return fetch(url, {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
// mode: 'cors', // no-cors, *cors, same-origin
// cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
// credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/json; charset=utf-8'
},
// redirect: 'follow', // manual, *follow, error
// referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
// body: JSON.stringify(query) // body data type must match "Content-Type" header
body: JSON.stringify(body)
});

} catch (error) {
// console.log("BaseApi error", error);
return "";
}
}
}
11 changes: 11 additions & 0 deletions browser/api/projects/Projects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import BaseApi from '../baseApi';

const projectsUrl = '/api/state-snapshots/jupiter?ownerOnly=true'

export default class ProjectsApi {
aswinm marked this conversation as resolved.
Show resolved Hide resolved
getProjectsList() {
aswinm marked this conversation as resolved.
Show resolved Hide resolved
const baseApi = new BaseApi();
const response = baseApi.get(projectsUrl);
return response;
}
}
15 changes: 13 additions & 2 deletions browser/components/DataSelectorDialogue.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from 'react';
import styled from "styled-components";
import Title from './shared/title/Title';
import CloseButton from './shared/button/CloseButton';
Expand All @@ -7,6 +8,11 @@ import Card from './shared/card/Card';
import IconButton from './shared/button/IconButton';
import CheckBoxList from './shared/list/CheckBoxList';
import RadioButtonList from './shared/list/RadioButtonList';
import Button from './shared/button/Button';
import ButtonGroup from './shared/button/ButtonGroup';
import ProjectList from './ProjectList';
import { Variants } from './shared/constants/variants';
import { Size } from './shared/constants/size';
import { hexToRgbA } from '../helpers/colors';

const DataSources = [{ label: "Klima", value: "klima", group: "Klima"},
Expand All @@ -32,6 +38,7 @@ const Parameters = [


function DataSelectorDialogue(props) {
const [showProjectsList, setShowProjectsList] = useState(false);
console.log(props);
return (
<Root>
Expand All @@ -50,7 +57,7 @@ function DataSelectorDialogue(props) {
<IconButton icon="no3-solid" label={__('Nitrat')} />
aswinm marked this conversation as resolved.
Show resolved Hide resolved
<IconButton icon="water-drop-wifi-solid" label={__('Mine stationer')} />
<IconButton icon="lab-flask-experiment" label={__('Mine favoritter')} />
<Grid container spacing={32}>
{showProjectsList ? <ProjectList /> : <Grid container spacing={32}>
<Grid container item md={6}>
<Card>
<Title text={__('Datakilder')} level={3} />
Expand All @@ -63,7 +70,11 @@ function DataSelectorDialogue(props) {
<RadioButtonList listItems={Parameters} onChange={(selectedItem) => console.log(selectedItem)} />
</Card>
</Grid>
</Grid>
</Grid> }
<ButtonGroup align="center">
<Button text={__("Abn eksisterende")} variant={Variants.None} onClick={() => setShowProjectsList(!showProjectsList)} size={Size.Large} />
<Button text={__("Start")} variant={Variants.Primary} onClick={() => console.log("Button click star")} size={Size.Large} />
</ButtonGroup>
</ModalBody>
</Root>
);
Expand Down
24 changes: 24 additions & 0 deletions browser/components/ProjectList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useState, useEffect } from 'react';
import ProjectsApi from '../api/projects/Projects';


function ProjectList(props) {
const [projects, setProjects] = useState([]);

const loadProjects = () => {
const projectsApi = new ProjectsApi();
projectsApi.getProjectsList().then((results) => {
console.log(results);
setProjects(results);
})
}

useEffect(() => {
loadProjects();
}, []);

return (<div>Loading data...</div>)

}

export default ProjectList
21 changes: 19 additions & 2 deletions browser/components/shared/button/Button.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import styled, { css } from "styled-components";
import { Variants } from "../../../constants";
import { Variants } from "../constants/variants";
import { Size } from '../constants/size';
import PropTypes from 'prop-types';

function Button(props) {
return (
<Root
onClick={props.onClick ?? props.onClick}
variant={props.variant}>
variant={props.variant}
size={props.size}>
{props.text}
</Root>
);
}
Button.propTypes = {
text: PropTypes.string,
variant: PropTypes.oneOf(Object.keys(Variants)),
size: PropTypes.oneOf(Object.keys(Size)),
onClick: PropTypes.func.isRequired
}

Expand Down Expand Up @@ -43,5 +46,19 @@ const Root = styled.button`
};
return styles[variant];
}}
${({ size, theme }) => {
const styles = {
[Size.Small]: css `
width: ${theme.layout.gutter * 10}px;
`,
[Size.Medium]: css `
width: ${theme.layout.gutter * 20}px;
`,
[Size.Large]: css `
width: ${theme.layout.gutter * 40}px;
`
};
return styles[size];
}}
`
export default Button;
48 changes: 48 additions & 0 deletions browser/components/shared/button/ButtonGroup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import styled, { css } from "styled-components";
import { Align } from '../constants/align';
import PropTypes from 'prop-types';

function ButtonGroup(props) {
return (
<Root align={props.align}>
{props.children}
</Root>
);
}
ButtonGroup.propTypes = {
aswinm marked this conversation as resolved.
Show resolved Hide resolved
text: PropTypes.string,
align: PropTypes.string,
}

const Root = styled.div`
display: flex;
margin-top: ${props => props.theme.layout.gutter}px;
${({ align, theme }) => {
const styles = {
[Align.LEFT]: css `
justify-content: start;
align-items: flex-start;
button {
margin-right: ${theme.layout.gutter / 2}px;
}
`,
[Align.CENTER]: css`
justify-content: center;
align-items: center;
button {
margin-left: ${theme.layout.gutter / 2};
margin-right: ${theme.layout.gutter / 2};
}
`,
[Align.RIGHT]: css`
justify-content: flex-end,
align-items: flex-end,
button {
marginLeft: ${theme.layout.gutter / 2}px;
}
`
}
return styles[align];
}}
`
export default ButtonGroup;
7 changes: 7 additions & 0 deletions browser/components/shared/constants/align.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Align = {
LEFT: 'left',
aswinm marked this conversation as resolved.
Show resolved Hide resolved
CENTER: 'center',
RIGHT: 'right'
}

export {Align};
9 changes: 9 additions & 0 deletions browser/components/shared/constants/size.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const Size = {
Small: 'Small',
Medium: 'Medium',
Large: 'Large',
};

export {
Size,
}
8 changes: 2 additions & 6 deletions browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ module.exports = module.exports = {
const introlModalPlaceholderId = `watsonc-intro-modal-placeholder`;
if ($(`#${introlModalPlaceholderId}`).is(`:empty`)) {
try {
/* ReactDOM.render(<Provider store={reduxStore}>
ReactDOM.render(<Provider store={reduxStore}>
<IntroModal
ref={inst => {
infoModalInstance = inst;
Expand All @@ -843,11 +843,7 @@ module.exports = module.exports = {
categories={categoriesOverall ? categoriesOverall : []}
onApply={_self.onApplyLayersAndChemical}
onClose={onCloseHandler}
/></Provider>, document.getElementById(introlModalPlaceholderId)); */
ReactDOM.render(<ThemeProvider>
<DataSelectorDialogue titleText={__('Welcome to Calypso')}
onCloseButtonClick={onCloseHandler} />
</ThemeProvider>, document.getElementById(introlModalPlaceholderId));
/></Provider>, document.getElementById(introlModalPlaceholderId));
} catch (e) {
console.error(e);
}
Expand Down