From ddbca921c0981de169fd376f7e95734f990e0504 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 2 May 2019 11:44:29 -0300 Subject: [PATCH 01/38] [WIP] Updating form to divide it into steps --- package-lock.json | 542 +++++++++--------- resources/sass/site2.scss | 13 + .../client/projects2/components/listings.cljs | 2 +- .../client/projects2/components/settings.cljs | 160 +++--- src/planwise/client/projects2/views.cljs | 2 +- src/planwise/client/routes.cljs | 6 +- src/planwise/endpoint/home.clj | 1 + 7 files changed, 383 insertions(+), 343 deletions(-) diff --git a/package-lock.json b/package-lock.json index d872a5588..21571043b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,25 +7,25 @@ "resolved": "https://registry.npmjs.org/@cljs-oss/module-deps/-/module-deps-1.1.1.tgz", "integrity": "sha1-YmZ/KCFk8/EParnxJLpBb9EkOfo=", "requires": { - "JSONStream": "^1.0.3", - "babel-traverse": "^6.23.1", - "babylon": "^6.15.0", - "browser-resolve": "^1.7.0", - "cached-path-relative": "^1.0.0", - "concat-stream": "~1.5.0", - "defined": "^1.0.0", - "detective": "^4.0.0", - "duplexer2": "^0.1.2", + "JSONStream": "1.3.2", + "babel-traverse": "6.26.0", + "babylon": "6.18.0", + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.2", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.7.1", + "duplexer2": "0.1.4", "enhanced-resolve": "3.4.1", - "inherits": "^2.0.1", + "inherits": "2.0.3", "konan": "1.1.0", - "parents": "^1.0.0", - "readable-stream": "^2.0.2", - "resolve": "^1.1.3", - "stream-combiner2": "^1.1.1", - "subarg": "^1.0.0", - "through2": "^2.0.0", - "xtend": "^4.0.0" + "parents": "1.0.1", + "readable-stream": "2.3.5", + "resolve": "1.6.0", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" } }, "@material/animation": { @@ -48,10 +48,10 @@ "resolved": "https://registry.npmjs.org/@material/button/-/button-0.32.0.tgz", "integrity": "sha512-3PBA+o8T5lFJbCo2GZD8sm5U4VXiHDN6nHkrKlysuvcbo6QQK1C3ZMP4BIj2nmSpodvNRXOk8opG3feDcubg3g==", "requires": { - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/card": { @@ -59,10 +59,10 @@ "resolved": "https://registry.npmjs.org/@material/card/-/card-0.32.0.tgz", "integrity": "sha512-Y/o8Mekvlt3su0K80gcLpmcdFUa+D57nKDI3nVcM1Xi2r5/ra3qjAmFda5mauxZK/8PzyB/FJzF1fy/RH5s+9g==", "requires": { - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0" + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0" } }, "@material/checkbox": { @@ -70,12 +70,12 @@ "resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-0.32.0.tgz", "integrity": "sha512-Rc6sidCCsc+wyktwd6KhNqAt14H6zSEarwLnvqCaYLv/Ml+lqg2SjQ3mg9rRKt1JREaN7G9BGKQKAnB//OMY4g==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/selection-control": "^0.32.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/selection-control": "0.32.0", + "@material/theme": "0.30.0" } }, "@material/chips": { @@ -83,8 +83,8 @@ "resolved": "https://registry.npmjs.org/@material/chips/-/chips-0.32.0.tgz", "integrity": "sha512-bw4LSzF+Ejyi4Z7iZHZE5J2k437b2iLVM9bGjkXYZ4bkFR+gqjjfB9787FEQGoowHwKOWmuVwYrsO+Vsomf6jg==", "requires": { - "@material/base": "^0.29.0", - "@material/ripple": "^0.32.0" + "@material/base": "0.29.0", + "@material/ripple": "0.32.0" } }, "@material/dialog": { @@ -92,14 +92,14 @@ "resolved": "https://registry.npmjs.org/@material/dialog/-/dialog-0.32.0.tgz", "integrity": "sha512-tmOdwpFAT5aI4nI43ldzgZ5ONPEZzhE8Nf95DnP8najwKni/aY3D61yo3KwrE2Q0fuuXL1e6AEojX83IHEEciw==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.1.1", - "focus-trap": "^2.3.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.1.1", + "focus-trap": "2.4.3" }, "dependencies": { "@material/typography": { @@ -114,12 +114,12 @@ "resolved": "https://registry.npmjs.org/@material/drawer/-/drawer-0.30.0.tgz", "integrity": "sha512-NZyp6jVd6cDucBPUl391cTuIkR5Vy5OdrdNQxvH+pTjvb7R2yQJKVv2a7PxuR1uKjGM1vRudFOdXpviwbplr9A==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/elevation": "^0.28.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/elevation": "0.28.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/elevation": { @@ -127,8 +127,8 @@ "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-0.28.0.tgz", "integrity": "sha512-U2utCuMDDhrJ8Cyisz16GAejN9h9xyS4jvVkt2uIOUyPZRjnaJyoAbpyf0mOzFxIdBuRpNGJYm2PoAwHsSA+xw==", "requires": { - "@material/animation": "^0.25.0", - "@material/theme": "^0.4.0" + "@material/animation": "0.25.0", + "@material/theme": "0.4.0" }, "dependencies": { "@material/theme": { @@ -143,10 +143,10 @@ "resolved": "https://registry.npmjs.org/@material/fab/-/fab-0.32.0.tgz", "integrity": "sha512-VWzka0qpDxDuqPai9alrFUQadpyEwSGuwt+vgqV0gL5vs0VxLlEa1XP8McZSvdCdHGPNEZtohUif2ZaDEiMSzQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/theme": "0.30.0" } }, "@material/floating-label": { @@ -154,9 +154,9 @@ "resolved": "https://registry.npmjs.org/@material/floating-label/-/floating-label-0.32.0.tgz", "integrity": "sha512-YrcRSK04EnvmVJw2bH0if9zOaag6zUbk41vW2FQZJkkaKd3kQt02d0RqlAJ9qSKciGNb0J0h/EDMcdGpNDAp6Q==", "requires": { - "@material/base": "^0.29.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0" + "@material/base": "0.29.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0" } }, "@material/form-field": { @@ -164,11 +164,11 @@ "resolved": "https://registry.npmjs.org/@material/form-field/-/form-field-0.32.0.tgz", "integrity": "sha512-DrUSzqS73H+ksyI0HM66q7IRVSuIIN5dvapayaCXscoSVq5jU1jObqDNtu7PmBxEqvXj68SHrRWm7M06m06a5w==", "requires": { - "@material/base": "^0.29.0", - "@material/rtl": "^0.30.0", - "@material/selection-control": "^0.32.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/base": "0.29.0", + "@material/rtl": "0.30.0", + "@material/selection-control": "0.32.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/grid-list": { @@ -176,10 +176,10 @@ "resolved": "https://registry.npmjs.org/@material/grid-list/-/grid-list-0.30.0.tgz", "integrity": "sha512-RjL5npvXRWqYE1ro83JjzF2JTimIqVrshCcjSCkiFcDY0AKyEBfihvtHA2JhngLgCgKBBcSHDzNL8sqGMT8AJg==", "requires": { - "@material/base": "^0.29.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/base": "0.29.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/icon-toggle": { @@ -187,10 +187,10 @@ "resolved": "https://registry.npmjs.org/@material/icon-toggle/-/icon-toggle-0.32.0.tgz", "integrity": "sha512-49jrIvP64yVkhVuwek4PmPumMllB3CkqGHgGaSlNJHGdZ3VaSD4DqxnKD0avxhPxEUWg/NXy1dEE+3YFrI/Caw==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/ripple": "^0.32.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/ripple": "0.32.0", + "@material/theme": "0.30.0" } }, "@material/layout-grid": { @@ -203,9 +203,9 @@ "resolved": "https://registry.npmjs.org/@material/line-ripple/-/line-ripple-0.32.0.tgz", "integrity": "sha512-vd/jlnK/paWZnsr9rvKkeo4qjIDTd59TljSUzqgXN4wiOwiCqXWtNgsy+veKG4fNLVqwad7ECKizUn2iQ/+IMQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/theme": "0.30.0" } }, "@material/linear-progress": { @@ -213,9 +213,9 @@ "resolved": "https://registry.npmjs.org/@material/linear-progress/-/linear-progress-0.30.0.tgz", "integrity": "sha512-xKeC22ni5B2xEoYwY8bBJABS3Xkxa1qjKb+bWu0zf90F7e3bQ0rp2pvzHSp0GGJHTAChu1COMXOyZ1QzaBYtGg==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/theme": "0.30.0" } }, "@material/list": { @@ -223,10 +223,10 @@ "resolved": "https://registry.npmjs.org/@material/list/-/list-0.32.0.tgz", "integrity": "sha512-03eZsHYRSS7b+fUsx5gBkRhUubfPYYg5Nr7PwLdEPLR5VuQ6RzgcNYcBnLtIa5rdvrd6NugNNSL9c2k27Qjt6g==", "requires": { - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/menu": { @@ -234,11 +234,11 @@ "resolved": "https://registry.npmjs.org/@material/menu/-/menu-0.31.0.tgz", "integrity": "sha512-9318W8Ws1lnJzsXC9+3hVaYJkGxJOXNHR4PaIpvI9T4ZmyRu5+E6Cp0hf42RTQ1bHTDLOSG/tPuKvsN9VW/6hQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/elevation": "^0.28.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/elevation": "0.28.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/radio": { @@ -246,11 +246,11 @@ "resolved": "https://registry.npmjs.org/@material/radio/-/radio-0.32.0.tgz", "integrity": "sha512-a+uUiCem0ULjcdH3mwOz/dabLGiiCshqr/Gu5xN1kB6bDLmXybM50DMgw3TowRXyyS4YOX6tm6j+af4dsiNJNQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/ripple": "^0.32.0", - "@material/selection-control": "^0.32.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/ripple": "0.32.0", + "@material/selection-control": "0.32.0", + "@material/theme": "0.30.0" } }, "@material/ripple": { @@ -258,8 +258,8 @@ "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-0.32.0.tgz", "integrity": "sha512-pfG16d1/46f4QnrUHG66aV22kbY7sh7n2HR/cFALX6D0l0Kae3+xjuUnr1yy32Y1tzLAc84U9jGEzTDykVff9A==", "requires": { - "@material/base": "^0.29.0", - "@material/theme": "^0.30.0" + "@material/base": "0.29.0", + "@material/theme": "0.30.0" } }, "@material/rtl": { @@ -272,14 +272,14 @@ "resolved": "https://registry.npmjs.org/@material/select/-/select-0.32.0.tgz", "integrity": "sha512-KLlP4i1QDzsDJoIW4qA1JB17zSrgHSG2PpxKeqhUjqb9W5Q71LJ6QjhPynFA897sq1Wd9WTSHl41BAu2qUZlFA==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/list": "^0.32.0", - "@material/menu": "^0.31.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/list": "0.32.0", + "@material/menu": "0.31.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/selection-control": { @@ -287,7 +287,7 @@ "resolved": "https://registry.npmjs.org/@material/selection-control/-/selection-control-0.32.0.tgz", "integrity": "sha512-zlq6x5n0pN3eKJQBYkWdh4UQScF7Ui7g7XIeeuKnNFo99oxJoKtuGk3WX5/OBc0wU4qe38rfQW6XGeFG4Adk3Q==", "requires": { - "@material/ripple": "^0.32.0" + "@material/ripple": "0.32.0" } }, "@material/slider": { @@ -295,10 +295,10 @@ "resolved": "https://registry.npmjs.org/@material/slider/-/slider-0.32.0.tgz", "integrity": "sha512-FmV9tjzhj9KfTpxXL2YNgV3STQTWXmROp7SJqrz8v2JpDXiVyI/pq/DhcFLEMvs096cIZWgH+iyZPQGFTPH12A==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0" } }, "@material/snackbar": { @@ -306,11 +306,11 @@ "resolved": "https://registry.npmjs.org/@material/snackbar/-/snackbar-0.30.0.tgz", "integrity": "sha512-zQamWIxco7wZGYHXZ5G6TGTUKeZgS/EZ+YgRhA5hm6ZwfZrQYhn8coWRPOfsgHHlDN511sA8svU41h6HArlSFA==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/switch": { @@ -318,9 +318,9 @@ "resolved": "https://registry.npmjs.org/@material/switch/-/switch-0.32.0.tgz", "integrity": "sha512-nn5HN8AdSb4aSOJEEG9wGvPg+wPhg2rMD3j8WTX1HZ7c0HklgM07SuNKI+Yz5VFgfA28m3qFJAdHIv7OdzSuaQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/elevation": "^0.28.0", - "@material/theme": "^0.30.0" + "@material/animation": "0.25.0", + "@material/elevation": "0.28.0", + "@material/theme": "0.30.0" } }, "@material/tabs": { @@ -328,12 +328,12 @@ "resolved": "https://registry.npmjs.org/@material/tabs/-/tabs-0.32.0.tgz", "integrity": "sha512-RWzxlQoR6MPqxCP2kVNrxg4+D2A5eT7WO0cqkoxsbDz8wAPeNlU/vdr17bnTlhAiiwcDCKulxHRNX7Gztwwg0A==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/textfield": { @@ -341,14 +341,14 @@ "resolved": "https://registry.npmjs.org/@material/textfield/-/textfield-0.32.0.tgz", "integrity": "sha512-5gLDjBE14LqRT3NcToYZu/vVL/FzPY/kPT+oqzyZaRfvx3iyTBXSPsE0LOfGIgPv+Z65Z4g1PoccLWW/cZWHbw==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/floating-label": "^0.32.0", - "@material/line-ripple": "^0.32.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/floating-label": "0.32.0", + "@material/line-ripple": "0.32.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/theme": { @@ -361,12 +361,12 @@ "resolved": "https://registry.npmjs.org/@material/toolbar/-/toolbar-0.32.0.tgz", "integrity": "sha512-eDouRzRFqOpOigm1nOr8QrfEGJW87gdzhqlM8YbrIzUchm3JouAQgV62wvDs+mMpy2jXj1rMBZOTbtff78myqA==", "requires": { - "@material/base": "^0.29.0", - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/base": "0.29.0", + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/top-app-bar": { @@ -374,13 +374,13 @@ "resolved": "https://registry.npmjs.org/@material/top-app-bar/-/top-app-bar-0.32.0.tgz", "integrity": "sha512-zdL70MN10Hd1831o0xdGGAASemY4ht2Wz2juANaK3fCf9uvv2UFouS8eJa4BX16rHenIzwrffuA1EKn96RauaQ==", "requires": { - "@material/animation": "^0.25.0", - "@material/base": "^0.29.0", - "@material/elevation": "^0.28.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/theme": "^0.30.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/base": "0.29.0", + "@material/elevation": "0.28.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/theme": "0.30.0", + "@material/typography": "0.28.0" } }, "@material/typography": { @@ -393,8 +393,8 @@ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" + "jsonparse": "1.3.1", + "through": "2.3.8" } }, "acorn": { @@ -422,9 +422,9 @@ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" } }, "babel-messages": { @@ -432,7 +432,7 @@ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "requires": { - "babel-runtime": "^6.22.0" + "babel-runtime": "6.26.0" } }, "babel-runtime": { @@ -440,8 +440,8 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" + "core-js": "2.5.4", + "regenerator-runtime": "0.11.1" } }, "babel-traverse": { @@ -449,15 +449,15 @@ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.4", + "lodash": "4.17.11" } }, "babel-types": { @@ -465,10 +465,10 @@ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.11", + "to-fast-properties": "1.0.3" } }, "babylon": { @@ -501,11 +501,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" } }, "classnames": { @@ -518,9 +518,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "requires": { - "inherits": "~2.0.1", - "readable-stream": "~2.0.0", - "typedarray": "~0.0.5" + "inherits": "2.0.3", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" }, "dependencies": { "readable-stream": { @@ -528,12 +528,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" } } } @@ -553,9 +553,9 @@ "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" } }, "debug": { @@ -576,8 +576,8 @@ "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", "requires": { - "acorn": "^5.2.1", - "defined": "^1.0.0" + "acorn": "5.5.3", + "defined": "1.0.0" } }, "duplexer2": { @@ -585,7 +585,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "requires": { - "readable-stream": "^2.0.2" + "readable-stream": "2.3.5" } }, "encoding": { @@ -593,7 +593,7 @@ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "requires": { - "iconv-lite": "~0.4.13" + "iconv-lite": "0.4.19" } }, "enhanced-resolve": { @@ -601,10 +601,10 @@ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.4.0", - "object-assign": "^4.0.1", - "tapable": "^0.2.7" + "graceful-fs": "4.1.11", + "memory-fs": "0.4.1", + "object-assign": "4.1.1", + "tapable": "0.2.8" } }, "errno": { @@ -612,7 +612,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "~1.0.1" + "prr": "1.0.1" } }, "escape-string-regexp": { @@ -630,13 +630,13 @@ "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", "requires": { - "core-js": "^1.0.0", - "isomorphic-fetch": "^2.1.1", - "loose-envify": "^1.0.0", - "object-assign": "^4.1.0", - "promise": "^7.1.1", - "setimmediate": "^1.0.5", - "ua-parser-js": "^0.7.9" + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" }, "dependencies": { "core-js": { @@ -651,7 +651,7 @@ "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-2.4.3.tgz", "integrity": "sha512-sT5Ip9nyAIxWq8Apt1Fdv6yTci5GotaOtO5Ro1/+F3PizttNBcCYz8j/Qze54PPFK73KUbOqh++HUCiyNPqvhA==", "requires": { - "tabbable": "^1.0.3" + "tabbable": "1.1.2" } }, "globals": { @@ -669,7 +669,7 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "iconv-lite": { @@ -687,7 +687,7 @@ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "requires": { - "loose-envify": "^1.0.0" + "loose-envify": "1.3.1" } }, "is-stream": { @@ -705,8 +705,8 @@ "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.4" } }, "js-tokens": { @@ -724,8 +724,8 @@ "resolved": "https://registry.npmjs.org/konan/-/konan-1.1.0.tgz", "integrity": "sha1-M3dDxLl7S9Hvi2KiSzFeuLxLIJQ=", "requires": { - "babel-traverse": "^6.23.1", - "babylon": "^6.15.0" + "babel-traverse": "6.26.0", + "babylon": "6.18.0" } }, "lodash": { @@ -738,7 +738,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "requires": { - "js-tokens": "^3.0.0" + "js-tokens": "3.0.2" } }, "material-components-web": { @@ -746,40 +746,40 @@ "resolved": "https://registry.npmjs.org/material-components-web/-/material-components-web-0.32.0.tgz", "integrity": "sha512-f2etJyWzZu/5U1qYnybzHXuUhyEAG19a/OFjSLi6rYJtjY1BtPS+Az9IHvnKDB7ahLET00vEtMKZbNsSa8Eksw==", "requires": { - "@material/animation": "^0.25.0", - "@material/auto-init": "^0.32.0", - "@material/base": "^0.29.0", - "@material/button": "^0.32.0", - "@material/card": "^0.32.0", - "@material/checkbox": "^0.32.0", - "@material/chips": "^0.32.0", - "@material/dialog": "^0.32.0", - "@material/drawer": "^0.30.0", - "@material/elevation": "^0.28.0", - "@material/fab": "^0.32.0", - "@material/floating-label": "^0.32.0", - "@material/form-field": "^0.32.0", - "@material/grid-list": "^0.30.0", - "@material/icon-toggle": "^0.32.0", - "@material/layout-grid": "^0.24.0", - "@material/line-ripple": "^0.32.0", - "@material/linear-progress": "^0.30.0", - "@material/list": "^0.32.0", - "@material/menu": "^0.31.0", - "@material/radio": "^0.32.0", - "@material/ripple": "^0.32.0", - "@material/rtl": "^0.30.0", - "@material/select": "^0.32.0", - "@material/selection-control": "^0.32.0", - "@material/slider": "^0.32.0", - "@material/snackbar": "^0.30.0", - "@material/switch": "^0.32.0", - "@material/tabs": "^0.32.0", - "@material/textfield": "^0.32.0", - "@material/theme": "^0.30.0", - "@material/toolbar": "^0.32.0", - "@material/top-app-bar": "^0.32.0", - "@material/typography": "^0.28.0" + "@material/animation": "0.25.0", + "@material/auto-init": "0.32.0", + "@material/base": "0.29.0", + "@material/button": "0.32.0", + "@material/card": "0.32.0", + "@material/checkbox": "0.32.0", + "@material/chips": "0.32.0", + "@material/dialog": "0.32.0", + "@material/drawer": "0.30.0", + "@material/elevation": "0.28.0", + "@material/fab": "0.32.0", + "@material/floating-label": "0.32.0", + "@material/form-field": "0.32.0", + "@material/grid-list": "0.30.0", + "@material/icon-toggle": "0.32.0", + "@material/layout-grid": "0.24.0", + "@material/line-ripple": "0.32.0", + "@material/linear-progress": "0.30.0", + "@material/list": "0.32.0", + "@material/menu": "0.31.0", + "@material/radio": "0.32.0", + "@material/ripple": "0.32.0", + "@material/rtl": "0.30.0", + "@material/select": "0.32.0", + "@material/selection-control": "0.32.0", + "@material/slider": "0.32.0", + "@material/snackbar": "0.30.0", + "@material/switch": "0.32.0", + "@material/tabs": "0.32.0", + "@material/textfield": "0.32.0", + "@material/theme": "0.30.0", + "@material/toolbar": "0.32.0", + "@material/top-app-bar": "0.32.0", + "@material/typography": "0.28.0" } }, "memory-fs": { @@ -787,8 +787,8 @@ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" + "errno": "0.1.7", + "readable-stream": "2.3.5" } }, "minimist": { @@ -806,8 +806,8 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" + "encoding": "0.1.12", + "is-stream": "1.1.0" } }, "object-assign": { @@ -820,7 +820,7 @@ "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "requires": { - "path-platform": "~0.11.15" + "path-platform": "0.11.15" } }, "path-parse": { @@ -843,7 +843,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "requires": { - "asap": "~2.0.3" + "asap": "2.0.6" } }, "prop-types": { @@ -851,9 +851,9 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", "requires": { - "fbjs": "^0.8.16", - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" } }, "prr": { @@ -866,10 +866,10 @@ "resolved": "https://registry.npmjs.org/react/-/react-15.5.4.tgz", "integrity": "sha1-+oPrAVBqsjfNwcjDsc6o3gEr8Ec=", "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.1.0", - "object-assign": "^4.1.0", - "prop-types": "^15.5.7" + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "prop-types": "15.6.1" } }, "react-dom": { @@ -877,10 +877,10 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.5.4.tgz", "integrity": "sha1-ugwoeG/VLtfk8hNf4CiNRirvk9o=", "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.1.0", - "object-assign": "^4.1.0", - "prop-types": "~15.5.7" + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "prop-types": "15.5.10" }, "dependencies": { "prop-types": { @@ -888,8 +888,8 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz", "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=", "requires": { - "fbjs": "^0.8.9", - "loose-envify": "^1.3.1" + "fbjs": "0.8.16", + "loose-envify": "1.3.1" } } } @@ -907,7 +907,7 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.8.tgz", "integrity": "sha1-a3suFBCDvjjIWVqlH8VXdccZk5Q=", "requires": { - "fbjs": "^0.8.9" + "fbjs": "0.8.16" } } } @@ -917,13 +917,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.0.3", - "util-deprecate": "~1.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" }, "dependencies": { "process-nextick-args": { @@ -936,7 +936,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "5.1.1" } } } @@ -951,7 +951,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", "requires": { - "path-parse": "^1.0.5" + "path-parse": "1.0.5" } }, "rmwc": { @@ -959,7 +959,7 @@ "resolved": "https://registry.npmjs.org/rmwc/-/rmwc-1.4.1.tgz", "integrity": "sha512-Y8mZoc5tUgnQm/fTCz0lJIgJq2HzR+yTJxkhq6bunw56bJE1D09MNklfltQit5ss8olb0Dv7xwIARv4C+wGvqw==", "requires": { - "classnames": "^2.2.5", + "classnames": "2.2.5", "material-components-web": "0.32.0" } }, @@ -978,8 +978,8 @@ "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "requires": { - "duplexer2": "~0.1.0", - "readable-stream": "^2.0.2" + "duplexer2": "0.1.4", + "readable-stream": "2.3.5" } }, "string_decoder": { @@ -992,7 +992,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "2.1.1" } }, "subarg": { @@ -1000,7 +1000,7 @@ "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "requires": { - "minimist": "^1.1.0" + "minimist": "1.2.0" } }, "supports-color": { @@ -1028,8 +1028,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "^2.1.5", - "xtend": "~4.0.1" + "readable-stream": "2.3.5", + "xtend": "4.0.1" } }, "to-fast-properties": { diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index b1904115f..142daf9f2 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -770,6 +770,19 @@ form.vertical, .fields-vertical { animation: spin 2s linear infinite; } +.wizard { + .steps { + display: flex; + flex-direction: row; + justify-content: space-between; + border-bottom: 1px solid rgba(0,0,0,0.1); + margin-left: -25px; + margin-right: -25px; + padding: 0 25px; + height: 76px; + } +} + @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } diff --git a/src/planwise/client/projects2/components/listings.cljs b/src/planwise/client/projects2/components/listings.cljs index d94546652..b9d8cd24e 100644 --- a/src/planwise/client/projects2/components/listings.cljs +++ b/src/planwise/client/projects2/components/listings.cljs @@ -22,7 +22,7 @@ (static-image @region-geo map-preview-size) (static-image fullmap-region-geo map-preview-size))] (when region-id (dispatch [:regions/load-regions-with-preview [region-id]])) - [ui/card {:href (routes/projects2-show {:id id}) + [ui/card {:href (routes/projects2-show {:id id :step "goal"}) :primary [:img {:style map-preview-size :src preview-map-url}] :title (utils/or-blank (:name project) [:i "Untitled"]) :status (utils/or-blank (:state project) [:i "status: unknown"])}])) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 20e7de9b7..2d88f0b1e 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -125,88 +125,114 @@ ;------------------------------------------------------------------------------------------- +(defn- current-project-step-goal + [read-only current-project] + (let [current-project (subscribe [:projects2/current-project])]) + [:section {:class-name "project-settings-section"} + [section-header 1 "Goal"] + [current-project-input "Goal" [:name] "text"] + [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] + + [regions-dropdown-component {:label "Region" + :on-change #(dispatch [:projects2/save-key :region-id %]) + :model (:region-id current-project) + :disabled? read-only}]]) +(defn- current-project-step-consumers + [read-only current-project] + [:section {:class-name "project-settings-section"} + [section-header 2 "Demand"] + [sources-dropdown-component {:label "Sources" + :value (:source-set-id current-project) + :on-change #(dispatch [:projects2/save-key :source-set-id %]) + :disabled? read-only}] + [current-project-input "Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] + [current-project-input "Target" [:config :demographics :target] "number" {:disabled read-only :sub-type :percentage}] + [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) + + (defn- current-project-step-providers + [read-only current-project tags] + [:section {:class-name "project-settings-section"} + [section-header 3 "Providers"] + [providers-set-dropdown-component {:label "Provider Set" + :value (:provider-set-id current-project) + :on-change #(dispatch [:projects2/save-key :provider-set-id %]) + :disabled? read-only}] + + [current-project-input "Capacity workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] + [m/TextFieldHelperText {:persistent true} (str "How many " (get-in current-project [:config :demographics :unit-name]) " can be handled per provider capacity")] + + (when-not read-only [tag-input]) + [:label "Tags: " [tag-set tags read-only]] + [count-providers tags current-project]]) + + (defn current-project-settings-view - [{:keys [read-only]}] + [{:keys [read-only step]}] (let [current-project (subscribe [:projects2/current-project]) build-actions (subscribe [:projects2/build-actions]) upgrade-actions (subscribe [:projects2/upgrade-actions]) tags (subscribe [:projects2/tags])] - (fn [{:keys [read-only]}] - [m/Grid {} + (fn [{:keys [read-only step]}] + [m/Grid {:class-name "wizard"} + [m/GridCell {:span 12 :class-name "steps"} + (map-indexed (fn [i step] + [:a {:key i :href (routes/projects2-show {:id (:id @current-project) :step step})} + [:i (inc i)] + [:div step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical - [:section {:class-name "project-settings-section"} - [section-header 1 "Goal"] - [current-project-input "Goal" [:name] "text"] - [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] - - [regions-dropdown-component {:label "Region" - :on-change #(dispatch [:projects2/save-key :region-id %]) - :model (:region-id @current-project) - :disabled? read-only}]] - - [:section {:class-name "project-settings-section"} - [section-header 2 "Demand"] - [sources-dropdown-component {:label "Sources" - :value (:source-set-id @current-project) - :on-change #(dispatch [:projects2/save-key :source-set-id %]) - :disabled? read-only}] - - [current-project-input "Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] - [current-project-input "Target" [:config :demographics :target] "number" {:disabled read-only :sub-type :percentage}] - [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in @current-project [:config :demographics :unit-name]))]] - - [:section {:class-name "project-settings-section"} - [section-header 3 "Providers"] - [providers-set-dropdown-component {:label "Provider Set" - :value (:provider-set-id @current-project) - :on-change #(dispatch [:projects2/save-key :provider-set-id %]) - :disabled? read-only}] - - [current-project-input "Capacity workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] - [m/TextFieldHelperText {:persistent true} (str "How many " (get-in @current-project [:config :demographics :unit-name]) " can be handled per provider capacity")] - - (when-not read-only [tag-input]) - [:label "Tags: " [tag-set @tags read-only]] - [count-providers @tags @current-project]] - - [:section {:class-name "project-settings-section"} - [section-header 4 "Coverage"] - [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm @current-project) - :value (get-in @current-project [:config :coverage :filter-options]) - :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) - :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] - :disabled? read-only}]] - - [:section {:class-name "project-settings-section"} - [:div [:p [m/Icon "account_balance"] "Available budget"]] - [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] - [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] - - [:div [:p [m/Icon "domain"] "Building a new provider..."]] - [listing-actions {:read-only? read-only - :action-name :build - :list @build-actions}] - - [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] - [current-project-input "" [:config :actions :upgrade-budget] "number" {:disabled read-only :class "project-setting"}] - - [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] - [listing-actions {:read-only? read-only - :action-name :upgrade - :list @upgrade-actions}]]]]]))) + (:div :step step); TODO: Remove this + (case step + "goal" [current-project-step-goal read-only @current-project] + "consumers" [current-project-step-consumers read-only @current-project] + "providers" [current-project-step-providers read-only @current-project @tags] + "coverage" [:div "es coverage"] + "actions" [:div "es actions"] + "review" [:div "es review"] + [])]]]))) + ; + + ; + + + ; + ; [:section {:class-name "project-settings-section"} + ; [section-header 4 "Coverage"] + ; [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm @current-project) + ; :value (get-in @current-project [:config :coverage :filter-options]) + ; :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) + ; :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] + ; :disabled? read-only}]] + ; + ; [:section {:class-name "project-settings-section"} + ; [:div [:p [m/Icon "account_balance"] "Available budget"]] + ; [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] + ; [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] + ; + ; [:div [:p [m/Icon "domain"] "Building a new provider..."]] + ; [listing-actions {:read-only? read-only + ; :action-name :build + ; :list @build-actions}] + ; + ; [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] + ; [current-project-input "" [:config :actions :upgrade-budget] "number" {:disabled read-only :class "project-setting"}] + ; + ; [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] + ; [listing-actions {:read-only? read-only + ; :action-name :upgrade + ; :list @upgrade-actions}]]]]]))) (defn edit-current-project - [] - (let [current-project (subscribe [:projects2/current-project]) + [test] + (let [page-params (subscribe [:page-params]) + current-project (subscribe [:projects2/current-project]) delete? (r/atom false) hide-dialog (fn [] (reset! delete? false))] (fn [] [ui/fixed-width (common2/nav-params) [ui/panel {} - - [current-project-settings-view {:read-only false}] + [current-project-settings-view{:read-only false :step (:step @page-params)}] [:div {:class-name "project-settings-actions"} [project-delete-button delete?] diff --git a/src/planwise/client/projects2/views.cljs b/src/planwise/client/projects2/views.cljs index 1712e0297..4cbb0a2e7 100644 --- a/src/planwise/client/projects2/views.cljs +++ b/src/planwise/client/projects2/views.cljs @@ -20,7 +20,7 @@ (not= (:id @current-project) id) (do (dispatch [:projects2/get-project id]) [common2/loading-placeholder]) - (= "draft" (:state @current-project)) [settings/edit-current-project] + (= "draft" (:state @current-project)) [settings/edit-current-project @page-params] :else [dashboard/view-current-project section]))))) ;;------------------------------------------------------------------------ diff --git a/src/planwise/client/routes.cljs b/src/planwise/client/routes.cljs index 44d439f36..762702a98 100644 --- a/src/planwise/client/routes.cljs +++ b/src/planwise/client/routes.cljs @@ -14,8 +14,8 @@ (dispatch [:navigate {:page :sources}])) (defroute projects2 "/projects2" [] (dispatch [:navigate {:page :projects2, :section :index}])) -(defroute projects2-show "/projects2/:id" [id] - (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :section :show}])) +(defroute projects2-show "/projects2/:id/steps/:step" [id step] + (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :step step, :section :show}])) (defroute design "/_design" [] (dispatch [:navigate {:page :design}])) (defroute design-section "/_design/:section" [section query-params] @@ -27,4 +27,4 @@ (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :section :project-scenarios}])) (defroute projects2-settings "/projects2/:id/settings" [id] (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :section :project-settings}])) -(defroute download-sources-sample "/sources-sample.csv" []) \ No newline at end of file +(defroute download-sources-sample "/sources-sample.csv" []) diff --git a/src/planwise/endpoint/home.clj b/src/planwise/endpoint/home.clj index 20dab7520..74598876e 100644 --- a/src/planwise/endpoint/home.clj +++ b/src/planwise/endpoint/home.clj @@ -222,6 +222,7 @@ (GET "/sources" [] loading-page2) (context "/projects2" [] (GET "/" [] loading-page2) + (GET "/:id/steps/:step" [] loading-page2) (GET "/:id" [] loading-page2) (GET "/:id/scenarios" [] loading-page2) (GET "/:id/settings" [] loading-page2) From 6c5a47c708d55191f36934b53b5ab71588c9b93c Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 2 May 2019 15:17:05 -0300 Subject: [PATCH 02/38] [WIP] Updating form to divide it into steps --- .../client/projects2/components/settings.cljs | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 2d88f0b1e..b313f44c9 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -165,6 +165,38 @@ [:label "Tags: " [tag-set tags read-only]] [count-providers tags current-project]]) +(defn- current-project-step-coverage + [read-only current-project] + + [:section {:class-name "project-settings-section"} + [section-header 4 "Coverage"] + [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm current-project) + :value (get-in current-project [:config :coverage :filter-options]) + :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) + :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] + :disabled? read-only}]]) + +(defn- current-project-step-actions + [read-only current-project build-actions upgrade-actions] + + [:section {:class-name "project-settings-section"} + [:div [:p [m/Icon "account_balance"] "Available budget"]] + [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] + [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] + + [:div [:p [m/Icon "domain"] "Building a new provider..."]] + [listing-actions {:read-only? read-only + :action-name :build + :list build-actions}] + + [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] + [current-project-input "" [:config :actions :upgrade-budget] "number" {:disabled read-only :class "project-setting"}] + + [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] + [listing-actions {:read-only? read-only + :action-name :upgrade + :list upgrade-actions}]]) + (defn current-project-settings-view [{:keys [read-only step]}] @@ -181,50 +213,17 @@ [:div step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical - (:div :step step); TODO: Remove this (case step "goal" [current-project-step-goal read-only @current-project] "consumers" [current-project-step-consumers read-only @current-project] "providers" [current-project-step-providers read-only @current-project @tags] - "coverage" [:div "es coverage"] - "actions" [:div "es actions"] + "coverage" [current-project-step-coverage read-only @current-project] + "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] "review" [:div "es review"] [])]]]))) - ; - - ; - - - ; - ; [:section {:class-name "project-settings-section"} - ; [section-header 4 "Coverage"] - ; [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm @current-project) - ; :value (get-in @current-project [:config :coverage :filter-options]) - ; :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) - ; :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] - ; :disabled? read-only}]] - ; - ; [:section {:class-name "project-settings-section"} - ; [:div [:p [m/Icon "account_balance"] "Available budget"]] - ; [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] - ; [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] - ; - ; [:div [:p [m/Icon "domain"] "Building a new provider..."]] - ; [listing-actions {:read-only? read-only - ; :action-name :build - ; :list @build-actions}] - ; - ; [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] - ; [current-project-input "" [:config :actions :upgrade-budget] "number" {:disabled read-only :class "project-setting"}] - ; - ; [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] - ; [listing-actions {:read-only? read-only - ; :action-name :upgrade - ; :list @upgrade-actions}]]]]]))) - (defn edit-current-project - [test] + [] (let [page-params (subscribe [:page-params]) current-project (subscribe [:projects2/current-project]) delete? (r/atom false) From 148fbb1b33c9dce817ddb4c7c64aa2b4e1624cba Mon Sep 17 00:00:00 2001 From: pmallol Date: Mon, 6 May 2019 16:16:14 -0300 Subject: [PATCH 03/38] Add style for wizard steps states For #537 --- resources/sass/site2.scss | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 142daf9f2..c3032df29 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -780,6 +780,47 @@ form.vertical, .fields-vertical { margin-right: -25px; padding: 0 25px; height: 76px; + + > a { + text-decoration: none; + text-transform: capitalize; + i { + background-color: #999999; + color: #ffffff; + font-style: normal; + padding: 5px 11px; + margin-right: 10px; + border-radius: 50%; + } + div { + color: #999999; + display: inline-block; + &:after { + content: ""; + position: absolute; + height: 12px; + width: 5%; + margin-left: 10px; + border-bottom: 1px solid #999999; + } + } + &:last-child div:after { + border: none; + } + } + + .complete { + i { + background-color: $mdc-theme-primary; + } + div { + color: #000000; + } + } + .active { + @extend .complete; + font-weight: 500; + } } } From 813b8adf8e7aa5e14d9dcbc3e0abbe104f65bd77 Mon Sep 17 00:00:00 2001 From: pmallol Date: Mon, 6 May 2019 16:55:05 -0300 Subject: [PATCH 04/38] Fix formatting --- .../client/projects2/components/settings.cljs | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index b313f44c9..55a90656c 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -129,14 +129,14 @@ [read-only current-project] (let [current-project (subscribe [:projects2/current-project])]) [:section {:class-name "project-settings-section"} - [section-header 1 "Goal"] - [current-project-input "Goal" [:name] "text"] - [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] - - [regions-dropdown-component {:label "Region" - :on-change #(dispatch [:projects2/save-key :region-id %]) - :model (:region-id current-project) - :disabled? read-only}]]) + [section-header 1 "Goal"] + [current-project-input "Goal" [:name] "text"] + [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] + + [regions-dropdown-component {:label "Region" + :on-change #(dispatch [:projects2/save-key :region-id %]) + :model (:region-id current-project) + :disabled? read-only}]]) (defn- current-project-step-consumers [read-only current-project] [:section {:class-name "project-settings-section"} @@ -149,32 +149,32 @@ [current-project-input "Target" [:config :demographics :target] "number" {:disabled read-only :sub-type :percentage}] [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) - (defn- current-project-step-providers - [read-only current-project tags] - [:section {:class-name "project-settings-section"} - [section-header 3 "Providers"] - [providers-set-dropdown-component {:label "Provider Set" - :value (:provider-set-id current-project) - :on-change #(dispatch [:projects2/save-key :provider-set-id %]) - :disabled? read-only}] +(defn- current-project-step-providers + [read-only current-project tags] + [:section {:class-name "project-settings-section"} + [section-header 3 "Providers"] + [providers-set-dropdown-component {:label "Provider Set" + :value (:provider-set-id current-project) + :on-change #(dispatch [:projects2/save-key :provider-set-id %]) + :disabled? read-only}] - [current-project-input "Capacity workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] - [m/TextFieldHelperText {:persistent true} (str "How many " (get-in current-project [:config :demographics :unit-name]) " can be handled per provider capacity")] + [current-project-input "Capacity workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] + [m/TextFieldHelperText {:persistent true} (str "How many " (get-in current-project [:config :demographics :unit-name]) " can be handled per provider capacity")] - (when-not read-only [tag-input]) - [:label "Tags: " [tag-set tags read-only]] - [count-providers tags current-project]]) + (when-not read-only [tag-input]) + [:label "Tags: " [tag-set tags read-only]] + [count-providers tags current-project]]) (defn- current-project-step-coverage [read-only current-project] [:section {:class-name "project-settings-section"} - [section-header 4 "Coverage"] - [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm current-project) - :value (get-in current-project [:config :coverage :filter-options]) - :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) - :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] - :disabled? read-only}]]) + [section-header 4 "Coverage"] + [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm current-project) + :value (get-in current-project [:config :coverage :filter-options]) + :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) + :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] + :disabled? read-only}]]) (defn- current-project-step-actions [read-only current-project build-actions upgrade-actions] @@ -208,19 +208,19 @@ [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} (map-indexed (fn [i step] - [:a {:key i :href (routes/projects2-show {:id (:id @current-project) :step step})} - [:i (inc i)] - [:div step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] + [:a {:key i :href (routes/projects2-show {:id (:id @current-project) :step step})} + [:i (inc i)] + [:div step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical - (case step - "goal" [current-project-step-goal read-only @current-project] - "consumers" [current-project-step-consumers read-only @current-project] - "providers" [current-project-step-providers read-only @current-project @tags] - "coverage" [current-project-step-coverage read-only @current-project] - "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] - "review" [:div "es review"] - [])]]]))) + (case step + "goal" [current-project-step-goal read-only @current-project] + "consumers" [current-project-step-consumers read-only @current-project] + "providers" [current-project-step-providers read-only @current-project @tags] + "coverage" [current-project-step-coverage read-only @current-project] + "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] + "review" [:div "es review"] + [])]]]))) (defn edit-current-project [] @@ -231,7 +231,7 @@ (fn [] [ui/fixed-width (common2/nav-params) [ui/panel {} - [current-project-settings-view{:read-only false :step (:step @page-params)}] + [current-project-settings-view {:read-only false :step (:step @page-params)}] [:div {:class-name "project-settings-actions"} [project-delete-button delete?] From 248bd97d75a09f15e1e7351c454eef864e26a200 Mon Sep 17 00:00:00 2001 From: pmallol Date: Mon, 6 May 2019 19:56:54 -0300 Subject: [PATCH 05/38] Apply minor fixes in steps style For #537 --- resources/sass/site2.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index c3032df29..89466b8c3 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -778,8 +778,8 @@ form.vertical, .fields-vertical { border-bottom: 1px solid rgba(0,0,0,0.1); margin-left: -25px; margin-right: -25px; - padding: 0 25px; - height: 76px; + padding: 5px 20px 0; + height: 56px; > a { text-decoration: none; @@ -799,9 +799,9 @@ form.vertical, .fields-vertical { content: ""; position: absolute; height: 12px; - width: 5%; + min-width: 85px; margin-left: 10px; - border-bottom: 1px solid #999999; + border-bottom: 1px solid rgba(0,0,0,0.1); } } &:last-child div:after { From ef2097969db7883eeefe0ea85270d9b5501c5cb4 Mon Sep 17 00:00:00 2001 From: pmallol Date: Mon, 6 May 2019 20:03:19 -0300 Subject: [PATCH 06/38] Add space for map in wizard layout For #537 --- resources/sass/site2.scss | 4 ++++ src/planwise/client/projects2/components/settings.cljs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 89466b8c3..19185f8da 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -822,6 +822,10 @@ form.vertical, .fields-vertical { font-weight: 500; } } + .map { + min-height: 500px; + height: 100%; + } } @keyframes spin { diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 55a90656c..5ac4ceab8 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -220,7 +220,9 @@ "coverage" [current-project-step-coverage read-only @current-project] "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] "review" [:div "es review"] - [])]]]))) + [])]] + [m/GridCell {:span 6} + [:div.map]]]))) (defn edit-current-project [] From 282c1722f69558a13320c4945baa7544854e01be Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Tue, 7 May 2019 15:43:12 -0300 Subject: [PATCH 07/38] [WIP] Added next step --- .../client/projects2/components/settings.cljs | 21 ++++++++++++++----- src/planwise/client/projects2/handlers.cljs | 8 +++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index b313f44c9..a31498659 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -55,6 +55,16 @@ :on-click (utils/prevent-default #(dispatch [:projects2/start-project (:id project)]))} (if (= (keyword (:state project)) :started) "Started ..." "Start")]) + +(defn- project-next-step-button + [project step] + [m/Button {:id "start-project" + :type "button" + :unelevated "unelevated" + ; :disabled (not (s/valid? :planwise.model.project/starting project)) + :on-click (utils/prevent-default #(dispatch [:projects2/next-step-project (:id project) step]))} + "Continue"]) + (defn- project-delete-button [state] [m/Button {:type "button" @@ -140,8 +150,8 @@ (defn- current-project-step-consumers [read-only current-project] [:section {:class-name "project-settings-section"} - [section-header 2 "Demand"] - [sources-dropdown-component {:label "Sources" + [section-header 2 "Consumers"] + [sources-dropdown-component {:label "Consumer Dataset" :value (:source-set-id current-project) :on-change #(dispatch [:projects2/save-key :source-set-id %]) :disabled? read-only}] @@ -219,7 +229,7 @@ "providers" [current-project-step-providers read-only @current-project @tags] "coverage" [current-project-step-coverage read-only @current-project] "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] - "review" [:div "es review"] + "review" [:div "review"] [])]]]))) (defn edit-current-project @@ -234,8 +244,9 @@ [current-project-settings-view{:read-only false :step (:step @page-params)}] [:div {:class-name "project-settings-actions"} - [project-delete-button delete?] - [project-start-button {} @current-project]]] + ; [project-delete-button delete?] + [project-next-step-button @current-project (:step @page-params)]]] + ; [project-start-button {} @current-project]]] [delete-project-dialog {:open? @delete? :cancel-fn hide-dialog :delete-fn #(dispatch [:projects2/delete-project (:id @current-project)])}]]))) diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index a2212ac1c..02fb3a136 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -31,6 +31,14 @@ (assoc :list new-list)) :navigate (routes/projects2-show {:id project-id})}))) +(rf/reg-event-fx + :projects2/next-step-project + in-projects2 + (fn [{:keys [db]} [_ project-id step]] + (let [steps ["goal", "consumers", "providers", "coverage", "actions", "review"]] + {:navigate (routes/projects2-show {:id project-id :step (steps (inc (.indexOf steps step)))})}))) + + ;;------------------------------------------------------------------------------ ;; Updating db From f2550cbd113d22c7efdca0dca49477b6a101bb41 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Wed, 8 May 2019 12:06:59 -0300 Subject: [PATCH 08/38] Added active on current step --- .../client/projects2/components/settings.cljs | 20 ++++++++++--------- src/planwise/client/projects2/handlers.cljs | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 43b0aec95..8df3c642c 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -57,13 +57,13 @@ (defn- project-next-step-button - [project step] - [m/Button {:id "start-project" - :type "button" - :unelevated "unelevated" + [project step] + [m/Button {:id "start-project" + :type "button" + :unelevated "unelevated" ; :disabled (not (s/valid? :planwise.model.project/starting project)) - :on-click (utils/prevent-default #(dispatch [:projects2/next-step-project (:id project) step]))} - "Continue"]) + :on-click (utils/prevent-default #(dispatch [:projects2/next-step-project (:id project) step]))} + "Continue"]) (defn- project-delete-button [state] @@ -217,10 +217,12 @@ (fn [{:keys [read-only step]}] [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} - (map-indexed (fn [i step] - [:a {:key i :href (routes/projects2-show {:id (:id @current-project) :step step})} + (map-indexed (fn [i iteration-step] + [:a {:key i + :class-name (if (= iteration-step step) "active") + :href (routes/projects2-show {:id (:id @current-project) :step iteration-step})} [:i (inc i)] - [:div step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] + [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical (case step diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index 02fb3a136..86f400889 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -36,7 +36,7 @@ in-projects2 (fn [{:keys [db]} [_ project-id step]] (let [steps ["goal", "consumers", "providers", "coverage", "actions", "review"]] - {:navigate (routes/projects2-show {:id project-id :step (steps (inc (.indexOf steps step)))})}))) + {:navigate (routes/projects2-show {:id project-id :step (steps (inc (.indexOf steps step)))})}))) ;;------------------------------------------------------------------------------ From 05a2be1d87e576f7ba5d8635cf8a10f9dbb5c57a Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 9 May 2019 11:03:58 -0300 Subject: [PATCH 09/38] Added confirm button on final step --- src/planwise/client/projects2/components/settings.cljs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 8df3c642c..9a07f649b 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -61,8 +61,8 @@ [m/Button {:id "start-project" :type "button" :unelevated "unelevated" - ; :disabled (not (s/valid? :planwise.model.project/starting project)) - :on-click (utils/prevent-default #(dispatch [:projects2/next-step-project (:id project) step]))} + :disabled (if (= step "review") (not (s/valid? :planwise.model.project/starting project)) false) + :on-click (utils/prevent-default #(if (= step "review") (utils/prevent-default (dispatch [:projects2/start-project (:id project)])) (dispatch [:projects2/next-step-project (:id project) step])))} "Continue"]) (defn- project-delete-button @@ -207,6 +207,11 @@ :action-name :upgrade :list upgrade-actions}]]) +(defn- validate-step + [current-project step] + (let [validations {"goal" {:goal [:presence] :region [:presence]}}] + (println (get-in {"goal" "test"} "goal")))) + (defn current-project-settings-view [{:keys [read-only step]}] @@ -218,6 +223,7 @@ [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} (map-indexed (fn [i iteration-step] + (validate-step @current-project step) [:a {:key i :class-name (if (= iteration-step step) "active") :href (routes/projects2-show {:id (:id @current-project) :step iteration-step})} From 0378b97fdcf0aa3cb8537fe8933b66be89283df9 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 9 May 2019 17:42:39 -0300 Subject: [PATCH 10/38] Added validations on steps --- .../client/projects2/components/settings.cljs | 11 ++--------- src/planwise/model/project.cljc | 8 ++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 9a07f649b..f783c60ed 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -2,7 +2,7 @@ (:require [reagent.core :as r] [re-frame.core :refer [subscribe dispatch] :as rf] [re-com.core :as rc] - [clojure.string :refer [blank?]] + [clojure.string :refer [blank? join]] [planwise.client.asdf :as asdf] [planwise.client.dialog :refer [dialog]] [planwise.client.components.common2 :as common2] @@ -207,12 +207,6 @@ :action-name :upgrade :list upgrade-actions}]]) -(defn- validate-step - [current-project step] - (let [validations {"goal" {:goal [:presence] :region [:presence]}}] - (println (get-in {"goal" "test"} "goal")))) - - (defn current-project-settings-view [{:keys [read-only step]}] (let [current-project (subscribe [:projects2/current-project]) @@ -223,11 +217,10 @@ [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} (map-indexed (fn [i iteration-step] - (validate-step @current-project step) [:a {:key i :class-name (if (= iteration-step step) "active") :href (routes/projects2-show {:id (:id @current-project) :step iteration-step})} - [:i (inc i)] + (if (s/valid? (keyword "planwise.model.project" (str iteration-step "-step")) @current-project) [m/Icon "done"] [:i (inc i)]) [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical diff --git a/src/planwise/model/project.cljc b/src/planwise/model/project.cljc index 92349936c..c4ed5e1d4 100644 --- a/src/planwise/model/project.cljc +++ b/src/planwise/model/project.cljc @@ -45,3 +45,11 @@ ;; Project Starting (s/def ::starting (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) + +;; TODO: Use real validations +(s/def ::goal-step (s/keys :req-un [::name ::region-id])) +(s/def ::consumers-step (s/keys :req-un [::source-set-id])) +(s/def ::providers-step (s/keys :req-un [::id ::owner-id ::provider-set-id])) +(s/def ::coverage-step (s/keys :req-un [::id ::owner-id ::name])) +(s/def ::actions-step (s/keys :req-un [::id ::owner-id ::actions])) +(s/def ::review-step (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) From 89c90bb3d5d7104c6f9f98c35a67158ff37d91f8 Mon Sep 17 00:00:00 2001 From: pmallol Date: Thu, 9 May 2019 17:53:18 -0300 Subject: [PATCH 11/38] Fix icon and title alignment for project settings --- resources/sass/site2.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 19185f8da..ca245b2d7 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -526,6 +526,14 @@ form.vertical, .fields-vertical { color: rgba(0, 0, 0, 0.6); margin: 25px 0 0; } + + div > p, button { + display: inline-flex; + align-items: center; + .material-icons { + margin-right: 10px; + } + } } .project-settings-actions { From 5d7ccae52ab51a22a85310335e90aab76d39bd9e Mon Sep 17 00:00:00 2001 From: pmallol Date: Fri, 10 May 2019 21:59:45 -0300 Subject: [PATCH 12/38] Fix style for wizard complete step --- resources/sass/site2.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index ca245b2d7..9134f2755 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -783,6 +783,7 @@ form.vertical, .fields-vertical { display: flex; flex-direction: row; justify-content: space-between; + align-items: flex-start; border-bottom: 1px solid rgba(0,0,0,0.1); margin-left: -25px; margin-right: -25px; @@ -792,6 +793,8 @@ form.vertical, .fields-vertical { > a { text-decoration: none; text-transform: capitalize; + display: flex; + align-items: center; i { background-color: #999999; color: #ffffff; @@ -829,6 +832,11 @@ form.vertical, .fields-vertical { @extend .complete; font-weight: 500; } + .material-icons { + font-size: 19px; + display: inline; + padding: 6px; + } } .map { min-height: 500px; From e0ad2fbb9c6883893820d16073d7b1b1777d7879 Mon Sep 17 00:00:00 2001 From: pmallol Date: Fri, 10 May 2019 22:54:30 -0300 Subject: [PATCH 13/38] Add header to Action step settings --- src/planwise/client/projects2/components/settings.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index f783c60ed..9a87debdb 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -190,6 +190,7 @@ [read-only current-project build-actions upgrade-actions] [:section {:class-name "project-settings-section"} + [section-header 5 "Actions"] [:div [:p [m/Icon "account_balance"] "Available budget"]] [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] From a3f6d7638006844ef81a5336cb860c35a9642225 Mon Sep 17 00:00:00 2001 From: pmallol Date: Fri, 10 May 2019 23:01:03 -0300 Subject: [PATCH 14/38] [WIP] Add elements and apply style in review section --- resources/sass/site2.scss | 4 ++++ .../client/projects2/components/settings.cljs | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 9134f2755..815834050 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -516,6 +516,10 @@ form.vertical, .fields-vertical { margin-bottom: 0; } } + .step-info { + line-height: 24px; + margin: 1.2rem 0 3rem; + } .mdc-select { margin-top: 16px; diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 9a87debdb..a8400fd1d 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -208,6 +208,17 @@ :action-name :upgrade :list upgrade-actions}]]) +(defn- current-project-step-review + [read-only current-project] + [:section {:class "project-settings-section"} + [section-header 6 "Review"] + [:div {:class "step-info"} "After this step the system will search for different improvements scenarios based on the given parameters. Once started, the process will continue even if you leave the site. From the dashboard you will be able to see the scenarios found so far, pause the search and review the performed work."] + [:div [:p [m/Icon "location_on"] "Kenya health facilities - ResMap 8902"]] + [:div [:p [m/Icon "account_balance"] "K 25,000,000"]] + [:div [:p [m/Icon "people"] "Kenya census 2005"]] + [:div [:p [m/Icon "directions"] "120 min walking distance, 40 min driving"]] + [:div [:p [m/Icon "info"] "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]]) + (defn current-project-settings-view [{:keys [read-only step]}] (let [current-project (subscribe [:projects2/current-project]) @@ -231,7 +242,7 @@ "providers" [current-project-step-providers read-only @current-project @tags] "coverage" [current-project-step-coverage read-only @current-project] "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] - "review" [:div "es review"] + "review" [current-project-step-review read-only @current-project] [])]] [m/GridCell {:span 6} [:div.map]]]))) From fbf4caae1d0f5d00a2657adbf06098e4ddfd948a Mon Sep 17 00:00:00 2001 From: pmallol Date: Sat, 11 May 2019 00:23:27 -0300 Subject: [PATCH 15/38] Update copy in project settings --- src/planwise/client/projects2/components/settings.cljs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index a8400fd1d..2d5873fdd 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -155,7 +155,8 @@ :value (:source-set-id current-project) :on-change #(dispatch [:projects2/save-key :source-set-id %]) :disabled? read-only}] - [current-project-input "Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] + [current-project-input "Consumers Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] + [m/TextFieldHelperText {:persistent true} (str "How do you refer to the filtered population? (Eg: women)")] [current-project-input "Target" [:config :demographics :target] "number" {:disabled read-only :sub-type :percentage}] [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) @@ -163,14 +164,13 @@ [read-only current-project tags] [:section {:class-name "project-settings-section"} [section-header 3 "Providers"] - [providers-set-dropdown-component {:label "Provider Set" + [providers-set-dropdown-component {:label "Provider Dataset" :value (:provider-set-id current-project) :on-change #(dispatch [:projects2/save-key :provider-set-id %]) :disabled? read-only}] - [current-project-input "Capacity workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] - [m/TextFieldHelperText {:persistent true} (str "How many " (get-in current-project [:config :demographics :unit-name]) " can be handled per provider capacity")] - + [current-project-input "Capacity Workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] + [m/TextFieldHelperText {:persistent true} (str "How many " (or (not-empty (get-in current-project [:config :demographics :unit-name])) "consumers") " can each provider handle?")] (when-not read-only [tag-input]) [:label "Tags: " [tag-set tags read-only]] [count-providers tags current-project]]) From f833c098397bd8a0bb8cb1f08c6f2f0a153c3194 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Mon, 13 May 2019 09:57:25 -0300 Subject: [PATCH 16/38] Minor fix for project link & goal step validations --- src/planwise/client/projects2/handlers.cljs | 2 +- src/planwise/model/project.cljc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index 86f400889..945a2f546 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -29,7 +29,7 @@ {:db (-> db (assoc :current-project nil) (assoc :list new-list)) - :navigate (routes/projects2-show {:id project-id})}))) + :navigate (routes/projects2-show {:id project-id :step "goal"})}))) (rf/reg-event-fx :projects2/next-step-project diff --git a/src/planwise/model/project.cljc b/src/planwise/model/project.cljc index c4ed5e1d4..586c8ebf7 100644 --- a/src/planwise/model/project.cljc +++ b/src/planwise/model/project.cljc @@ -7,7 +7,7 @@ ;; Goal (s/def ::id number?) -(s/def ::name string?) +(s/def ::name (s/and string? (comp not blank?))) (s/def ::region-id number?) ;; Demographics From 7d71822e1bd38b1b2e1b16eb4304001462d81fec Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Mon, 13 May 2019 13:00:21 -0300 Subject: [PATCH 17/38] Added validations for steps in wizards --- .../client/projects2/components/settings.cljs | 10 ++++- src/planwise/model/project.cljc | 5 +-- src/planwise/model/project_actions.cljc | 9 ++++ src/planwise/model/project_consumers.cljc | 11 +++++ src/planwise/model/project_coverage.cljc | 20 +++++++++ src/planwise/model/project_goal.cljc | 7 ++++ src/planwise/model/project_providers.cljc | 10 +++++ src/planwise/model/project_review.cljc | 42 +++++++++++++++++++ 8 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 src/planwise/model/project_actions.cljc create mode 100644 src/planwise/model/project_consumers.cljc create mode 100644 src/planwise/model/project_coverage.cljc create mode 100644 src/planwise/model/project_goal.cljc create mode 100644 src/planwise/model/project_providers.cljc create mode 100644 src/planwise/model/project_review.cljc diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index f783c60ed..37fc0eb90 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -16,7 +16,13 @@ [planwise.client.ui.filter-select :as filter-select] [planwise.client.ui.rmwc :as m] [planwise.client.utils :as utils] - [clojure.spec.alpha :as s])) + [clojure.spec.alpha :as s] + [planwise.model.project-consumers] + [planwise.model.project-actions] + [planwise.model.project-coverage] + [planwise.model.project-providers] + [planwise.model.project-review] + [planwise.model.project-goal])) ;;------------------------------------------------------------------------ ;;Current Project updating @@ -220,7 +226,7 @@ [:a {:key i :class-name (if (= iteration-step step) "active") :href (routes/projects2-show {:id (:id @current-project) :step iteration-step})} - (if (s/valid? (keyword "planwise.model.project" (str iteration-step "-step")) @current-project) [m/Icon "done"] [:i (inc i)]) + (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} [:form.vertical diff --git a/src/planwise/model/project.cljc b/src/planwise/model/project.cljc index 586c8ebf7..0790e91f0 100644 --- a/src/planwise/model/project.cljc +++ b/src/planwise/model/project.cljc @@ -13,7 +13,7 @@ ;; Demographics (s/def ::source-set-id number?) (s/def ::target number?) -(s/def ::unit-name (comp not blank?)) +(s/def ::unit-name string?) (s/def ::demographics (s/keys :req-un [::unit-name ::target])) ;; Providers @@ -47,8 +47,7 @@ (s/def ::starting (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) ;; TODO: Use real validations -(s/def ::goal-step (s/keys :req-un [::name ::region-id])) -(s/def ::consumers-step (s/keys :req-un [::source-set-id])) +(s/def ::consumers-step (s/keys :req-un [::source-set-id ::consumer-config])) (s/def ::providers-step (s/keys :req-un [::id ::owner-id ::provider-set-id])) (s/def ::coverage-step (s/keys :req-un [::id ::owner-id ::name])) (s/def ::actions-step (s/keys :req-un [::id ::owner-id ::actions])) diff --git a/src/planwise/model/project_actions.cljc b/src/planwise/model/project_actions.cljc new file mode 100644 index 000000000..a354412f9 --- /dev/null +++ b/src/planwise/model/project_actions.cljc @@ -0,0 +1,9 @@ +(ns planwise.model.project-actions + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + +(s/def ::budget number?) +(s/def ::actions (s/keys :req-un [::budget])) +(s/def ::config (s/keys :req-un [::actions])) + +(s/def ::validation (s/keys :req-un [::config])) diff --git a/src/planwise/model/project_consumers.cljc b/src/planwise/model/project_consumers.cljc new file mode 100644 index 000000000..63f2c95d8 --- /dev/null +++ b/src/planwise/model/project_consumers.cljc @@ -0,0 +1,11 @@ +(ns planwise.model.project-consumers + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + +(s/def ::target number?) +(s/def ::unit-name (s/and string? (comp not blank?))) +(s/def ::demographics (s/keys :req-un [::unit-name ::target])) +(s/def ::source-set-id number?) + +(s/def ::config (s/keys :req-un [::demographics])) +(s/def ::validation (s/keys :req-un [::source-set-id ::config])) diff --git a/src/planwise/model/project_coverage.cljc b/src/planwise/model/project_coverage.cljc new file mode 100644 index 000000000..cd97ef582 --- /dev/null +++ b/src/planwise/model/project_coverage.cljc @@ -0,0 +1,20 @@ +(ns planwise.model.project-coverage + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + + +(s/def ::driving-time number?) +(s/def ::walking-time number?) +(s/def ::distance number?) + +(s/def ::driving-options (s/keys :req-un [::driving-time])) +(s/def ::walking-options (s/keys :req-un [::walking-time])) +(s/def ::distance-options (s/keys :req-un [::distance])) + +(s/def ::filter-options (s/or :driving-options ::driving-options + :walking-options ::walking-options + :distance-options ::distance-options)) +(s/def ::coverage (s/keys :req-un [::filter-options])) + +(s/def ::config (s/keys :req-un [::coverage])) +(s/def ::validation (s/keys :req-un [::config])) diff --git a/src/planwise/model/project_goal.cljc b/src/planwise/model/project_goal.cljc new file mode 100644 index 000000000..a11fa5a61 --- /dev/null +++ b/src/planwise/model/project_goal.cljc @@ -0,0 +1,7 @@ +(ns planwise.model.project-goal + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + +(s/def ::name (s/and string? (comp not blank?))) +(s/def ::region-id number?) +(s/def ::validation (s/keys :req-un [::name ::region-id])) diff --git a/src/planwise/model/project_providers.cljc b/src/planwise/model/project_providers.cljc new file mode 100644 index 000000000..6ccfc9287 --- /dev/null +++ b/src/planwise/model/project_providers.cljc @@ -0,0 +1,10 @@ +(ns planwise.model.project-providers + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + + +(s/def ::provider-set-id number?) +(s/def ::capacity number?) +(s/def ::providers (s/keys :req-un [::capacity])) +(s/def ::config (s/keys :req-un [::providers])) +(s/def ::validation (s/keys :req-un [::provider-set-id])) diff --git a/src/planwise/model/project_review.cljc b/src/planwise/model/project_review.cljc new file mode 100644 index 000000000..ae077965a --- /dev/null +++ b/src/planwise/model/project_review.cljc @@ -0,0 +1,42 @@ +(ns planwise.model.project-review + (:require [clojure.spec.alpha :as s] + [clojure.string :refer [blank?]])) + + +(s/def ::id number?) +(s/def ::name (s/and string? (comp not blank?))) +(s/def ::region-id number?) + +;; Demographics +(s/def ::source-set-id number?) +(s/def ::target number?) +(s/def ::unit-name string?) +(s/def ::demographics (s/keys :req-un [::unit-name ::target])) + +(s/def ::provider-set-id number?) +(s/def ::capacity number?) +(s/def ::providers (s/keys :req-un [::capacity])) + +;; Coverage +(s/def ::driving-time number?) +(s/def ::walking-time number?) +(s/def ::distance number?) + +(s/def ::driving-options (s/keys :req-un [::driving-time])) +(s/def ::walking-options (s/keys :req-un [::walking-time])) +(s/def ::distance-options (s/keys :req-un [::distance])) + + +(s/def ::filter-options (s/or :driving-options ::driving-options + :walking-options ::walking-options + :distance-options ::distance-options)) +(s/def ::coverage (s/keys :req-un [::filter-options])) + +;; Actions +(s/def ::budget number?) +(s/def ::actions (s/keys :req-un [::budget])) + +;; Config +(s/def ::config (s/keys :req-un [::demographics ::actions ::coverage ::providers])) + +(s/def ::validation (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) From 0f08dc9332dd2e0880ea947773cca72ef31ddc03 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Mon, 13 May 2019 14:16:03 -0300 Subject: [PATCH 18/38] Fixed input type number validations --- src/planwise/client/components/common2.cljs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/planwise/client/components/common2.cljs b/src/planwise/client/components/common2.cljs index f69e0ffcc..8b8ad40de 100644 --- a/src/planwise/client/components/common2.cljs +++ b/src/planwise/client/components/common2.cljs @@ -35,11 +35,12 @@ (defn mdc-input-field [props component-props] - (let [{:keys [id focus focus-extra-class label]} component-props] + (let [{:keys [id focus focus-extra-class label type]} component-props] [:div.mdc-text-field.mdc-text-field--upgraded {:class (cond (:read-only props) focus-extra-class @focus (str "mdc-text-field--focused" focus-extra-class))} [:input.mdc-text-field__input (merge props {:id id + :type type :on-focus #(reset! focus true) :on-blur #(reset! focus false)} (when @focus @@ -60,6 +61,7 @@ (fn [props] (let [component-props (assoc (select-keys props extra-keys) :id id + :type "test" :focus focus) props (apply dissoc props extra-keys)] [mdc-input-field props component-props])))) @@ -85,6 +87,7 @@ (select-keys props extra-keys) {:id (str (random-uuid)) :focus focus + :type "number" :focus-extra-class (when wrong-input " invalid-input")}) on-change-fn (:on-change props) global-value (str (:value props)) From 1b6740839062cf967fffb54e7e997fb101be63a4 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Tue, 14 May 2019 12:17:23 -0300 Subject: [PATCH 19/38] Added inference for first step --- .../client/projects2/components/listings.cljs | 2 +- .../client/projects2/components/settings.cljs | 4 ++-- src/planwise/client/projects2/handlers.cljs | 20 +++++++++++++++++-- src/planwise/client/routes.cljs | 4 +++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/planwise/client/projects2/components/listings.cljs b/src/planwise/client/projects2/components/listings.cljs index b9d8cd24e..d94546652 100644 --- a/src/planwise/client/projects2/components/listings.cljs +++ b/src/planwise/client/projects2/components/listings.cljs @@ -22,7 +22,7 @@ (static-image @region-geo map-preview-size) (static-image fullmap-region-geo map-preview-size))] (when region-id (dispatch [:regions/load-regions-with-preview [region-id]])) - [ui/card {:href (routes/projects2-show {:id id :step "goal"}) + [ui/card {:href (routes/projects2-show {:id id}) :primary [:img {:style map-preview-size :src preview-map-url}] :title (utils/or-blank (:name project) [:i "Untitled"]) :status (utils/or-blank (:state project) [:i "status: unknown"])}])) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 37fc0eb90..5519f5509 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -225,7 +225,7 @@ (map-indexed (fn [i iteration-step] [:a {:key i :class-name (if (= iteration-step step) "active") - :href (routes/projects2-show {:id (:id @current-project) :step iteration-step})} + :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] [m/GridCell {:span 6} @@ -237,7 +237,7 @@ "coverage" [current-project-step-coverage read-only @current-project] "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] "review" [:div "es review"] - [])]] + (dispatch [:projects2/infer-step @current-project]))]] [m/GridCell {:span 6} [:div.map]]]))) diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index 945a2f546..c2f4528a3 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -5,7 +5,15 @@ [planwise.client.routes :as routes] [planwise.client.effects :as effects] [planwise.client.projects2.db :as db] - [planwise.client.utils :as utils])) + [planwise.client.utils :as utils] + [clojure.spec.alpha :as s] + [planwise.model.project-consumers] + [planwise.model.project-actions] + [planwise.model.project-coverage] + [planwise.model.project-providers] + [planwise.model.project-review] + [planwise.model.project-goal])) + (def in-projects2 (rf/path [:projects2])) @@ -29,7 +37,15 @@ {:db (-> db (assoc :current-project nil) (assoc :list new-list)) - :navigate (routes/projects2-show {:id project-id :step "goal"})}))) + :navigate (routes/projects2-show {:id project-id})}))) + +(rf/reg-event-fx + :projects2/infer-step + in-projects2 + (fn [{:keys [db]} [_ project]] + (let [steps ["goal", "consumers", "providers", "coverage", "actions", "review"] + selected-step (first (filter #(not (s/valid? (keyword (str "planwise.model.project-" %) "validation") project)) steps))] + {:navigate (routes/projects2-show-with-step {:id (:id project) :step selected-step})}))) (rf/reg-event-fx :projects2/next-step-project diff --git a/src/planwise/client/routes.cljs b/src/planwise/client/routes.cljs index 762702a98..4708dc64c 100644 --- a/src/planwise/client/routes.cljs +++ b/src/planwise/client/routes.cljs @@ -14,7 +14,9 @@ (dispatch [:navigate {:page :sources}])) (defroute projects2 "/projects2" [] (dispatch [:navigate {:page :projects2, :section :index}])) -(defroute projects2-show "/projects2/:id/steps/:step" [id step] +(defroute projects2-show "/projects2/:id" [id] + (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :section :show}])) +(defroute projects2-show-with-step "/projects2/:id/steps/:step" [id step] (dispatch [:navigate {:page :projects2, :id (js/parseInt id), :step step, :section :show}])) (defroute design "/_design" [] (dispatch [:navigate {:page :design}])) From 3a82ba4c2182db2584e3bdcb5ea7baf4f7b216c5 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Tue, 14 May 2019 12:46:50 -0300 Subject: [PATCH 20/38] Fixed missing step on completed forms --- src/planwise/client/projects2/handlers.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index c2f4528a3..0584e1223 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -44,7 +44,8 @@ in-projects2 (fn [{:keys [db]} [_ project]] (let [steps ["goal", "consumers", "providers", "coverage", "actions", "review"] - selected-step (first (filter #(not (s/valid? (keyword (str "planwise.model.project-" %) "validation") project)) steps))] + first-invalid-step (first (filter #(not (s/valid? (keyword (str "planwise.model.project-" %) "validation") project)) steps)) + selected-step (if (not-empty first-invalid-step) first-invalid-step "review")] {:navigate (routes/projects2-show-with-step {:id (:id project) :step selected-step})}))) (rf/reg-event-fx From cc4edbe37f514720fa12a6848f7c3fbf6bd06092 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Tue, 14 May 2019 15:47:30 -0300 Subject: [PATCH 21/38] Fix for steps styles --- src/planwise/client/projects2/components/settings.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 5519f5509..75dc5945e 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -224,7 +224,7 @@ [m/GridCell {:span 12 :class-name "steps"} (map-indexed (fn [i iteration-step] [:a {:key i - :class-name (if (= iteration-step step) "active") + :class-name (if (= iteration-step step) "active completed") :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] From c007059619df453c19a9779beda9660176a0c512 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Tue, 14 May 2019 16:43:18 -0300 Subject: [PATCH 22/38] Fixed warnings about dereference --- .../client/projects2/components/settings.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 1b1a9db58..d329742c3 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -234,12 +234,13 @@ (fn [{:keys [read-only step]}] [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} - (map-indexed (fn [i iteration-step] - [:a {:key i - :class-name (if (= iteration-step step) "active completed") - :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} - (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) - [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"])] + (doall + (map-indexed (fn [i iteration-step] + [:a {:key i + :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) "complete")]) + :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} + (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) + [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] [m/GridCell {:span 6} [:form.vertical (case step From bec5744a9311dcd8b47eb6e3f8e1390c67abd0f3 Mon Sep 17 00:00:00 2001 From: pmallol Date: Tue, 14 May 2019 17:36:31 -0300 Subject: [PATCH 23/38] [WIP] Add prefix and suffix in input fields for project settings --- resources/sass/site2.scss | 33 ++++++++++++++++--- src/planwise/client/components/common2.cljs | 15 +++++---- .../client/projects2/components/settings.cljs | 8 +++-- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 815834050..119b4f811 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -589,12 +589,37 @@ form.vertical, .fields-vertical { margin-right: 15px; } -.project-setting{ - width: 554px; +.project-setting { + max-width: 554px; } -.action-input{ - width: 110px; +.action-input { + max-width: 100px; +} + +.prefix { + color: #999999; + font-style: normal; + position: absolute; + padding-bottom: 8px; + + + input { + padding-left: 15px; + } + + .suffix { + + input { + padding-left: 1rem; + } + } +} +.suffix { + @extend .prefix; + left: auto; + right: 0; + + input { + padding-right: 1rem; + padding-left: 0; + } } //empty projects diff --git a/src/planwise/client/components/common2.cljs b/src/planwise/client/components/common2.cljs index f69e0ffcc..5d8ff0f0c 100644 --- a/src/planwise/client/components/common2.cljs +++ b/src/planwise/client/components/common2.cljs @@ -35,15 +35,18 @@ (defn mdc-input-field [props component-props] - (let [{:keys [id focus focus-extra-class label]} component-props] + + (let [{:keys [id focus focus-extra-class label]} component-props + {:keys [prefix suffix]} props] [:div.mdc-text-field.mdc-text-field--upgraded {:class (cond (:read-only props) focus-extra-class @focus (str "mdc-text-field--focused" focus-extra-class))} - [:input.mdc-text-field__input (merge props {:id id - :on-focus #(reset! focus true) - :on-blur #(reset! focus false)} - (when @focus - {:placeholder nil}))] + (if (not-empty prefix) [:i.prefix prefix]) + (if (not-empty suffix) [:i.suffix suffix]) + [:input.mdc-text-field__input (apply dissoc (merge props {:id id + :on-focus #(reset! focus true) + :on-blur #(reset! focus false) + :placeholder (if @focus nil)}) [:prefix :suffix])] [:label.mdc-floating-label {:for id :class (when (or (not (blank? (str (:value props)))) @focus) "mdc-floating-label--float-above")} diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 2d5873fdd..996fa2a4e 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -33,13 +33,17 @@ (defn- current-project-input ([label path type] - (current-project-input label path type {:disabled false})) + (current-project-input label path type "" "" {:disabled false})) ([label path type other-props] + (current-project-input label path type "" "" {:disabled false})) + ([label path type prefix suffix other-props] (let [current-project (rf/subscribe [:projects2/current-project]) value (or (get-in @current-project path) "") change-fn #(rf/dispatch-sync [:projects2/save-key path %]) props (merge (select-keys other-props [:class :disabled :sub-type]) - {:label label + {:prefix prefix + :suffix suffix + :label label :on-change (comp change-fn (fn [e] (-> e .-target .-value))) :value value})] (case type From 9a4e50bcebb600b66ca5be92ad96c8d739d65054 Mon Sep 17 00:00:00 2001 From: pmallol Date: Tue, 14 May 2019 17:45:12 -0300 Subject: [PATCH 24/38] Add currency and percentage prefix/suffix to inputs in project settings --- .../client/projects2/components/settings.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 996fa2a4e..27da77351 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -123,9 +123,9 @@ props) [m/Icon "clear"]] (when (= action-name :build) "with a capacity of ") - [current-project-input "" [:config :actions action-name idx :capacity] "number" (merge {:class "action-input"} props)] - "would cost" - [current-project-input "" [:config :actions action-name idx :investment] "number" (merge {:class "action-input"} props)]]) + [current-project-input "" [:config :actions action-name idx :capacity] "number" "" "" (merge {:class "action-input"} props)] + " would cost " + [current-project-input "" [:config :actions action-name idx :investment] "number" "$" "" (merge {:class "action-input"} props)]]) (defn- listing-actions [{:keys [read-only? action-name list]}] @@ -161,7 +161,7 @@ :disabled? read-only}] [current-project-input "Consumers Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] [m/TextFieldHelperText {:persistent true} (str "How do you refer to the filtered population? (Eg: women)")] - [current-project-input "Target" [:config :demographics :target] "number" {:disabled read-only :sub-type :percentage}] + [current-project-input "Target" [:config :demographics :target] "number" "" "%" {:disabled read-only :sub-type :percentage}] [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) (defn- current-project-step-providers @@ -196,7 +196,7 @@ [:section {:class-name "project-settings-section"} [section-header 5 "Actions"] [:div [:p [m/Icon "account_balance"] "Available budget"]] - [current-project-input "" [:config :actions :budget] "number" {:disabled read-only :class "project-setting"}] + [current-project-input "" [:config :actions :budget] "number" "$" "" {:disabled read-only :class "project-setting"}] [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] [:div [:p [m/Icon "domain"] "Building a new provider..."]] @@ -205,7 +205,7 @@ :list build-actions}] [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] - [current-project-input "" [:config :actions :upgrade-budget] "number" {:disabled read-only :class "project-setting"}] + [current-project-input "" [:config :actions :upgrade-budget] "number" "$" "" {:disabled read-only :class "project-setting"}] [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] [listing-actions {:read-only? read-only From 5751f95106767ab2d9568372db726aab91be7600 Mon Sep 17 00:00:00 2001 From: pmallol Date: Tue, 14 May 2019 18:04:41 -0300 Subject: [PATCH 25/38] Fix format --- .../client/projects2/components/settings.cljs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 3ba018d51..85338e896 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -239,12 +239,12 @@ [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} (doall - (map-indexed (fn [i iteration-step] - [:a {:key i - :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) "complete")]) - :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} - (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) - [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] + (map-indexed (fn [i iteration-step] + [:a {:key i + :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) "complete")]) + :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} + (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) + [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] [m/GridCell {:span 6} [:form.vertical (case step From eab4ca79681becc4ab1754ab8e17e92f88aebdc2 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Wed, 15 May 2019 10:44:33 -0300 Subject: [PATCH 26/38] Added delete button again --- src/planwise/client/projects2/components/settings.cljs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 85338e896..44ecadf9f 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -271,9 +271,8 @@ [current-project-settings-view {:read-only false :step (:step @page-params)}] [:div {:class-name "project-settings-actions"} - ; [project-delete-button delete?] + [project-delete-button delete?] [project-next-step-button @current-project (:step @page-params)]]] - ; [project-start-button {} @current-project]]] [delete-project-dialog {:open? @delete? :cancel-fn hide-dialog :delete-fn #(dispatch [:projects2/delete-project (:id @current-project)])}]]))) From c7f386f371ad06f9bf3f756f0ead099b1d315d63 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Wed, 15 May 2019 13:26:27 -0300 Subject: [PATCH 27/38] Removed useless comment --- package-lock.json | 542 ++++++++++++++++---------------- src/planwise/model/project.cljc | 1 - 2 files changed, 271 insertions(+), 272 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21571043b..d872a5588 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,25 +7,25 @@ "resolved": "https://registry.npmjs.org/@cljs-oss/module-deps/-/module-deps-1.1.1.tgz", "integrity": "sha1-YmZ/KCFk8/EParnxJLpBb9EkOfo=", "requires": { - "JSONStream": "1.3.2", - "babel-traverse": "6.26.0", - "babylon": "6.18.0", - "browser-resolve": "1.11.2", - "cached-path-relative": "1.0.2", - "concat-stream": "1.5.2", - "defined": "1.0.0", - "detective": "4.7.1", - "duplexer2": "0.1.4", + "JSONStream": "^1.0.3", + "babel-traverse": "^6.23.1", + "babylon": "^6.15.0", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.5.0", + "defined": "^1.0.0", + "detective": "^4.0.0", + "duplexer2": "^0.1.2", "enhanced-resolve": "3.4.1", - "inherits": "2.0.3", + "inherits": "^2.0.1", "konan": "1.1.0", - "parents": "1.0.1", - "readable-stream": "2.3.5", - "resolve": "1.6.0", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.3", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "@material/animation": { @@ -48,10 +48,10 @@ "resolved": "https://registry.npmjs.org/@material/button/-/button-0.32.0.tgz", "integrity": "sha512-3PBA+o8T5lFJbCo2GZD8sm5U4VXiHDN6nHkrKlysuvcbo6QQK1C3ZMP4BIj2nmSpodvNRXOk8opG3feDcubg3g==", "requires": { - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/card": { @@ -59,10 +59,10 @@ "resolved": "https://registry.npmjs.org/@material/card/-/card-0.32.0.tgz", "integrity": "sha512-Y/o8Mekvlt3su0K80gcLpmcdFUa+D57nKDI3nVcM1Xi2r5/ra3qjAmFda5mauxZK/8PzyB/FJzF1fy/RH5s+9g==", "requires": { - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0" + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0" } }, "@material/checkbox": { @@ -70,12 +70,12 @@ "resolved": "https://registry.npmjs.org/@material/checkbox/-/checkbox-0.32.0.tgz", "integrity": "sha512-Rc6sidCCsc+wyktwd6KhNqAt14H6zSEarwLnvqCaYLv/Ml+lqg2SjQ3mg9rRKt1JREaN7G9BGKQKAnB//OMY4g==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/selection-control": "0.32.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/selection-control": "^0.32.0", + "@material/theme": "^0.30.0" } }, "@material/chips": { @@ -83,8 +83,8 @@ "resolved": "https://registry.npmjs.org/@material/chips/-/chips-0.32.0.tgz", "integrity": "sha512-bw4LSzF+Ejyi4Z7iZHZE5J2k437b2iLVM9bGjkXYZ4bkFR+gqjjfB9787FEQGoowHwKOWmuVwYrsO+Vsomf6jg==", "requires": { - "@material/base": "0.29.0", - "@material/ripple": "0.32.0" + "@material/base": "^0.29.0", + "@material/ripple": "^0.32.0" } }, "@material/dialog": { @@ -92,14 +92,14 @@ "resolved": "https://registry.npmjs.org/@material/dialog/-/dialog-0.32.0.tgz", "integrity": "sha512-tmOdwpFAT5aI4nI43ldzgZ5ONPEZzhE8Nf95DnP8najwKni/aY3D61yo3KwrE2Q0fuuXL1e6AEojX83IHEEciw==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.1.1", - "focus-trap": "2.4.3" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.1.1", + "focus-trap": "^2.3.0" }, "dependencies": { "@material/typography": { @@ -114,12 +114,12 @@ "resolved": "https://registry.npmjs.org/@material/drawer/-/drawer-0.30.0.tgz", "integrity": "sha512-NZyp6jVd6cDucBPUl391cTuIkR5Vy5OdrdNQxvH+pTjvb7R2yQJKVv2a7PxuR1uKjGM1vRudFOdXpviwbplr9A==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/elevation": "0.28.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/elevation": "^0.28.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/elevation": { @@ -127,8 +127,8 @@ "resolved": "https://registry.npmjs.org/@material/elevation/-/elevation-0.28.0.tgz", "integrity": "sha512-U2utCuMDDhrJ8Cyisz16GAejN9h9xyS4jvVkt2uIOUyPZRjnaJyoAbpyf0mOzFxIdBuRpNGJYm2PoAwHsSA+xw==", "requires": { - "@material/animation": "0.25.0", - "@material/theme": "0.4.0" + "@material/animation": "^0.25.0", + "@material/theme": "^0.4.0" }, "dependencies": { "@material/theme": { @@ -143,10 +143,10 @@ "resolved": "https://registry.npmjs.org/@material/fab/-/fab-0.32.0.tgz", "integrity": "sha512-VWzka0qpDxDuqPai9alrFUQadpyEwSGuwt+vgqV0gL5vs0VxLlEa1XP8McZSvdCdHGPNEZtohUif2ZaDEiMSzQ==", "requires": { - "@material/animation": "0.25.0", - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/theme": "^0.30.0" } }, "@material/floating-label": { @@ -154,9 +154,9 @@ "resolved": "https://registry.npmjs.org/@material/floating-label/-/floating-label-0.32.0.tgz", "integrity": "sha512-YrcRSK04EnvmVJw2bH0if9zOaag6zUbk41vW2FQZJkkaKd3kQt02d0RqlAJ9qSKciGNb0J0h/EDMcdGpNDAp6Q==", "requires": { - "@material/base": "0.29.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0" + "@material/base": "^0.29.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0" } }, "@material/form-field": { @@ -164,11 +164,11 @@ "resolved": "https://registry.npmjs.org/@material/form-field/-/form-field-0.32.0.tgz", "integrity": "sha512-DrUSzqS73H+ksyI0HM66q7IRVSuIIN5dvapayaCXscoSVq5jU1jObqDNtu7PmBxEqvXj68SHrRWm7M06m06a5w==", "requires": { - "@material/base": "0.29.0", - "@material/rtl": "0.30.0", - "@material/selection-control": "0.32.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/base": "^0.29.0", + "@material/rtl": "^0.30.0", + "@material/selection-control": "^0.32.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/grid-list": { @@ -176,10 +176,10 @@ "resolved": "https://registry.npmjs.org/@material/grid-list/-/grid-list-0.30.0.tgz", "integrity": "sha512-RjL5npvXRWqYE1ro83JjzF2JTimIqVrshCcjSCkiFcDY0AKyEBfihvtHA2JhngLgCgKBBcSHDzNL8sqGMT8AJg==", "requires": { - "@material/base": "0.29.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/base": "^0.29.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/icon-toggle": { @@ -187,10 +187,10 @@ "resolved": "https://registry.npmjs.org/@material/icon-toggle/-/icon-toggle-0.32.0.tgz", "integrity": "sha512-49jrIvP64yVkhVuwek4PmPumMllB3CkqGHgGaSlNJHGdZ3VaSD4DqxnKD0avxhPxEUWg/NXy1dEE+3YFrI/Caw==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/ripple": "0.32.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/ripple": "^0.32.0", + "@material/theme": "^0.30.0" } }, "@material/layout-grid": { @@ -203,9 +203,9 @@ "resolved": "https://registry.npmjs.org/@material/line-ripple/-/line-ripple-0.32.0.tgz", "integrity": "sha512-vd/jlnK/paWZnsr9rvKkeo4qjIDTd59TljSUzqgXN4wiOwiCqXWtNgsy+veKG4fNLVqwad7ECKizUn2iQ/+IMQ==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/theme": "^0.30.0" } }, "@material/linear-progress": { @@ -213,9 +213,9 @@ "resolved": "https://registry.npmjs.org/@material/linear-progress/-/linear-progress-0.30.0.tgz", "integrity": "sha512-xKeC22ni5B2xEoYwY8bBJABS3Xkxa1qjKb+bWu0zf90F7e3bQ0rp2pvzHSp0GGJHTAChu1COMXOyZ1QzaBYtGg==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/theme": "^0.30.0" } }, "@material/list": { @@ -223,10 +223,10 @@ "resolved": "https://registry.npmjs.org/@material/list/-/list-0.32.0.tgz", "integrity": "sha512-03eZsHYRSS7b+fUsx5gBkRhUubfPYYg5Nr7PwLdEPLR5VuQ6RzgcNYcBnLtIa5rdvrd6NugNNSL9c2k27Qjt6g==", "requires": { - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/menu": { @@ -234,11 +234,11 @@ "resolved": "https://registry.npmjs.org/@material/menu/-/menu-0.31.0.tgz", "integrity": "sha512-9318W8Ws1lnJzsXC9+3hVaYJkGxJOXNHR4PaIpvI9T4ZmyRu5+E6Cp0hf42RTQ1bHTDLOSG/tPuKvsN9VW/6hQ==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/elevation": "0.28.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/elevation": "^0.28.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/radio": { @@ -246,11 +246,11 @@ "resolved": "https://registry.npmjs.org/@material/radio/-/radio-0.32.0.tgz", "integrity": "sha512-a+uUiCem0ULjcdH3mwOz/dabLGiiCshqr/Gu5xN1kB6bDLmXybM50DMgw3TowRXyyS4YOX6tm6j+af4dsiNJNQ==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/ripple": "0.32.0", - "@material/selection-control": "0.32.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/ripple": "^0.32.0", + "@material/selection-control": "^0.32.0", + "@material/theme": "^0.30.0" } }, "@material/ripple": { @@ -258,8 +258,8 @@ "resolved": "https://registry.npmjs.org/@material/ripple/-/ripple-0.32.0.tgz", "integrity": "sha512-pfG16d1/46f4QnrUHG66aV22kbY7sh7n2HR/cFALX6D0l0Kae3+xjuUnr1yy32Y1tzLAc84U9jGEzTDykVff9A==", "requires": { - "@material/base": "0.29.0", - "@material/theme": "0.30.0" + "@material/base": "^0.29.0", + "@material/theme": "^0.30.0" } }, "@material/rtl": { @@ -272,14 +272,14 @@ "resolved": "https://registry.npmjs.org/@material/select/-/select-0.32.0.tgz", "integrity": "sha512-KLlP4i1QDzsDJoIW4qA1JB17zSrgHSG2PpxKeqhUjqb9W5Q71LJ6QjhPynFA897sq1Wd9WTSHl41BAu2qUZlFA==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/list": "0.32.0", - "@material/menu": "0.31.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/list": "^0.32.0", + "@material/menu": "^0.31.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/selection-control": { @@ -287,7 +287,7 @@ "resolved": "https://registry.npmjs.org/@material/selection-control/-/selection-control-0.32.0.tgz", "integrity": "sha512-zlq6x5n0pN3eKJQBYkWdh4UQScF7Ui7g7XIeeuKnNFo99oxJoKtuGk3WX5/OBc0wU4qe38rfQW6XGeFG4Adk3Q==", "requires": { - "@material/ripple": "0.32.0" + "@material/ripple": "^0.32.0" } }, "@material/slider": { @@ -295,10 +295,10 @@ "resolved": "https://registry.npmjs.org/@material/slider/-/slider-0.32.0.tgz", "integrity": "sha512-FmV9tjzhj9KfTpxXL2YNgV3STQTWXmROp7SJqrz8v2JpDXiVyI/pq/DhcFLEMvs096cIZWgH+iyZPQGFTPH12A==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0" } }, "@material/snackbar": { @@ -306,11 +306,11 @@ "resolved": "https://registry.npmjs.org/@material/snackbar/-/snackbar-0.30.0.tgz", "integrity": "sha512-zQamWIxco7wZGYHXZ5G6TGTUKeZgS/EZ+YgRhA5hm6ZwfZrQYhn8coWRPOfsgHHlDN511sA8svU41h6HArlSFA==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/switch": { @@ -318,9 +318,9 @@ "resolved": "https://registry.npmjs.org/@material/switch/-/switch-0.32.0.tgz", "integrity": "sha512-nn5HN8AdSb4aSOJEEG9wGvPg+wPhg2rMD3j8WTX1HZ7c0HklgM07SuNKI+Yz5VFgfA28m3qFJAdHIv7OdzSuaQ==", "requires": { - "@material/animation": "0.25.0", - "@material/elevation": "0.28.0", - "@material/theme": "0.30.0" + "@material/animation": "^0.25.0", + "@material/elevation": "^0.28.0", + "@material/theme": "^0.30.0" } }, "@material/tabs": { @@ -328,12 +328,12 @@ "resolved": "https://registry.npmjs.org/@material/tabs/-/tabs-0.32.0.tgz", "integrity": "sha512-RWzxlQoR6MPqxCP2kVNrxg4+D2A5eT7WO0cqkoxsbDz8wAPeNlU/vdr17bnTlhAiiwcDCKulxHRNX7Gztwwg0A==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/textfield": { @@ -341,14 +341,14 @@ "resolved": "https://registry.npmjs.org/@material/textfield/-/textfield-0.32.0.tgz", "integrity": "sha512-5gLDjBE14LqRT3NcToYZu/vVL/FzPY/kPT+oqzyZaRfvx3iyTBXSPsE0LOfGIgPv+Z65Z4g1PoccLWW/cZWHbw==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/floating-label": "0.32.0", - "@material/line-ripple": "0.32.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/floating-label": "^0.32.0", + "@material/line-ripple": "^0.32.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/theme": { @@ -361,12 +361,12 @@ "resolved": "https://registry.npmjs.org/@material/toolbar/-/toolbar-0.32.0.tgz", "integrity": "sha512-eDouRzRFqOpOigm1nOr8QrfEGJW87gdzhqlM8YbrIzUchm3JouAQgV62wvDs+mMpy2jXj1rMBZOTbtff78myqA==", "requires": { - "@material/base": "0.29.0", - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/base": "^0.29.0", + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/top-app-bar": { @@ -374,13 +374,13 @@ "resolved": "https://registry.npmjs.org/@material/top-app-bar/-/top-app-bar-0.32.0.tgz", "integrity": "sha512-zdL70MN10Hd1831o0xdGGAASemY4ht2Wz2juANaK3fCf9uvv2UFouS8eJa4BX16rHenIzwrffuA1EKn96RauaQ==", "requires": { - "@material/animation": "0.25.0", - "@material/base": "0.29.0", - "@material/elevation": "0.28.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/theme": "0.30.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/base": "^0.29.0", + "@material/elevation": "^0.28.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/theme": "^0.30.0", + "@material/typography": "^0.28.0" } }, "@material/typography": { @@ -393,8 +393,8 @@ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, "acorn": { @@ -422,9 +422,9 @@ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" } }, "babel-messages": { @@ -432,7 +432,7 @@ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "requires": { - "babel-runtime": "6.26.0" + "babel-runtime": "^6.22.0" } }, "babel-runtime": { @@ -440,8 +440,8 @@ "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { - "core-js": "2.5.4", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babel-traverse": { @@ -449,15 +449,15 @@ "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", "requires": { - "babel-code-frame": "6.26.0", - "babel-messages": "6.23.0", - "babel-runtime": "6.26.0", - "babel-types": "6.26.0", - "babylon": "6.18.0", - "debug": "2.6.9", - "globals": "9.18.0", - "invariant": "2.2.4", - "lodash": "4.17.11" + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" } }, "babel-types": { @@ -465,10 +465,10 @@ "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", "requires": { - "babel-runtime": "6.26.0", - "esutils": "2.0.2", - "lodash": "4.17.11", - "to-fast-properties": "1.0.3" + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" } }, "babylon": { @@ -501,11 +501,11 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "classnames": { @@ -518,9 +518,9 @@ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", "requires": { - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" }, "dependencies": { "readable-stream": { @@ -528,12 +528,12 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" } } } @@ -553,9 +553,9 @@ "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1" + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" } }, "debug": { @@ -576,8 +576,8 @@ "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", "requires": { - "acorn": "5.5.3", - "defined": "1.0.0" + "acorn": "^5.2.1", + "defined": "^1.0.0" } }, "duplexer2": { @@ -585,7 +585,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "requires": { - "readable-stream": "2.3.5" + "readable-stream": "^2.0.2" } }, "encoding": { @@ -593,7 +593,7 @@ "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "requires": { - "iconv-lite": "0.4.19" + "iconv-lite": "~0.4.13" } }, "enhanced-resolve": { @@ -601,10 +601,10 @@ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", "requires": { - "graceful-fs": "4.1.11", - "memory-fs": "0.4.1", - "object-assign": "4.1.1", - "tapable": "0.2.8" + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "object-assign": "^4.0.1", + "tapable": "^0.2.7" } }, "errno": { @@ -612,7 +612,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "1.0.1" + "prr": "~1.0.1" } }, "escape-string-regexp": { @@ -630,13 +630,13 @@ "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", "requires": { - "core-js": "1.2.7", - "isomorphic-fetch": "2.2.1", - "loose-envify": "1.3.1", - "object-assign": "4.1.1", - "promise": "7.3.1", - "setimmediate": "1.0.5", - "ua-parser-js": "0.7.17" + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.9" }, "dependencies": { "core-js": { @@ -651,7 +651,7 @@ "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-2.4.3.tgz", "integrity": "sha512-sT5Ip9nyAIxWq8Apt1Fdv6yTci5GotaOtO5Ro1/+F3PizttNBcCYz8j/Qze54PPFK73KUbOqh++HUCiyNPqvhA==", "requires": { - "tabbable": "1.1.2" + "tabbable": "^1.0.3" } }, "globals": { @@ -669,7 +669,7 @@ "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "iconv-lite": { @@ -687,7 +687,7 @@ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "requires": { - "loose-envify": "1.3.1" + "loose-envify": "^1.0.0" } }, "is-stream": { @@ -705,8 +705,8 @@ "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "2.0.4" + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" } }, "js-tokens": { @@ -724,8 +724,8 @@ "resolved": "https://registry.npmjs.org/konan/-/konan-1.1.0.tgz", "integrity": "sha1-M3dDxLl7S9Hvi2KiSzFeuLxLIJQ=", "requires": { - "babel-traverse": "6.26.0", - "babylon": "6.18.0" + "babel-traverse": "^6.23.1", + "babylon": "^6.15.0" } }, "lodash": { @@ -738,7 +738,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0" } }, "material-components-web": { @@ -746,40 +746,40 @@ "resolved": "https://registry.npmjs.org/material-components-web/-/material-components-web-0.32.0.tgz", "integrity": "sha512-f2etJyWzZu/5U1qYnybzHXuUhyEAG19a/OFjSLi6rYJtjY1BtPS+Az9IHvnKDB7ahLET00vEtMKZbNsSa8Eksw==", "requires": { - "@material/animation": "0.25.0", - "@material/auto-init": "0.32.0", - "@material/base": "0.29.0", - "@material/button": "0.32.0", - "@material/card": "0.32.0", - "@material/checkbox": "0.32.0", - "@material/chips": "0.32.0", - "@material/dialog": "0.32.0", - "@material/drawer": "0.30.0", - "@material/elevation": "0.28.0", - "@material/fab": "0.32.0", - "@material/floating-label": "0.32.0", - "@material/form-field": "0.32.0", - "@material/grid-list": "0.30.0", - "@material/icon-toggle": "0.32.0", - "@material/layout-grid": "0.24.0", - "@material/line-ripple": "0.32.0", - "@material/linear-progress": "0.30.0", - "@material/list": "0.32.0", - "@material/menu": "0.31.0", - "@material/radio": "0.32.0", - "@material/ripple": "0.32.0", - "@material/rtl": "0.30.0", - "@material/select": "0.32.0", - "@material/selection-control": "0.32.0", - "@material/slider": "0.32.0", - "@material/snackbar": "0.30.0", - "@material/switch": "0.32.0", - "@material/tabs": "0.32.0", - "@material/textfield": "0.32.0", - "@material/theme": "0.30.0", - "@material/toolbar": "0.32.0", - "@material/top-app-bar": "0.32.0", - "@material/typography": "0.28.0" + "@material/animation": "^0.25.0", + "@material/auto-init": "^0.32.0", + "@material/base": "^0.29.0", + "@material/button": "^0.32.0", + "@material/card": "^0.32.0", + "@material/checkbox": "^0.32.0", + "@material/chips": "^0.32.0", + "@material/dialog": "^0.32.0", + "@material/drawer": "^0.30.0", + "@material/elevation": "^0.28.0", + "@material/fab": "^0.32.0", + "@material/floating-label": "^0.32.0", + "@material/form-field": "^0.32.0", + "@material/grid-list": "^0.30.0", + "@material/icon-toggle": "^0.32.0", + "@material/layout-grid": "^0.24.0", + "@material/line-ripple": "^0.32.0", + "@material/linear-progress": "^0.30.0", + "@material/list": "^0.32.0", + "@material/menu": "^0.31.0", + "@material/radio": "^0.32.0", + "@material/ripple": "^0.32.0", + "@material/rtl": "^0.30.0", + "@material/select": "^0.32.0", + "@material/selection-control": "^0.32.0", + "@material/slider": "^0.32.0", + "@material/snackbar": "^0.30.0", + "@material/switch": "^0.32.0", + "@material/tabs": "^0.32.0", + "@material/textfield": "^0.32.0", + "@material/theme": "^0.30.0", + "@material/toolbar": "^0.32.0", + "@material/top-app-bar": "^0.32.0", + "@material/typography": "^0.28.0" } }, "memory-fs": { @@ -787,8 +787,8 @@ "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "requires": { - "errno": "0.1.7", - "readable-stream": "2.3.5" + "errno": "^0.1.3", + "readable-stream": "^2.0.1" } }, "minimist": { @@ -806,8 +806,8 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "requires": { - "encoding": "0.1.12", - "is-stream": "1.1.0" + "encoding": "^0.1.11", + "is-stream": "^1.0.1" } }, "object-assign": { @@ -820,7 +820,7 @@ "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "requires": { - "path-platform": "0.11.15" + "path-platform": "~0.11.15" } }, "path-parse": { @@ -843,7 +843,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "requires": { - "asap": "2.0.6" + "asap": "~2.0.3" } }, "prop-types": { @@ -851,9 +851,9 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1" + "fbjs": "^0.8.16", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" } }, "prr": { @@ -866,10 +866,10 @@ "resolved": "https://registry.npmjs.org/react/-/react-15.5.4.tgz", "integrity": "sha1-+oPrAVBqsjfNwcjDsc6o3gEr8Ec=", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1", - "prop-types": "15.6.1" + "fbjs": "^0.8.9", + "loose-envify": "^1.1.0", + "object-assign": "^4.1.0", + "prop-types": "^15.5.7" } }, "react-dom": { @@ -877,10 +877,10 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.5.4.tgz", "integrity": "sha1-ugwoeG/VLtfk8hNf4CiNRirvk9o=", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1", - "prop-types": "15.5.10" + "fbjs": "^0.8.9", + "loose-envify": "^1.1.0", + "object-assign": "^4.1.0", + "prop-types": "~15.5.7" }, "dependencies": { "prop-types": { @@ -888,8 +888,8 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.10.tgz", "integrity": "sha1-J5ffwxJhguOpXj37suiT3ddFYVQ=", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1" + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1" } } } @@ -907,7 +907,7 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.5.8.tgz", "integrity": "sha1-a3suFBCDvjjIWVqlH8VXdccZk5Q=", "requires": { - "fbjs": "0.8.16" + "fbjs": "^0.8.9" } } } @@ -917,13 +917,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" }, "dependencies": { "process-nextick-args": { @@ -936,7 +936,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "~5.1.0" } } } @@ -951,7 +951,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.6.0.tgz", "integrity": "sha512-mw7JQNu5ExIkcw4LPih0owX/TZXjD/ZUF/ZQ/pDnkw3ZKhDcZZw5klmBlj6gVMwjQ3Pz5Jgu7F3d0jcDVuEWdw==", "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "rmwc": { @@ -959,7 +959,7 @@ "resolved": "https://registry.npmjs.org/rmwc/-/rmwc-1.4.1.tgz", "integrity": "sha512-Y8mZoc5tUgnQm/fTCz0lJIgJq2HzR+yTJxkhq6bunw56bJE1D09MNklfltQit5ss8olb0Dv7xwIARv4C+wGvqw==", "requires": { - "classnames": "2.2.5", + "classnames": "^2.2.5", "material-components-web": "0.32.0" } }, @@ -978,8 +978,8 @@ "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.3.5" + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" } }, "string_decoder": { @@ -992,7 +992,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "subarg": { @@ -1000,7 +1000,7 @@ "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "requires": { - "minimist": "1.2.0" + "minimist": "^1.1.0" } }, "supports-color": { @@ -1028,8 +1028,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.5", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "to-fast-properties": { diff --git a/src/planwise/model/project.cljc b/src/planwise/model/project.cljc index 0790e91f0..edd07a091 100644 --- a/src/planwise/model/project.cljc +++ b/src/planwise/model/project.cljc @@ -46,7 +46,6 @@ ;; Project Starting (s/def ::starting (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) -;; TODO: Use real validations (s/def ::consumers-step (s/keys :req-un [::source-set-id ::consumer-config])) (s/def ::providers-step (s/keys :req-un [::id ::owner-id ::provider-set-id])) (s/def ::coverage-step (s/keys :req-un [::id ::owner-id ::name])) From 27c98bffa1921d5c2de787a9c6cf8d019106ebb9 Mon Sep 17 00:00:00 2001 From: pmallol Date: Wed, 15 May 2019 16:59:14 -0300 Subject: [PATCH 28/38] [WIP] Add a back button in wizard --- resources/sass/site2.scss | 4 ++++ src/planwise/client/projects2/components/settings.cljs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 119b4f811..902fab440 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -548,6 +548,10 @@ form.vertical, .fields-vertical { button { margin-left: 25px; + &:first-child { + float: left; + margin: 0; + } } } diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 44ecadf9f..f9fc80a8d 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -81,6 +81,13 @@ :theme ["text-secondary-on-secondary-light"] :on-click #(reset! state true)} "Delete"]) +(defn- project-back-button + [] + ; TODO - add on-click function and don't show it in first step + [m/Button {:type "button" + :theme ["text-secondary-on-secondary-light"]} + "Back"]) + (defn- tag-chip [props index input read-only] [m/Chip props [m/ChipText input] @@ -271,6 +278,7 @@ [current-project-settings-view {:read-only false :step (:step @page-params)}] [:div {:class-name "project-settings-actions"} + [project-back-button] [project-delete-button delete?] [project-next-step-button @current-project (:step @page-params)]]] [delete-project-dialog {:open? @delete? From d5aa90f620585e6f58e7c3649d9ffdabe89d5b7f Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Wed, 15 May 2019 17:14:27 -0300 Subject: [PATCH 29/38] Fixing idiomatic conventions --- src/planwise/client/components/common2.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/planwise/client/components/common2.cljs b/src/planwise/client/components/common2.cljs index 81592f697..c217988b4 100644 --- a/src/planwise/client/components/common2.cljs +++ b/src/planwise/client/components/common2.cljs @@ -41,12 +41,13 @@ [:div.mdc-text-field.mdc-text-field--upgraded {:class (cond (:read-only props) focus-extra-class @focus (str "mdc-text-field--focused" focus-extra-class))} - (if (not-empty prefix) [:i.prefix prefix]) - (if (not-empty suffix) [:i.suffix suffix]) + (when-not (empty? prefix) [:i.prefix prefix]) + (when-not (not-empty suffix) [:i.suffix suffix]) [:input.mdc-text-field__input (apply dissoc (merge props {:id id :on-focus #(reset! focus true) :on-blur #(reset! focus false) - :placeholder (if @focus nil)}) [:prefix :suffix])] + :placeholder @focus}) + [:prefix :suffix])] [:label.mdc-floating-label {:for id :class (when (or (not (blank? (str (:value props)))) @focus) "mdc-floating-label--float-above")} @@ -63,7 +64,7 @@ (fn [props] (let [component-props (assoc (select-keys props extra-keys) :id id - :type "test" + :type "text" :focus focus) props (apply dissoc props extra-keys)] [mdc-input-field props component-props])))) From 4844dfe5c28d2ecb51d6ddf04c5707d800ab245e Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 16 May 2019 10:59:50 -0300 Subject: [PATCH 30/38] Fixes for inputs in wizard --- src/planwise/client/components/common2.cljs | 3 +-- .../client/projects2/components/settings.cljs | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/planwise/client/components/common2.cljs b/src/planwise/client/components/common2.cljs index c217988b4..a84df7eae 100644 --- a/src/planwise/client/components/common2.cljs +++ b/src/planwise/client/components/common2.cljs @@ -45,8 +45,7 @@ (when-not (not-empty suffix) [:i.suffix suffix]) [:input.mdc-text-field__input (apply dissoc (merge props {:id id :on-focus #(reset! focus true) - :on-blur #(reset! focus false) - :placeholder @focus}) + :on-blur #(reset! focus false)}) [:prefix :suffix])] [:label.mdc-floating-label {:for id :class (when (or (not (blank? (str (:value props)))) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 44ecadf9f..554190b5d 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -72,7 +72,9 @@ :type "button" :unelevated "unelevated" :disabled (if (= step "review") (not (s/valid? :planwise.model.project/starting project)) false) - :on-click (utils/prevent-default #(if (= step "review") (utils/prevent-default (dispatch [:projects2/start-project (:id project)])) (dispatch [:projects2/next-step-project (:id project) step])))} + :on-click (utils/prevent-default #(if (= step "review") + (dispatch [:projects2/start-project (:id project)]) + (dispatch [:projects2/next-step-project (:id project) step])))} "Continue"]) (defn- project-delete-button @@ -147,8 +149,7 @@ (defn- current-project-step-goal [read-only current-project] - (let [current-project (subscribe [:projects2/current-project])]) - [:section {:class-name "project-settings-section"} + [:section.project-settings-section [section-header 1 "Goal"] [current-project-input "Goal" [:name] "text"] [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] @@ -238,13 +239,13 @@ (fn [{:keys [read-only step]}] [m/Grid {:class-name "wizard"} [m/GridCell {:span 12 :class-name "steps"} - (doall - (map-indexed (fn [i iteration-step] - [:a {:key i - :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) "complete")]) - :href (routes/projects2-show-with-step {:id (:id @current-project) :step iteration-step})} - (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") @current-project) [m/Icon "done"] [:i (inc i)]) - [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] + (let [project @current-project] + (map-indexed (fn [i iteration-step] + [:a {:key i + :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") project) "complete")]) + :href (routes/projects2-show-with-step {:id (:id project) :step iteration-step})} + (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") project) [m/Icon "done"] [:i (inc i)]) + [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] [m/GridCell {:span 6} [:form.vertical (case step From a01c747e9d36abe393dc85597adc8c10146ac5a8 Mon Sep 17 00:00:00 2001 From: pmallol Date: Wed, 15 May 2019 21:10:00 -0300 Subject: [PATCH 31/38] Fix style and copy in consumers target setting --- resources/sass/site2.scss | 8 ++++++++ src/planwise/client/projects2/components/settings.cljs | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 902fab440..c366d44d9 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -600,6 +600,14 @@ form.vertical, .fields-vertical { .action-input { max-width: 100px; } +.percentage-input { + div { + margin-right: 0.8rem; + > input { + max-width: 50px; + } + } +} .prefix { color: #999999; diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index f9fc80a8d..5a871535c 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -174,8 +174,9 @@ :disabled? read-only}] [current-project-input "Consumers Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] [m/TextFieldHelperText {:persistent true} (str "How do you refer to the filtered population? (Eg: women)")] - [current-project-input "Target" [:config :demographics :target] "number" "" "%" {:disabled read-only :sub-type :percentage}] - [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) + [:div.percentage-input + [current-project-input "Target" [:config :demographics :target] "number" "" "%" {:disabled read-only :sub-type :percentage}] + [:p (str "of " (or (not-empty (get-in current-project [:config :demographics :unit-name])) "population") " should be considered")]]]) (defn- current-project-step-providers [read-only current-project tags] From 9b52c45fde8ee69ea7f7afc13461d49f8241621e Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 16 May 2019 11:58:51 -0300 Subject: [PATCH 32/38] Refactored steps of wizard into list of maps structure --- .../client/projects2/components/settings.cljs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 554190b5d..0d196b4cb 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -231,7 +231,7 @@ [:div [:p [m/Icon "info"] "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]]) (defn current-project-settings-view - [{:keys [read-only step]}] + [{:keys [read-only step sections]}] (let [current-project (subscribe [:projects2/current-project]) build-actions (subscribe [:projects2/build-actions]) upgrade-actions (subscribe [:projects2/upgrade-actions]) @@ -242,10 +242,10 @@ (let [project @current-project] (map-indexed (fn [i iteration-step] [:a {:key i - :class-name (join " " [(if (= iteration-step step) "active") (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") project) "complete")]) - :href (routes/projects2-show-with-step {:id (:id project) :step iteration-step})} - (if (s/valid? (keyword (str "planwise.model.project-" iteration-step) "validation") project) [m/Icon "done"] [:i (inc i)]) - [:div iteration-step]]) ["goal", "consumers", "providers", "coverage", "actions", "review"]))] + :class-name (join " " [(if (= (:step iteration-step) step) "active") (if (s/valid? (keyword (str "planwise.model.project-" (:step iteration-step)) "validation") project) "complete")]) + :href (routes/projects2-show-with-step {:id (:id project) :step (:step iteration-step)})} + (if (s/valid? (:spec iteration-step) project) [m/Icon "done"] [:i (inc i)]) + [:div (:title iteration-step)]]) sections))] [m/GridCell {:span 6} [:form.vertical (case step @@ -265,11 +265,17 @@ (let [page-params (subscribe [:page-params]) current-project (subscribe [:projects2/current-project]) delete? (r/atom false) - hide-dialog (fn [] (reset! delete? false))] + hide-dialog (fn [] (reset! delete? false)) + sections [{:step "goal" :title "Goal" :spec :planwise.model.project-goal/validation} + {:step "consumers" :title "Consumers" :spec :planwise.model.project-consumers/validation} + {:step "providers" :title "Providers" :spec :planwise.model.project-providers/validation} + {:step "coverage" :title "Coverage" :spec :planwise.model.project-coverage/validation} + {:step "actions" :title "Actions" :spec :planwise.model.project-actions/validation} + {:step "review" :title "Review" :spec :planwise.model.project-review/validation}]] (fn [] [ui/fixed-width (common2/nav-params) [ui/panel {} - [current-project-settings-view {:read-only false :step (:step @page-params)}] + [current-project-settings-view {:read-only false :step (:step @page-params) :sections sections}] [:div {:class-name "project-settings-actions"} [project-delete-button delete?] From b3c9a268030f57b1a64b579a41d9f577d6177506 Mon Sep 17 00:00:00 2001 From: pmallol Date: Thu, 16 May 2019 15:42:40 -0300 Subject: [PATCH 33/38] Refactor project settings with icons --- resources/sass/site2.scss | 11 +++++++++- .../client/projects2/components/settings.cljs | 21 +++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index c366d44d9..713b012ce 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -531,7 +531,7 @@ form.vertical, .fields-vertical { margin: 25px 0 0; } - div > p, button { + button { display: inline-flex; align-items: center; .material-icons { @@ -596,6 +596,15 @@ form.vertical, .fields-vertical { .project-setting { max-width: 554px; } +.project-setting-title { + p { + display: inline-flex; + align-items: flex-start; + .material-icons { + margin-right: 10px; + } + } +} .action-input { max-width: 100px; diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 165544450..583d8c32b 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -125,6 +125,9 @@ [:div {:class-name "step-header"} [:h2 [:span title]]]) +(defn- project-setting-title + [icon title] + [:div.project-setting-title [:p [m/Icon icon] title]]) ;------------------------------------------------------------------------------------------- ; Actions @@ -210,19 +213,19 @@ [:section {:class-name "project-settings-section"} [section-header 5 "Actions"] - [:div [:p [m/Icon "account_balance"] "Available budget"]] + [project-setting-title "account_balance" "Available budget"] [current-project-input "" [:config :actions :budget] "number" "$" "" {:disabled read-only :class "project-setting"}] [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] - [:div [:p [m/Icon "domain"] "Building a new provider..."]] + [project-setting-title "domain" "Building a new provider..."] [listing-actions {:read-only? read-only :action-name :build :list build-actions}] - [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] + [project-setting-title "arrow_upward" "Upgrading a provider so that it can satisfy demand would cost..."] [current-project-input "" [:config :actions :upgrade-budget] "number" "$" "" {:disabled read-only :class "project-setting"}] - [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] + [project-setting-title "add" "Increase the capactiy of a provider by..."] [listing-actions {:read-only? read-only :action-name :upgrade :list upgrade-actions}]]) @@ -232,11 +235,11 @@ [:section {:class "project-settings-section"} [section-header 6 "Review"] [:div {:class "step-info"} "After this step the system will search for different improvements scenarios based on the given parameters. Once started, the process will continue even if you leave the site. From the dashboard you will be able to see the scenarios found so far, pause the search and review the performed work."] - [:div [:p [m/Icon "location_on"] "Kenya health facilities - ResMap 8902"]] - [:div [:p [m/Icon "account_balance"] "K 25,000,000"]] - [:div [:p [m/Icon "people"] "Kenya census 2005"]] - [:div [:p [m/Icon "directions"] "120 min walking distance, 40 min driving"]] - [:div [:p [m/Icon "info"] "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]]) + [project-setting-title "location_on" "Kenya health facilities - ResMap 8902"] + [project-setting-title "account_balance" "K 25,000,000"] + [project-setting-title "people" "Kenya census 2005"] + [project-setting-title "directions" "120 min walking distance, 40 min driving"] + [project-setting-title "info" "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]) (defn current-project-settings-view [{:keys [read-only step sections]}] From 4730ce6a9fbaf490f9f2a6131e122df37bb7d381 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 16 May 2019 15:58:34 -0300 Subject: [PATCH 34/38] Refactored next step and list of steps structure --- .../client/projects2/components/settings.cljs | 23 +++++++++---------- src/planwise/client/projects2/handlers.cljs | 5 ++-- src/planwise/model/project.cljc | 13 +++++++---- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 0d196b4cb..1c707f110 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -67,14 +67,14 @@ (defn- project-next-step-button - [project step] + [project next-step] [m/Button {:id "start-project" :type "button" :unelevated "unelevated" - :disabled (if (= step "review") (not (s/valid? :planwise.model.project/starting project)) false) - :on-click (utils/prevent-default #(if (= step "review") + :disabled (if (nil? next-step) (not (s/valid? :planwise.model.project/starting project)) false) + :on-click (utils/prevent-default #(if (nil? next-step) (dispatch [:projects2/start-project (:id project)]) - (dispatch [:projects2/next-step-project (:id project) step])))} + (dispatch [:projects2/navigate-to-step-project (:id project) next-step])))} "Continue"]) (defn- project-delete-button @@ -254,7 +254,6 @@ "providers" [current-project-step-providers read-only @current-project @tags] "coverage" [current-project-step-coverage read-only @current-project] "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] - "review" [current-project-step-review read-only @current-project] (dispatch [:projects2/infer-step @current-project]))]] [m/GridCell {:span 6} @@ -266,12 +265,12 @@ current-project (subscribe [:projects2/current-project]) delete? (r/atom false) hide-dialog (fn [] (reset! delete? false)) - sections [{:step "goal" :title "Goal" :spec :planwise.model.project-goal/validation} - {:step "consumers" :title "Consumers" :spec :planwise.model.project-consumers/validation} - {:step "providers" :title "Providers" :spec :planwise.model.project-providers/validation} - {:step "coverage" :title "Coverage" :spec :planwise.model.project-coverage/validation} - {:step "actions" :title "Actions" :spec :planwise.model.project-actions/validation} - {:step "review" :title "Review" :spec :planwise.model.project-review/validation}]] + sections [{:step "goal" :title "Goal" :spec :planwise.model.project/goal-step :next-step "consumers"} + {:step "consumers" :title "Consumers" :spec :planwise.model.project/consumers-step :next-step "providers"} + {:step "providers" :title "Providers" :spec :planwise.model.project/providers-step :next-step "coverage"} + {:step "coverage" :title "Coverage" :spec :planwise.model.project/coverage-step :next-step "actions"} + {:step "actions" :title "Actions" :spec :planwise.model.project/actions-step :next-step "review"} + {:step "review" :title "Review" :spec :planwise.model.project/review-step :next-step nil}]] (fn [] [ui/fixed-width (common2/nav-params) [ui/panel {} @@ -279,7 +278,7 @@ [:div {:class-name "project-settings-actions"} [project-delete-button delete?] - [project-next-step-button @current-project (:step @page-params)]]] + [project-next-step-button @current-project (:next-step (first (filter #(= (:step %) (:step @page-params)) sections)))]]] [delete-project-dialog {:open? @delete? :cancel-fn hide-dialog :delete-fn #(dispatch [:projects2/delete-project (:id @current-project)])}]]))) diff --git a/src/planwise/client/projects2/handlers.cljs b/src/planwise/client/projects2/handlers.cljs index de88f6f58..5de2de992 100644 --- a/src/planwise/client/projects2/handlers.cljs +++ b/src/planwise/client/projects2/handlers.cljs @@ -49,11 +49,10 @@ {:navigate (routes/projects2-show-with-step {:id (:id project) :step selected-step})}))) (rf/reg-event-fx - :projects2/next-step-project + :projects2/navigate-to-step-project in-projects2 (fn [{:keys [db]} [_ project-id step]] - (let [steps ["goal", "consumers", "providers", "coverage", "actions", "review"]] - {:navigate (routes/projects2-show-with-step {:id project-id :step (steps (inc (.indexOf steps step)))})}))) + {:navigate (routes/projects2-show-with-step {:id project-id :step step})})) ;;------------------------------------------------------------------------------ diff --git a/src/planwise/model/project.cljc b/src/planwise/model/project.cljc index edd07a091..8a1cd5e9b 100644 --- a/src/planwise/model/project.cljc +++ b/src/planwise/model/project.cljc @@ -42,12 +42,17 @@ ;; Config (s/def ::config (s/keys :req-un [::demographics ::actions ::coverage ::providers])) +(s/def :planwise.model.project-consumers/config (s/keys :req-un [:planwise.model.project/demographics])) +(s/def :planwise.model.project-providers/config (s/keys :req-un [:planwise.model.project/providers])) +(s/def :planwise.model.project-coverage/config (s/keys :req-un [:planwise.model.project/coverage])) +(s/def :planwise.model.project-actions/config (s/keys :req-un [:planwise.model.project/actions])) ;; Project Starting (s/def ::starting (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) -(s/def ::consumers-step (s/keys :req-un [::source-set-id ::consumer-config])) -(s/def ::providers-step (s/keys :req-un [::id ::owner-id ::provider-set-id])) -(s/def ::coverage-step (s/keys :req-un [::id ::owner-id ::name])) -(s/def ::actions-step (s/keys :req-un [::id ::owner-id ::actions])) +(s/def ::goal-step (s/keys :req-un [:planwise.model.project/name :planwise.model.project/region-id])) +(s/def ::consumers-step (s/keys :req-un [:planwise.model.project/source-set-id :planwise.model.project-consumers/config])) +(s/def ::providers-step (s/keys :req-un [::provider-set-id :planwise.model.project-providers/config])) +(s/def ::coverage-step (s/keys :req-un [:planwise.model.project-coverage/config])) +(s/def ::actions-step (s/keys :req-un [:planwise.model.project-actions/config])) (s/def ::review-step (s/keys :req-un [::id ::owner-id ::name ::config ::provider-set-id ::source-set-id ::region-id])) From cd2122746526944235a779824d727b96f2948cd1 Mon Sep 17 00:00:00 2001 From: pmallol Date: Thu, 16 May 2019 16:00:21 -0300 Subject: [PATCH 35/38] Add step's information copy --- resources/sass/site2.scss | 2 +- src/planwise/client/projects2/components/settings.cljs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 713b012ce..43828f9b3 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -517,7 +517,7 @@ form.vertical, .fields-vertical { } } .step-info { - line-height: 24px; + line-height: 1.9rem; margin: 1.2rem 0 3rem; } diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 583d8c32b..b226b6392 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -202,6 +202,7 @@ [:section {:class-name "project-settings-section"} [section-header 4 "Coverage"] + [:div {:class "step-info"} "These values will be used to estimate the geographic coverage that your current sites are providing. That in turn will allow Planwise to calculate areas out of reach."] [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm current-project) :value (get-in current-project [:config :coverage :filter-options]) :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) @@ -213,6 +214,7 @@ [:section {:class-name "project-settings-section"} [section-header 5 "Actions"] + [:div {:class "step-info"} "Potential actions to increase access to services. Planwise will use these to explore and recommend the best alternatives."] [project-setting-title "account_balance" "Available budget"] [current-project-input "" [:config :actions :budget] "number" "$" "" {:disabled read-only :class "project-setting"}] [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] From 30241adbc529de1287ad8c225a2fc4b9163f1a3d Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Thu, 16 May 2019 17:44:02 -0300 Subject: [PATCH 36/38] Included component into structure of steps --- .../client/projects2/components/settings.cljs | 183 +++++++++--------- 1 file changed, 94 insertions(+), 89 deletions(-) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 1c707f110..127566dfd 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -148,87 +148,94 @@ ;------------------------------------------------------------------------------------------- (defn- current-project-step-goal - [read-only current-project] - [:section.project-settings-section - [section-header 1 "Goal"] - [current-project-input "Goal" [:name] "text"] - [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] + [read-only] + (let [current-project (subscribe [:projects2/current-project])] + [:section.project-settings-section + [section-header 1 "Goal"] + [current-project-input "Goal" [:name] "text"] + [m/TextFieldHelperText {:persistent true} "Enter the goal for this project"] - [regions-dropdown-component {:label "Region" - :on-change #(dispatch [:projects2/save-key :region-id %]) - :model (:region-id current-project) - :disabled? read-only}]]) + [regions-dropdown-component {:label "Region" + :on-change #(dispatch [:projects2/save-key :region-id %]) + :model (:region-id @current-project) + :disabled? read-only}]])) (defn- current-project-step-consumers - [read-only current-project] - [:section {:class-name "project-settings-section"} - [section-header 2 "Consumers"] - [sources-dropdown-component {:label "Consumer Dataset" - :value (:source-set-id current-project) - :on-change #(dispatch [:projects2/save-key :source-set-id %]) - :disabled? read-only}] - [current-project-input "Consumers Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] - [m/TextFieldHelperText {:persistent true} (str "How do you refer to the filtered population? (Eg: women)")] - [current-project-input "Target" [:config :demographics :target] "number" "" "%" {:disabled read-only :sub-type :percentage}] - [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in current-project [:config :demographics :unit-name]))]]) + [read-only] + (let [current-project (subscribe [:projects2/current-project])] + [:section {:class-name "project-settings-section"} + [section-header 2 "Consumers"] + [sources-dropdown-component {:label "Consumer Dataset" + :value (:source-set-id @current-project) + :on-change #(dispatch [:projects2/save-key :source-set-id %]) + :disabled? read-only}] + [current-project-input "Consumers Unit" [:config :demographics :unit-name] "text" {:disabled read-only}] + [m/TextFieldHelperText {:persistent true} (str "How do you refer to the filtered population? (Eg: women)")] + [current-project-input "Target" [:config :demographics :target] "number" "" "%" {:disabled read-only :sub-type :percentage}] + [m/TextFieldHelperText {:persistent true} (str "Percentage of population that should be considered " (get-in @current-project [:config :demographics :unit-name]))]])) (defn- current-project-step-providers - [read-only current-project tags] - [:section {:class-name "project-settings-section"} - [section-header 3 "Providers"] - [providers-set-dropdown-component {:label "Provider Dataset" - :value (:provider-set-id current-project) - :on-change #(dispatch [:projects2/save-key :provider-set-id %]) - :disabled? read-only}] + [read-only] + (let [current-project (subscribe [:projects2/current-project]) + tags (subscribe [:projects2/tags])] + [:section {:class-name "project-settings-section"} + [section-header 3 "Providers"] + [providers-set-dropdown-component {:label "Provider Dataset" + :value (:provider-set-id @current-project) + :on-change #(dispatch [:projects2/save-key :provider-set-id %]) + :disabled? read-only}] - [current-project-input "Capacity Workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] - [m/TextFieldHelperText {:persistent true} (str "How many " (or (not-empty (get-in current-project [:config :demographics :unit-name])) "consumers") " can each provider handle?")] - (when-not read-only [tag-input]) - [:label "Tags: " [tag-set tags read-only]] - [count-providers tags current-project]]) + [current-project-input "Capacity Workload" [:config :providers :capacity] "number" {:disabled read-only :sub-type :float}] + [m/TextFieldHelperText {:persistent true} (str "How many " (or (not-empty (get-in @current-project [:config :demographics :unit-name])) "consumers") " can each provider handle?")] + (when-not read-only [tag-input]) + [:label "Tags: " [tag-set @tags read-only]] + [count-providers @tags @current-project]])) (defn- current-project-step-coverage - [read-only current-project] - - [:section {:class-name "project-settings-section"} - [section-header 4 "Coverage"] - [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm current-project) - :value (get-in current-project [:config :coverage :filter-options]) - :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) - :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] - :disabled? read-only}]]) + [read-only] + (let [current-project (subscribe [:projects2/current-project])] + [:section {:class-name "project-settings-section"} + [section-header 4 "Coverage"] + [coverage-algorithm-filter-options {:coverage-algorithm (:coverage-algorithm @current-project) + :value (get-in @current-project [:config :coverage :filter-options]) + :on-change #(dispatch [:projects2/save-key [:config :coverage :filter-options] %]) + :empty [:div {:class-name " no-provider-set-selected"} "First choose provider-set."] + :disabled? read-only}]])) (defn- current-project-step-actions - [read-only current-project build-actions upgrade-actions] - - [:section {:class-name "project-settings-section"} - [section-header 5 "Actions"] - [:div [:p [m/Icon "account_balance"] "Available budget"]] - [current-project-input "" [:config :actions :budget] "number" "$" "" {:disabled read-only :class "project-setting"}] - [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] + [read-only build-actions upgrade-actions] + (let [current-project (subscribe [:projects2/current-project]) + build-actions (subscribe [:projects2/build-actions]) + upgrade-actions (subscribe [:projects2/upgrade-actions])] + [:section {:class-name "project-settings-section"} + [section-header 5 "Actions"] + [:div [:p [m/Icon "account_balance"] "Available budget"]] + [current-project-input "" [:config :actions :budget] "number" "$" "" {:disabled read-only :class "project-setting"}] + [m/TextFieldHelperText {:persistent true} "Planwise will keep explored scenarios below this maximum budget"] - [:div [:p [m/Icon "domain"] "Building a new provider..."]] - [listing-actions {:read-only? read-only - :action-name :build - :list build-actions}] + [:div [:p [m/Icon "domain"] "Building a new provider..."]] + [listing-actions {:read-only? read-only + :action-name :build + :list @build-actions}] - [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] - [current-project-input "" [:config :actions :upgrade-budget] "number" "$" "" {:disabled read-only :class "project-setting"}] + [:div [:p [m/Icon "arrow_upward"] "Upgrading a provider so that it can satisfy demand would cost..."]] + [current-project-input "" [:config :actions :upgrade-budget] "number" "$" "" {:disabled read-only :class "project-setting"}] - [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] - [listing-actions {:read-only? read-only - :action-name :upgrade - :list upgrade-actions}]]) + [:div [:p [m/Icon "add"] "Increase the capactiy of a provider by..."]] + [listing-actions {:read-only? read-only + :action-name :upgrade + :list @upgrade-actions}]])) (defn- current-project-step-review - [read-only current-project] - [:section {:class "project-settings-section"} - [section-header 6 "Review"] - [:div {:class "step-info"} "After this step the system will search for different improvements scenarios based on the given parameters. Once started, the process will continue even if you leave the site. From the dashboard you will be able to see the scenarios found so far, pause the search and review the performed work."] - [:div [:p [m/Icon "location_on"] "Kenya health facilities - ResMap 8902"]] - [:div [:p [m/Icon "account_balance"] "K 25,000,000"]] - [:div [:p [m/Icon "people"] "Kenya census 2005"]] - [:div [:p [m/Icon "directions"] "120 min walking distance, 40 min driving"]] - [:div [:p [m/Icon "info"] "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]]) + [read-only] + (let [current-project (subscribe [:projects2/current-project])] + [:section {:class "project-settings-section"} + [section-header 6 "Review"] + [:div {:class "step-info"} "After this step the system will search for different improvements scenarios based on the given parameters. Once started, the process will continue even if you leave the site. From the dashboard you will be able to see the scenarios found so far, pause the search and review the performed work."] + [:div [:p [m/Icon "location_on"] "Kenya health facilities - ResMap 8902"]] + [:div [:p [m/Icon "account_balance"] "K 25,000,000"]] + [:div [:p [m/Icon "people"] "Kenya census 2005"]] + [:div [:p [m/Icon "directions"] "120 min walking distance, 40 min driving"]] + [:div [:p [m/Icon "info"] "A hospital with a capacity of 100 beds will provide service for 1000 pregnancies per year"]]])) (defn current-project-settings-view [{:keys [read-only step sections]}] @@ -236,28 +243,26 @@ build-actions (subscribe [:projects2/build-actions]) upgrade-actions (subscribe [:projects2/upgrade-actions]) tags (subscribe [:projects2/tags])] + (fn [{:keys [read-only step]}] - [m/Grid {:class-name "wizard"} - [m/GridCell {:span 12 :class-name "steps"} - (let [project @current-project] + (let [project @current-project + step-data (first (filter #(= (:step %) step) sections))] + + [m/Grid {:class-name "wizard"} + [m/GridCell {:span 12 :class-name "steps"} (map-indexed (fn [i iteration-step] [:a {:key i :class-name (join " " [(if (= (:step iteration-step) step) "active") (if (s/valid? (keyword (str "planwise.model.project-" (:step iteration-step)) "validation") project) "complete")]) :href (routes/projects2-show-with-step {:id (:id project) :step (:step iteration-step)})} (if (s/valid? (:spec iteration-step) project) [m/Icon "done"] [:i (inc i)]) - [:div (:title iteration-step)]]) sections))] - [m/GridCell {:span 6} - [:form.vertical - (case step - "goal" [current-project-step-goal read-only @current-project] - "consumers" [current-project-step-consumers read-only @current-project] - "providers" [current-project-step-providers read-only @current-project @tags] - "coverage" [current-project-step-coverage read-only @current-project] - "actions" [current-project-step-actions read-only @current-project @build-actions @upgrade-actions] - "review" [current-project-step-review read-only @current-project] - (dispatch [:projects2/infer-step @current-project]))]] - [m/GridCell {:span 6} - [:div.map]]]))) + [:div (:title iteration-step)]]) sections)] + [m/GridCell {:span 6} + [:form.vertical + (if (nil? step-data) + (dispatch [:projects2/infer-step @current-project]) + ((:component step-data) read-only))]] + [m/GridCell {:span 6} + [:div.map]]])))) (defn edit-current-project [] @@ -265,12 +270,12 @@ current-project (subscribe [:projects2/current-project]) delete? (r/atom false) hide-dialog (fn [] (reset! delete? false)) - sections [{:step "goal" :title "Goal" :spec :planwise.model.project/goal-step :next-step "consumers"} - {:step "consumers" :title "Consumers" :spec :planwise.model.project/consumers-step :next-step "providers"} - {:step "providers" :title "Providers" :spec :planwise.model.project/providers-step :next-step "coverage"} - {:step "coverage" :title "Coverage" :spec :planwise.model.project/coverage-step :next-step "actions"} - {:step "actions" :title "Actions" :spec :planwise.model.project/actions-step :next-step "review"} - {:step "review" :title "Review" :spec :planwise.model.project/review-step :next-step nil}]] + sections [{:step "goal" :title "Goal" :component current-project-step-goal :spec :planwise.model.project/goal-step :next-step "consumers"} + {:step "consumers" :title "Consumers" :component current-project-step-consumers :spec :planwise.model.project/consumers-step :next-step "providers"} + {:step "providers" :title "Providers" :component current-project-step-providers :spec :planwise.model.project/providers-step :next-step "coverage"} + {:step "coverage" :title "Coverage" :component current-project-step-coverage :spec :planwise.model.project/coverage-step :next-step "actions"} + {:step "actions" :title "Actions" :component current-project-step-actions :spec :planwise.model.project/actions-step :next-step "review"} + {:step "review" :title "Review" :component current-project-step-review :spec :planwise.model.project/review-step :next-step nil}]] (fn [] [ui/fixed-width (common2/nav-params) [ui/panel {} From 96aa37bc99ab4fb00aab33c1edd6f7a117034d18 Mon Sep 17 00:00:00 2001 From: pmallol Date: Fri, 17 May 2019 10:31:03 -0300 Subject: [PATCH 37/38] Apply minor fix in percentage input --- resources/sass/site2.scss | 2 ++ src/planwise/client/components/common2.cljs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/sass/site2.scss b/resources/sass/site2.scss index 43828f9b3..2e3d80a24 100644 --- a/resources/sass/site2.scss +++ b/resources/sass/site2.scss @@ -610,6 +610,8 @@ form.vertical, .fields-vertical { max-width: 100px; } .percentage-input { + display: inline-flex; + align-items: end; div { margin-right: 0.8rem; > input { diff --git a/src/planwise/client/components/common2.cljs b/src/planwise/client/components/common2.cljs index a84df7eae..64b5a1194 100644 --- a/src/planwise/client/components/common2.cljs +++ b/src/planwise/client/components/common2.cljs @@ -42,7 +42,7 @@ (:read-only props) focus-extra-class @focus (str "mdc-text-field--focused" focus-extra-class))} (when-not (empty? prefix) [:i.prefix prefix]) - (when-not (not-empty suffix) [:i.suffix suffix]) + (when-not (empty? suffix) [:i.suffix suffix]) [:input.mdc-text-field__input (apply dissoc (merge props {:id id :on-focus #(reset! focus true) :on-blur #(reset! focus false)}) From bc5b7644ab3a6a0b177562dc860001f67e36cb95 Mon Sep 17 00:00:00 2001 From: hdf1986 Date: Mon, 20 May 2019 10:42:54 -0300 Subject: [PATCH 38/38] Added todo comment --- src/planwise/client/projects2/components/settings.cljs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/planwise/client/projects2/components/settings.cljs b/src/planwise/client/projects2/components/settings.cljs index 127566dfd..fa42ac4ef 100644 --- a/src/planwise/client/projects2/components/settings.cljs +++ b/src/planwise/client/projects2/components/settings.cljs @@ -37,6 +37,7 @@ attrs)] (into [filter-select/single-dropdown] (mapcat identity props)))) +;; TODO: Refactor this fn to require flat map instead of this large amount of params (defn- current-project-input ([label path type] (current-project-input label path type "" "" {:disabled false}))