Skip to content

Commit

Permalink
Merge branch 'master' into beta-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Jun 21, 2022
2 parents 41d46cc + acb5e12 commit 3b8e0ef
Show file tree
Hide file tree
Showing 69 changed files with 1,273 additions and 778 deletions.
4 changes: 0 additions & 4 deletions .github/semantic.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/dhis2-verify-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'dhis2: verify (commits)'

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

jobs:
lint-pr-title:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: JulienKode/[email protected]
with:
configuration-path: ${{ steps.commitlint.outputs.config_path }}

lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
- id: commitlint
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
- uses: wagoid/commitlint-github-action@v4
with:
configFile: ${{ steps.commitlint.outputs.config_path }}
24 changes: 22 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
## [8.3.3-beta.1](https://github.com/dhis2/app-platform/compare/v8.3.2...v8.3.3-beta.1) (2022-01-13)
## [9.0.1](https://github.com/dhis2/app-platform/compare/v9.0.0...v9.0.1) (2022-06-08)


### Bug Fixes

* remove lint step from publish step requirements ([#695](https://github.com/dhis2/app-platform/issues/695)) ([a04f8f7](https://github.com/dhis2/app-platform/commit/a04f8f715023fdcb568990fe478f19fb11e54fde))
* **proxy:** ignore nulls in transformJsonResponse ([#719](https://github.com/dhis2/app-platform/issues/719)) ([b72dd79](https://github.com/dhis2/app-platform/commit/b72dd7908090f0d7b321d40e42a7f65a17c91438))

# [9.0.0](https://github.com/dhis2/app-platform/compare/v8.3.3...v9.0.0) (2022-03-14)


### chore

* **app shell:** update @dhis2/ui to ^8 ([c16f3b1](https://github.com/dhis2/app-platform/commit/c16f3b170e3138e0a0109c342eeed5d000eece0d))


### BREAKING CHANGES

* **app shell:** To prevent issues with multiple ui versions, we bump
the major version of the app-platform libraries as well

## [8.3.3](https://github.com/dhis2/app-platform/compare/v8.3.2...v8.3.3) (2022-02-22)


### Bug Fixes

* **deps:** bump axios from 0.20.0 to 0.25.0 ([#698](https://github.com/dhis2/app-platform/issues/698)) ([77853c4](https://github.com/dhis2/app-platform/commit/77853c47a543f4a3147bdb167612b4efc30afcff))

## [8.3.2](https://github.com/dhis2/app-platform/compare/v8.3.1...v8.3.2) (2021-12-07)

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![npm](https://img.shields.io/npm/v/@dhis2/cli-app-scripts.svg)](https://www.npmjs.com/package/@dhis2/cli-app-scripts)
[![build](https://img.shields.io/travis/dhis2/app-platform.svg?branch=master)](https://travis-ci.com/dhis2/app-platform)
![Dependabot](https://badgen.net/dependabot/dhis2/app-platform/?icon=dependabot)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Unified application architecture and build pipeline to simplify and standardize application development within the DHIS2 ecosystem.
Expand Down
8 changes: 4 additions & 4 deletions adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-adapter",
"version": "8.3.3-beta.1",
"version": "9.0.1",
"repository": {
"type": "git",
"url": "https://github.com/amcgee/dhis2-app-platform",
Expand All @@ -21,11 +21,11 @@
"build"
],
"dependencies": {
"@dhis2/pwa": "8.3.3-beta.1",
"@dhis2/pwa": "9.0.1",
"moment": "^2.24.0"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "8.3.3-beta.1",
"@dhis2/cli-app-scripts": "9.0.1",
"@testing-library/react": "^12.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
Expand All @@ -39,7 +39,7 @@
"peerDependencies": {
"@dhis2/app-runtime": "^3",
"@dhis2/d2-i18n": "^1",
"@dhis2/ui": "^7",
"@dhis2/ui": ">=7",
"classnames": "^2",
"moment": "^2",
"prop-types": "^15",
Expand Down
6 changes: 3 additions & 3 deletions adapter/src/components/Alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import React, { useState, useEffect } from 'react'
const Alerts = () => {
const alertManagerAlerts = useAlerts()
const [alertStackAlerts, setAlertStackAlerts] = useState(alertManagerAlerts)
const removeAlertStackAlert = id =>
const removeAlertStackAlert = (id) =>
setAlertStackAlerts(
alertStackAlerts.filter(
alertStackAlert => alertStackAlert.id !== id
(alertStackAlert) => alertStackAlert.id !== id
)
)

Expand All @@ -42,7 +42,7 @@ const Alerts = () => {
onHidden={() => {
onHidden && onHidden()
removeAlertStackAlert(id)
if (alertManagerAlerts.some(a => a.id === id)) {
if (alertManagerAlerts.some((a) => a.id === id)) {
remove()
}
}}
Expand Down
4 changes: 2 additions & 2 deletions adapter/src/components/ErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import i18n from '@dhis2/d2-i18n'
import cx from 'classnames'
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import buttonStyles from './styles/Button.style'
import styles from './styles/ErrorBoundary.style'
import buttonStyles from './styles/Button.style.js'
import styles from './styles/ErrorBoundary.style.js'

// In order to avoid using @dhis2/ui components in the error boundary - as anything
// that breaks within it will not be caught properly - we define a component
Expand Down
14 changes: 7 additions & 7 deletions adapter/src/components/LoginModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
InputField,
} from '@dhis2/ui'
import React, { useState } from 'react'
import i18n from '../locales'
import { post } from '../utils/api'
import i18n from '../locales/index.js'
import { post } from '../utils/api.js'

const staticUrl = process.env.REACT_APP_DHIS2_BASE_URL

Expand All @@ -20,9 +20,9 @@ export const LoginModal = () => {
const [password, setPassword] = useState('')
const [isDirty, setIsDirty] = useState(false)

const isValid = val => val && val.length >= 2
const isValid = (val) => val && val.length >= 2

const onSubmit = async e => {
const onSubmit = async (e) => {
e.preventDefault()
setIsDirty(true)
if (isValid(server) && isValid(username) && isValid(password)) {
Expand Down Expand Up @@ -61,7 +61,7 @@ export const LoginModal = () => {
name="server"
type="text"
value={server}
onChange={input => setServer(input.value)}
onChange={(input) => setServer(input.value)}
/>
)}

Expand All @@ -72,7 +72,7 @@ export const LoginModal = () => {
name="j_username"
type="text"
value={username}
onChange={input => setUsername(input.value)}
onChange={(input) => setUsername(input.value)}
/>

<InputField
Expand All @@ -82,7 +82,7 @@ export const LoginModal = () => {
name="j_password"
type="password"
value={password}
onChange={input => setPassword(input.value)}
onChange={(input) => setPassword(input.value)}
/>
</ModalContent>

Expand Down
4 changes: 2 additions & 2 deletions adapter/src/components/PWAUpdateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@dhis2/ui'
import PropTypes from 'prop-types'
import React, { useState, useEffect } from 'react'
import i18n from '../locales'
import i18n from '../locales/index.js'

function ConfirmReloadModal({ clientsCount, onCancel, onConfirm }) {
return (
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function PWAUpdateManager({ offlineInterface }) {
setConfirmReloadModalOpen(true)
}
})
.catch(reason => {
.catch((reason) => {
// Didn't get clients info
console.warn(reason)
// Go ahead with confirmation modal with `null` as clientsCount
Expand Down
6 changes: 3 additions & 3 deletions adapter/src/components/ServerVersionProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export const ServerVersionProvider = ({
return
}

setState(state => (state.loading ? state : { loading: true }))
setState((state) => (state.loading ? state : { loading: true }))
const request = get(`${url}/api/system/info`)
request
.then(systemInfo => {
.then((systemInfo) => {
setState({ loading: false, systemInfo })
})
.catch(e => {
.catch((e) => {
setState({ loading: false, error: e })
})

Expand Down
2 changes: 1 addition & 1 deletion adapter/src/components/__tests__/ErrorBoundary.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallow } from 'enzyme'
import React from 'react'
import { ErrorBoundary } from '../ErrorBoundary'
import { ErrorBoundary } from '../ErrorBoundary.js'

const Something = () => {
// Placeholder
Expand Down
4 changes: 2 additions & 2 deletions adapter/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { checkForSWUpdateAndReload, OfflineInterface } from '@dhis2/pwa'
import PropTypes from 'prop-types'
import React from 'react'
import { AppWrapper } from './components/AppWrapper.js'
import { ErrorBoundary } from './components/ErrorBoundary'
import { ServerVersionProvider } from './components/ServerVersionProvider'
import { ErrorBoundary } from './components/ErrorBoundary.js'
import { ServerVersionProvider } from './components/ServerVersionProvider.js'

const offlineInterface = new OfflineInterface()

Expand Down
6 changes: 3 additions & 3 deletions adapter/src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const request = (url, options) => {
},
signal: abortController.signal,
})
.then(response => {
.then((response) => {
if (response.status !== 200) {
reject('Request failed', response.statusText)
return
Expand All @@ -23,7 +23,7 @@ const request = (url, options) => {
resolve(response.text())
}
})
.catch(e => {
.catch((e) => {
console.error('Network error: ', e)
reject('Network error')
})
Expand All @@ -33,7 +33,7 @@ const request = (url, options) => {
return promise
}

export const get = url => request(url, { method: 'GET' })
export const get = (url) => request(url, { method: 'GET' })
export const post = (url, body) =>
request(url, {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion adapter/src/utils/parseServerVersion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const parseServerVersion = versionString => {
export const parseServerVersion = (versionString) => {
const [mainVersion, tag] = versionString?.split('-') || []
const [major, minor, patch] = mainVersion?.split('.') || []

Expand Down
6 changes: 3 additions & 3 deletions adapter/src/utils/useLocale.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { useState, useEffect } from 'react'

i18n.setDefaultNamespace('default')

const simplifyLocale = locale => {
const simplifyLocale = (locale) => {
const idx = locale.indexOf('-')
if (idx === -1) {
return locale
}
return locale.substr(0, idx)
}

const setGlobalLocale = locale => {
const setGlobalLocale = (locale) => {
if (locale !== 'en' && locale !== 'en-us') {
import(
/* webpackChunkName: "moment-locales/[request]" */ `moment/locale/${locale}`
Expand All @@ -27,7 +27,7 @@ const setGlobalLocale = locale => {
i18n.changeLanguage(simplifiedLocale)
}

export const useLocale = locale => {
export const useLocale = (locale) => {
const [result, setResult] = useState(undefined)
useEffect(() => {
if (!locale) {
Expand Down
2 changes: 1 addition & 1 deletion adapter/src/utils/useVerifyLatestUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function useVerifyLatestUser() {
const { pwaEnabled } = useConfig()
const [finished, setFinished] = useState(false)
const { loading, error } = useDataQuery(USER_QUERY, {
onComplete: async data => {
onComplete: async (data) => {
const latestUserId = localStorage.getItem(LATEST_USER_KEY)
const currentUserId = data.user.id
if (currentUserId !== latestUserId) {
Expand Down
2 changes: 1 addition & 1 deletion cli/config/makeBabelConfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const browserTargets = require('./.browserlistrc')
const jestTargets = { node: 'current' }

const getBabelModuleType = moduleType => {
const getBabelModuleType = (moduleType) => {
switch (moduleType) {
case 'cjs':
case 'commonjs':
Expand Down
6 changes: 3 additions & 3 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/cli-app-scripts",
"version": "8.3.3-beta.1",
"version": "9.0.1",
"engines": {
"node": ">=12"
},
Expand Down Expand Up @@ -28,12 +28,12 @@
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.6.0",
"@dhis2/app-shell": "8.3.3-beta.1",
"@dhis2/app-shell": "9.0.1",
"@dhis2/cli-helpers-engine": "^3.2.0",
"@jest/core": "^27.0.6",
"@yarnpkg/lockfile": "^1.1.0",
"archiver": "^3.1.1",
"axios": "^0.20.0",
"axios": "^0.25.0",
"babel-jest": "^27.0.6",
"babel-plugin-react-require": "^3.1.3",
"chokidar": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const handler = async ({ cwd }) => {
const dirsToClean = [paths.d2, paths.buildOutput]

reporter.info('Cleaning intermediate directories and build output...')
dirsToClean.forEach(dir => {
dirsToClean.forEach((dir) => {
reporter.print(' * ' + dir)
fs.removeSync(dir)
})
Expand Down
6 changes: 3 additions & 3 deletions cli/src/commands/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const dumpHttpError = (message, response) => {
reporter.debugErr('Error details', response.data)
}

const promptForDhis2Config = async params => {
const promptForDhis2Config = async (params) => {
if (
process.env.CI &&
(!params.baseUrl || !params.username || !params.password)
Expand All @@ -36,7 +36,7 @@ const promptForDhis2Config = async params => {
)
}

const isValidUrl = input =>
const isValidUrl = (input) =>
input && input.length && input.match(/^https?:\/\/[^/.]+/)

const responses = await inquirer.prompt([
Expand All @@ -45,7 +45,7 @@ const promptForDhis2Config = async params => {
name: 'baseUrl',
message: 'DHIS2 instance URL:',
when: () => !params.baseUrl,
validate: input =>
validate: (input) =>
isValidUrl(input)
? true
: 'Please enter a valid URL, it must start with http:// or https://',
Expand Down
Loading

0 comments on commit 3b8e0ef

Please sign in to comment.