Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT chain: remove cycles #3477

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@
"cluster": "^0.7.7",
"codemirror": "^5.65.5",
"csv": "^6.3.6",
"d3": "^7.8.4",
"d3-interpolate-path": "^2.2.3",
"d3-tip": "^0.9.1",
"d3": "^7.9.0",
"dotenv": "^16.4.5",
"express": "^4.18.1",
"express-session": "^1.18.0",
Expand Down Expand Up @@ -175,17 +173,14 @@
"react-switch": "^7.0.0",
"react-tiny-popover": "^8.0.4",
"react-transition-group": "^4.4.2",
"react-vega": "^7.6.0",
"recharts": "^2.12.3",
"recharts": "^2.12.7",
"redux": "^5.0.1",
"shpjs": "^4.0.4",
"socket.io-client": "^4.7.4",
"supercluster": "^8.0.1",
"to-snake-case": "^1.0.0",
"use-supercluster": "^1.2.0",
"uuid": "^9.0.1",
"vega": "^5.27.0",
"vega-lite": "^5.16.3",
"xml-js": "^1.6.11"
},
"arenaClientPackages": {
Expand Down
5 changes: 0 additions & 5 deletions server/modules/reporting/api/index.js

This file was deleted.

78 changes: 0 additions & 78 deletions server/modules/reporting/api/reportingApi.js

This file was deleted.

Empty file.
Empty file.
2 changes: 0 additions & 2 deletions server/system/apiRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as recordApi from '@server/modules/record/api/recordApi'
import * as dataExportApi from '@server/modules/dataExport/api/dataExportApi'
import * as dataImportApi from '@server/modules/dataImport/api/dataImportApi'
import * as surveyRdbApi from '@server/modules/surveyRdb/api/surveyRdbApi'
import * as reportingApi from '@server/modules/reporting/api'
import * as analysisApi from '@server/modules/analysis/api'
import * as jobApi from '@server/job/jobApi'
import * as expressionApi from '@server/modules/expression/api/expressionApi'
Expand Down Expand Up @@ -41,7 +40,6 @@ dataExportApi.init(router)
dataImportApi.init(router)

surveyRdbApi.init(router)
reportingApi.init(router)

analysisApi.init(router)

Expand Down
30 changes: 21 additions & 9 deletions webapp/views/App/views/Analysis/Chain/ChainBasicProps.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useEffect, useState } from 'react'
import PropTypes from 'prop-types'

import * as Survey from '@core/survey/survey'
import * as RecordStep from '@core/record/recordStep'
import * as Validation from '@core/validation/validation'
import * as Chain from '@common/analysis/chain'

import { useI18n } from '@webapp/store/system'
import { useSurvey } from '@webapp/store/survey'
import { useSurvey, useSurveyCycleKeys } from '@webapp/store/survey'
import { useChain } from '@webapp/store/ui/chain'
import { useChainRecordsCountByStep } from '@webapp/store/ui/chain/hooks'

Expand All @@ -24,6 +25,7 @@ export const ChainBasicProps = (props) => {
const i18n = useI18n()
const chain = useChain()
const survey = useSurvey()
const cycleKeys = useSurveyCycleKeys()

const [existsAnotherChainWithSamplingDesign, setExistsAnotherChainWithSamplingDesign] = useState(false)

Expand All @@ -42,28 +44,34 @@ export const ChainBasicProps = (props) => {

const validation = Chain.getValidation(chain)
const baseUnitNodeDef = Survey.getBaseUnitNodeDef({ chain })(survey)
const { props: chainProps } = chain

const samplingDesignDisabled =
existsAnotherChainWithSamplingDesign || (Chain.hasSamplingDesign(chain) && Boolean(baseUnitNodeDef))

return (
<div className="chain-basic-props">
<LabelsEditor
labels={chain.props?.labels}
labels={chainProps.labels}
formLabelKey="chainView.formLabel"
readOnly={false}
validation={Validation.getFieldValidation(Chain.keysProps.labels)(validation)}
onChange={(labels) => updateChain({ ...chain, props: { ...chain.props, labels } })}
onChange={(labels) => updateChain({ ...chain, props: { ...chainProps, labels } })}
/>
<LabelsEditor
formLabelKey="common.description"
labels={chain.props.descriptions}
onChange={(descriptions) => updateChain({ ...chain, props: { ...chain.props, descriptions } })}
/>
<CyclesSelector
cyclesKeysSelected={chain.props.cycles}
onChange={(cycles) => updateChain({ ...chain, props: { ...chain.props, cycles } })}
labels={chainProps.descriptions}
onChange={(descriptions) => updateChain({ ...chain, props: { ...chainProps, descriptions } })}
/>
{
// show cycles selector only when not all cycles are selected (for backwards compatibility)
cycleKeys.length > chainProps.cycles.length && (
<CyclesSelector
cyclesKeysSelected={chainProps.cycles}
onChange={(cycles) => updateChain({ ...chain, props: { ...chainProps, cycles } })}
/>
)
}
<FormItem label={i18n.t('chainView.samplingDesign')} className="sampling-design-form-item">
<Checkbox
checked={Chain.hasSamplingDesign(chain)}
Expand Down Expand Up @@ -92,3 +100,7 @@ export const ChainBasicProps = (props) => {
</div>
)
}

ChainBasicProps.propTypes = {
updateChain: PropTypes.func.isRequired,
}
78 changes: 0 additions & 78 deletions webapp/views/App/views/Data/Charts/Charts.js

This file was deleted.

49 changes: 0 additions & 49 deletions webapp/views/App/views/Data/Charts/Charts.scss

This file was deleted.

Loading
Loading