Skip to content

Commit

Permalink
Tidy up the stubbed data
Browse files Browse the repository at this point in the history
  • Loading branch information
msp committed Oct 23, 2017
1 parent a7ba8b8 commit 9efa4d2
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 110 deletions.
49 changes: 20 additions & 29 deletions api/dashboards.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
{
"dashboards": [{
"uuid": "97340cbd-b3c2-4471-b39a-dcbe31d7f50e",
"name": "Haven Power Dashboard",
"slug": "haven-power-dashboard",
"description": "Haven Power Dashboard",
"name": "Haven Power",
"slug": "haven-power",
"description": "Dashboard for viewing MPAN data",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"widgets": []
}, {
"uuid": "83bb72a2-2aa1-4616-9e03-68bcd2b562ff",
"name": "EW Financials",
"slug": "ew-financials",
"description": "Insight into the EW financial position, data from from Google Sheets",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"author": {
Expand All @@ -14,32 +30,7 @@
},
"favorited": false,
"favoritesCount": 0,
"widgets": [{
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "12 months Table",
"body": "12 months Table",
"description": "12 months of important data",
"dataSources": [{
"uuid": "2",
"name": "haven"
}],
"adapter": "TABLE",
"renderer": "TABLE",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}]
"widgets": []
}],
"dashboardsCount": 1
}
94 changes: 94 additions & 0 deletions api/dashboards/83bb72a2-2aa1-4616-9e03-68bcd2b562ff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"dashboard": {
"uuid": "83bb72a2-2aa1-4616-9e03-68bcd2b562ff",
"name": "EW Financials",
"slug": "ew-financials",
"description": "Insight into the EW financial position, data from from Google Sheets",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"widgets": [{
"uuid": "c0b02f5d-8e73-4524-9f0f-f343bfd25493",
"name": "Bar chart",
"body": "Bar chart",
"description": "12 months financial data as a bar chart",
"dataSources": [{
"uuid": "1P0okW7oVus2KR423Ob1DgbVNCbR_QNg3OjNPj04zcsI",
"name": "sheets"
}],
"adapter": "TABLE",
"renderer": "BAR_CHART",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}, {
"uuid": "c9527bc4-166d-4012-9ff4-5ac04d2f2ee4",
"name": "Line Chart",
"body": "LIne Chart",
"description": "12 months financial data as a line chart",
"dataSources": [{
"uuid": "1P0okW7oVus2KR423Ob1DgbVNCbR_QNg3OjNPj04zcsI",
"name": "sheets"
}],
"adapter": "TABLE",
"renderer": "LINE_CHART",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}, {
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "Spreadsheet",
"body": "Spreadsheet",
"description": "12 months financial data as a table",
"dataSources": [{
"uuid": "1P0okW7oVus2KR423Ob1DgbVNCbR_QNg3OjNPj04zcsI",
"name": "sheets"
}],
"adapter": "TABLE",
"renderer": "TABLE",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}]
}
}
94 changes: 22 additions & 72 deletions api/dashboards/97340cbd-b3c2-4471-b39a-dcbe31d7f50e.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"dashboard": {
"uuid": "97340cbd-b3c2-4471-b39a-dcbe31d7f50e",
"name": "Haven Power Dashboard",
"slug": "haven-power-dashboard",
"description": "Haven Power Dashboard",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"name": "Haven Power",
"slug": "haven-power",
"description": "Dashboard for viewing MPAN data",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
Expand All @@ -15,68 +15,18 @@
"favorited": false,
"favoritesCount": 0,
"widgets": [{
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "12 months Table",
"body": "12 months Table",
"description": "12 months of important data",
"uuid": "9c2b3896-c957-47ad-893a-446f9ffa9012",
"name": "MPAN 998877 Heat Map",
"body": "MPAN 998877 Heat Map",
"description": "One year of MPAN data, one reading every 30 minutes",
"dataSources": [{
"uuid": "1",
"uuid": "998877",
"name": "haven"
}],
"adapter": "TABLE",
"renderer": "LINE_CHART",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}, {
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "12 months Table",
"body": "12 months Table",
"description": "12 months of important data",
"dataSources": [{
"uuid": "1P0okW7oVus2KR423Ob1DgbVNCbR_QNg3OjNPj04zcsI",
"name": "sheets"
}],
"adapter": "TABLE",
"renderer": "BAR_CHART",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
"bio": "beautifully flawed creation .. \n\n",
"image": "https://static.productionready.io/images/smiley-cyrus.jpg",
"following": false
},
"favorited": false,
"favoritesCount": 0,
"data": {
"data": []
}
}, {
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "12 months Table",
"body": "12 months Table",
"description": "12 months of important data",
"dataSources": [{
"uuid": "1P0okW7oVus2KR423Ob1DgbVNCbR_QNg3OjNPj04zcsI",
"name": "sheets"
}],
"adapter": "TABLE",
"renderer": "TABLE",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"adapter": "HEAT_MAP",
"renderer": "HEAT_MAP",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
Expand All @@ -90,18 +40,18 @@
"data": []
}
}, {
"uuid": "006f0092-5a11-468d-b822-ea57753f45c4",
"name": "12 months Table",
"body": "12 months Table",
"description": "12 months of important data",
"uuid": "d85b248e-d331-48e3-8677-6256240d532a",
"name": "MPAN 998877 Table",
"body": "MPAN 998877 Table",
"description": "One year of MPAN data, one reading every 30 minutes",
"dataSources": [{
"uuid": "998877",
"name": "haven"
}],
"adapter": "HEAT_MAP",
"renderer": "HEAT_MAP",
"createdAt": "2017-09-04T16:03:55.948Z",
"updatedAt": "2017-09-04T16:03:55.948Z",
"adapter": "TABLE",
"renderer": "TABLE",
"createdAt": "2017-10-23T16:03:55.948Z",
"updatedAt": "2017-10-23T16:03:55.948Z",
"tagList": [],
"author": {
"username": "msp",
Expand Down
4 changes: 2 additions & 2 deletions api/widgets/9c2b3896-c957-47ad-893a-446f9ffa9012.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"uuid": "9c2b3896-c957-47ad-893a-446f9ffa9012",
"name": "Haven Power Heat Map",
"body": "Haven Power Heat Map",
"description": "One year of MPAN data",
"description": "One year of MPAN data, one reading every 30 minutes",
"dataSources": [{
"uuid": "998877",
"name": "haven"
Expand All @@ -24,6 +24,6 @@
"data": {
"data": []
}

}
}
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
<style>/* Loading spinner courtesy of loader.io */
.sk-three-bounce { margin-right: 10px; } .sk-three-bounce .sk-child { width: 14px; height: 14px; background-color: #333; border-radius: 100%; display: inline-block; -webkit-animation: sk-three-bounce 1.4s ease-in-out 0s infinite both; animation: sk-three-bounce 1.4s ease-in-out 0s infinite both; } .sk-three-bounce .sk-bounce1 { -webkit-animation-delay: 0.28s; animation-delay: 0.28s; } .sk-three-bounce .sk-bounce2 { -webkit-animation-delay: 0.44s; animation-delay: 0.44s; } .sk-three-bounce .sk-bounce3 { -webkit-animation-delay: 0.6s; animation-delay: 0.6s; } @-webkit-keyframes sk-three-bounce { 0%, 80%, 100% { -webkit-transform: scale(0); transform: scale(0); } 40% { -webkit-transform: scale(1); transform: scale(1); } } @keyframes sk-three-bounce { 0%, 80%, 100% { -webkit-transform: scale(0); transform: scale(0); } 40% { -webkit-transform: scale(1); transform: scale(1); } }

/* needs some width figure to get layout :( */
.spinner-wrapper {
margin: 0px auto;
width: 100px;
padding: 50px;
border: 0px solid red;
}

.col-md-6 {
border: 0px solid blue ! important
}

/*hacky theme overrides*/
Expand Down
2 changes: 1 addition & 1 deletion src/Page/Dashboard.elm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ viewBanner errors dashboard author maybeUser =
[ div [ class "container-fluid" ]
[ div [ class "row" ]
[ div [ class "col-md-4" ] [ h2 [] [ text dashboard.name ] ]
, div [ class "col-md-4 col-md-offset-4" ]
, div [ class "col-md-5 col-md-offset-3" ]
[ div [ class "article-meta article-meta-dashboard" ] <|
[ a [ Route.href (Route.Profile author.username) ]
[ img [ UserPhoto.src author.image ] [] ]
Expand Down
2 changes: 1 addition & 1 deletion src/Page/Home.elm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ viewBanner : Html msg
viewBanner =
div [ class "banner" ]
[ div [ class "container" ]
[ h1 [ class "logo-font" ] [ text "Widgets" ]
[ h2 [ class "logo-font" ] [ text "All Dashboards" ]
]
]

Expand Down
2 changes: 1 addition & 1 deletion src/Views/Dashboard.elm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ view toggleFavorite dashboard =
, a [ class "preview-link", Route.href (Route.Dashboard dashboard.uuid) ]
[ h1 [] [ text dashboard.name ]
, p [] [ text dashboard.description ]
, span [] [ text "Click to view dashboard.." ]
, span [ class "small" ] [ text "[Click to view dashboard]" ]
]
]

Expand Down
2 changes: 1 addition & 1 deletion src/Views/Dashboard/Feed.elm
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ updateInternal session msg model =
ToggleFavorite dashboard ->
case session.user of
Nothing ->
{ model | errors = model.errors ++ [ "You are currently signed out. You must sign in to favorite articles." ] }
{ model | errors = model.errors ++ [ "You are currently signed out. You must sign in to favorite." ] }
=> Cmd.none

Just user ->
Expand Down
4 changes: 3 additions & 1 deletion src/Views/Widget/Renderers/Renderer.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ run : Widget Body -> Table.Data -> Html msg
run widget data =
case List.isEmpty data.rows of
True ->
div [ class "spinner-wrapper" ] [ Views.Spinner.spinnerSVG ]
div [ class "col-md-6" ]
[ div [ class "spinner-wrapper" ] [ Views.Spinner.spinnerSVG ]
]

False ->
case widget.renderer of
Expand Down
4 changes: 2 additions & 2 deletions src/Views/Widget/Renderers/Utils.elm
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ mediumPadding =

largeWidth : Float
largeWidth =
1500
1320


largeHeight : Float
largeHeight =
1000
880


largePadding : Float
Expand Down

0 comments on commit 9efa4d2

Please sign in to comment.