Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit e4de568

Browse files
authored
feat(headerbar): add header bar from ui-core
After much ado this PR migrates the header bar previously found in dhis2/ui-core to its new home in ui-widgets, kicking off the 1.0.0 version of this helper library. This header bar is implemented with the https://github.com/dhis2/app-runtime library, so it uses a DataProvider pattern and Hooks, so React 16.8.x is required.
1 parent efd8442 commit e4de568

31 files changed

Lines changed: 2956 additions & 1435 deletions

.size-limit.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: node_js
2+
node_js:
3+
- lts/*
4+
script:
5+
- yarn build
6+
deploy:
7+
- provider: script
8+
skip_cleanup: true
9+
script:
10+
- npx --package @dhis2/deploy-build deploy-build
11+
on:
12+
tags: false
13+
branch: master
14+
- provider: script
15+
skip_cleanup: true
16+
script:
17+
- npx @dhis2/cli-utils release --publish npm
18+
on:
19+
tags: false
20+
branch: master
21+
env:
22+
global:
23+
- GIT_AUTHOR_NAME=@dhis2-bot
24+
- GIT_AUTHOR_EMAIL=ci@dhis2.org
25+
- GIT_COMMITTER_NAME=@dhis2-bot
26+
- GIT_COMMITTER_EMAIL=ci@dhis2.org
27+
- secure: nQEIpuM3L/21Y7XL5tvegBSYp9tM7us0E6jEz3DG7Ejpk0scv0sTENwyEduw8rLK782px6wNpmkLTXcsG7JdhhrctdEzKRYaeaAGVt2gFfPqJjnc0mam3lmEyuIon/dAv+NxTaH8AK8s0BNNT5wiOAKcRgyYcTey7ejQMze+PzgflUlIXsIYqSvGwjqx6L5S9M6yBUTdH4sbOlflzhsfJLRuu2dGxiELYVjvjJvIO0pblltPxtcslf5ByGU0eXn3NZrrpBaH4YRC5+IKbMmvHuozjjkVpz+9bFR1kuO2G6iP7FZH6vIwbn6zdvyg83My1dy2vZEaCs2mrl0q2y1kiNtOA9lCkBnckkaHijxBK+dclRGnl3OqmcHN2/wvqpLn98N5UK5pZPcDqqmvMw2sdRw70qqzNg8D4KB+Et0ZmJz5CUOHiwt9/KlcxxN5VrL8XLmtGgtPtDXnE8pDJUFbBz7iRU7/0JXFYfaxS/+ehzPxxQJ/9mgKSdbmbMdgK/DDGyvSPCjgQ+13Ime0EUjp5qclsTmPoNP5WeF5Y3QxEKwKxk/NDFPfGMv84HDYSRj2z3ir39REWsUT0LukA1FjGgepaoUKbMw+XLzV9OY0eGrudYqc3mXXQbSg2eoOsT0e/s8Z1/ajZEbBuZRQ4KrtvAWH2k3Jd8FveYQTmPam7v8=
28+
- secure: EqFH8ZKZ//Xv/03FMXuJuHFWBVIcX4CPFEvtO0Q5kUvJCvvnISWSh8Z3WTP2UtpEwi8/LQvNSNPGxIFOfgDWoV39R91QNT06amelo4tsA3KerKYy2qNSwD9J7DFl7Uncesz9goUO0lKqigVMGti/feGHw9ah12VOaiDoH+r3M37PIgf8MDjBEwjpgmgaxci+RnYiQrHcZu5wg1KoTeZO6FaqxwfBZ2fonYsJ2kssT4gYmDU6ZfR5rPtPFU7y+oQ7/9dd4vvJdBHxqv7y8wdOnMN5s1zb7eaNBw3RfIZCcbH+MLRHCHw6bzsM8sajO2UcQR2vbyWUQwGqgV4clsXIpENlb3cSs1+QdHUA4EYLs1qqtumg+c9PoX9TjFENZyt8oK2tUK72ivkzQCph4xEWQseWmFDp6j6+tHeQAsHZZm6LNGKahTn/UjYDuWuP11pFEhiKVyYKYcMg4p2DPeRig3Vb7Z+l3GbV6TUzClr3evHaJpxo91KcPCB50W39m9DLFGulYkyovd+nTzr42/gGUvl+hiHa/4BBXfsa2EH7WiALG6b8khXyDufVjqTGrw+ieM/77uKoIK7zx1TKxwZXcJmzPZrZ+j1Bjk3sCmTChkjAXEOcT55mmuEZtriRtfk00Rd6IWDAGHUWaXBxvE1VzhzTwBkNLb6Z+YgWqDSrLLs=

babel.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = function(api) {
1818

1919
return {
2020
presets: defaultPresets.concat('@babel/preset-react'),
21-
plugins: ['styled-jsx/babel'],
21+
plugins: [
22+
'@babel/plugin-proposal-class-properties',
23+
'styled-jsx/babel',
24+
],
2225
}
2326
}

i18n/en.pot

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: i18next-conv\n"
4+
"MIME-Version: 1.0\n"
5+
"Content-Type: text/plain; charset=utf-8\n"
6+
"Content-Transfer-Encoding: 8bit\n"
7+
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
8+
"POT-Creation-Date: 2019-05-06T10:04:38.118Z\n"
9+
"PO-Revision-Date: 2019-05-06T10:04:38.118Z\n"
10+
11+
msgid "Search apps"
12+
msgstr ""
13+
14+
msgid "Edit profile"
15+
msgstr ""
16+
17+
msgid "Settings"
18+
msgstr ""
19+
20+
msgid "Account"
21+
msgstr ""
22+
23+
msgid "Help"
24+
msgstr ""
25+
26+
msgid "About DHIS2"
27+
msgstr ""
28+
29+
msgid "Logout"
30+
msgstr ""

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build]
2-
command = "yarn install --frozen-lockfile && yarn build && cd docs && yarn install --frozen-lockfile && yarn build"
3-
publish = "docs/build"
2+
command = "yarn install --frozen-lockfile && yarn build"
3+
publish = "./build/docs/"

package.json

Lines changed: 72 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,74 @@
11
{
2-
"name": "@dhis2/ui-widgets",
3-
"version": "0.1.0",
4-
"main": "./build/cjs/index.js",
5-
"module": "./build/es/index.js",
6-
"sideEffects": false,
7-
"repository": "git@github.com:dhis2/ui-widgets.git",
8-
"author": "Edoardo Sabadelli <edoardo@dhis2.org>",
9-
"license": "BSD-3-Clause",
10-
"private": false,
11-
"publishConfig": {
12-
"access": "public"
13-
},
14-
"scripts": {
15-
"prebuild": "rm -rf ./build/*",
16-
"build:commonjs": "BABEL_ENV=commonjs babel src --out-dir ./build/cjs --copy-files --verbose",
17-
"build:modules": "BABEL_ENV=modules babel src --out-dir ./build/es --copy-files --verbose",
18-
"build:docs": "cd ./docs && yarn install && CI=false yarn build && cd .. && cp -r ./docs/build ./build/docs",
19-
"build": "yarn build:commonjs && yarn build:modules",
20-
"postbuild": "yarn build-storybook && size-limit",
21-
"build-storybook": "build-storybook -c .storybook -o ./build/docs",
22-
"start-storybook": "start-storybook --port 5000",
23-
"start": "yarn start-storybook"
24-
},
25-
"husky": {
26-
"hooks": {
27-
"commit-msg": "d2-style commit check",
28-
"pre-commit": "d2-style js apply"
29-
}
30-
},
31-
"devDependencies": {
32-
"@babel/cli": "^7.0.0",
33-
"@babel/core": "^7.0.0",
34-
"@babel/preset-env": "^7.1.6",
35-
"@babel/preset-react": "^7.0.0",
36-
"@dhis2/cli-style": "^2.2.1",
37-
"@dhis2/packages": "^1.3.0",
38-
"@storybook/addon-notes": "^5.0.3",
39-
"@storybook/react": "^5.0.3",
40-
"babel-loader": "^8.0.5",
41-
"conventional-changelog-cli": "^2.0.5",
42-
"fs-extra": "^7.0.0",
43-
"husky": "^1.0.1",
44-
"react-dev-utils": "^8.0.0",
45-
"size-limit": "^0.21.1",
46-
"storybook-addon-jsx": "^7.0.0",
47-
"typeface-roboto": "^0.0.54"
48-
},
49-
"peerDependencies": {
50-
"prop-types": "^15",
51-
"react": "^16.3",
52-
"react-dom": "^16.3"
53-
},
54-
"dependencies": {
55-
"classnames": "^2.2.6",
56-
"styled-jsx": "^3.2.1"
57-
},
58-
"files": [
59-
"./build"
60-
]
2+
"name": "@dhis2/ui-widgets",
3+
"version": "0.1.0",
4+
"main": "./build/cjs/index.js",
5+
"module": "./build/es/index.js",
6+
"sideEffects": false,
7+
"repository": "git@github.com:dhis2/ui-widgets.git",
8+
"author": "Edoardo Sabadelli <edoardo@dhis2.org>",
9+
"contributors": [
10+
"Viktor Varland <viktor@dhis2.org>"
11+
],
12+
"license": "BSD-3-Clause",
13+
"private": false,
14+
"publishConfig": {
15+
"access": "public"
16+
},
17+
"scripts": {
18+
"extract-pot": "d2-i18n-extract -p src/ -o i18n/",
19+
"generate-locale": "d2-i18n-generate -n 'ui-widgets' -p ./i18n/ -o ./src/locales/",
20+
"localize": "yarn extract-pot && yarn generate-locale",
21+
"prebuild": "rm -rf ./build/* && yarn localize",
22+
"build:commonjs": "BABEL_ENV=commonjs babel src --out-dir ./build/cjs --copy-files --verbose",
23+
"build:modules": "BABEL_ENV=modules babel src --out-dir ./build/es --copy-files --verbose",
24+
"build": "NODE_ENV=production yarn build:commonjs && yarn build:modules",
25+
"postbuild": "yarn build-storybook",
26+
"build-storybook": "build-storybook -c .storybook -o ./build/docs",
27+
"start-storybook": "start-storybook --port 5000",
28+
"prestart": "yarn localize",
29+
"start": "yarn start-storybook"
30+
},
31+
"husky": {
32+
"hooks": {
33+
"commit-msg": "d2-style commit check",
34+
"pre-commit": "d2-style js apply"
35+
}
36+
},
37+
"devDependencies": {
38+
"@babel/cli": "^7.0.0",
39+
"@babel/core": "^7.0.0",
40+
"@babel/plugin-proposal-class-properties": "^7.4.0",
41+
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
42+
"@babel/plugin-transform-react-constant-elements": "^7.2.0",
43+
"@babel/preset-env": "^7.1.6",
44+
"@babel/preset-react": "^7.0.0",
45+
"@dhis2/app-runtime": "1.1.0",
46+
"@dhis2/cli-style": "3.1.1",
47+
"@dhis2/d2-i18n-extract": "1.0.7",
48+
"@dhis2/d2-i18n-generate": "1.1.1",
49+
"@storybook/addon-notes": "5.0.11",
50+
"@storybook/react": "5.0.11",
51+
"babel-loader": "^8.0.5",
52+
"conventional-changelog-cli": "^2.0.5",
53+
"fs-extra": "^7.0.0",
54+
"husky": "^1.0.1",
55+
"react-dev-utils": "^8.0.0",
56+
"storybook-addon-jsx": "^7.0.0",
57+
"typeface-roboto": "^0.0.54"
58+
},
59+
"peerDependencies": {
60+
"@dhis2/app-runtime": "1.1.0",
61+
"prop-types": "^15",
62+
"react": "^16.8",
63+
"react-dom": "^16.8"
64+
},
65+
"dependencies": {
66+
"@dhis2/d2-i18n": "1.0.4",
67+
"@dhis2/ui-core": "2.0.2",
68+
"classnames": "^2.2.6",
69+
"styled-jsx": "^3.2.1"
70+
},
71+
"files": [
72+
"./build"
73+
]
6174
}

0 commit comments

Comments
 (0)