Skip to content

Commit

Permalink
Merge pull request #66 from openimis/release/23.10
Browse files Browse the repository at this point in the history
MERGING release/23.10 into main
  • Loading branch information
hirensoni913 authored Jan 16, 2024
2 parents 3b680c6 + fa6c2cb commit a96ffbd
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Sonar CI pipeline
on:
push:
branches:
- main
- 'release/**'
- develop
- 'feature/**'
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.projectKey=openimis_openimis-fe-contract_js
sonar.organization=openimis-1
sonar.projectName=openimis-fe-contract_js

sonar.sources=src
sonar.sourceEncoding=UTF-8
10 changes: 8 additions & 2 deletions src/components/ContractContributionDetailsFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const styles = theme => ({
class ContractContributionDetailsFilter extends Component {
_filterValue = k => {
const { filters } = this.props;
return !!filters[k] ? filters[k].value : null
return !!filters[k] ? filters[k].value : null;
}

_filterTextFieldValue = (key) => {
const { filters } = this.props;
return !!filters[key] ? filters[key].value : "";
}

render() {
Expand All @@ -29,7 +34,7 @@ class ContractContributionDetailsFilter extends Component {
<TextInput
module="contract"
label="insureeChfId"
value={this._filterValue('contractDetails_Insuree_ChfId')}
value={this._filterTextFieldValue('contractDetails_Insuree_ChfId')}
onChange={v => onChangeFilters([{
id: 'contractDetails_Insuree_ChfId',
value: v,
Expand Down Expand Up @@ -69,6 +74,7 @@ class ContractContributionDetailsFilter extends Component {
pubRef="product.ProductPicker"
withNull={true}
label={formatMessage(intl, "contract", "benefitPlan")}
value={this._filterValue('contributionPlan_BenefitPlan_Id')}
onChange={v => onChangeFilters([{
id: 'contributionPlan_BenefitPlan_Id',
value: v,
Expand Down
9 changes: 7 additions & 2 deletions src/components/ContractDetailsFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ const styles = theme => ({
class ContractDetailsFilter extends Component {
_filterValue = k => {
const { filters } = this.props;
return !!filters[k] ? filters[k].value : null
return !!filters[k] ? filters[k].value : null;
}

_filterTextFieldValue = (key) => {
const { filters } = this.props;
return !!filters[key] ? filters[key].value : "";
}

render() {
Expand All @@ -29,7 +34,7 @@ class ContractDetailsFilter extends Component {
<TextInput
module="contract"
label="insureeChfId"
value={this._filterValue('insuree_ChfId')}
value={this._filterTextFieldValue('insuree_ChfId')}
onChange={v => onChangeFilters([{
id: 'insuree_ChfId',
value: v,
Expand Down
11 changes: 8 additions & 3 deletions src/components/ContractFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class ContractFilter extends Component {

_filterValue = k => {
const { filters } = this.props;
return !!filters[k] ? filters[k].value : null
return !!filters[k] ? filters[k].value : null;
}

_filterTextFieldValue = (key) => {
const { filters } = this.props;
return !!filters[key] ? filters[key].value : "";
}

_onChangeFilter = (k, v) => {
Expand Down Expand Up @@ -68,7 +73,7 @@ class ContractFilter extends Component {
<TextInput
module="contract"
label="code"
value={this._filterValue('code')}
value={this._filterTextFieldValue('code')}
onChange={v => this._onChangeStringFilter('code', v, CONTAINS_LOOKUP)}
/>
</Grid>
Expand Down Expand Up @@ -139,7 +144,7 @@ class ContractFilter extends Component {
<TextInput
module="contract"
label="paymentReference"
value={this._filterValue('paymentReference')}
value={this._filterTextFieldValue('paymentReference')}
onChange={v => this._onChangeStringFilter('paymentReference', v, CONTAINS_LOOKUP)}
/>
</Grid>
Expand Down
7 changes: 6 additions & 1 deletion src/components/ContractForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ class ContractForm extends Component {
this.setState((state, props) => ({
contract: {
...state.contract,
policyHolder: props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId)
policyHolder: props.predefinedPolicyHolderId
? props.policyHolders.find((v) => decodeId(v.id) === props.predefinedPolicyHolderId)
: ( props.contract.policyHolder
? props.policyHolders.find((v) => decodeId(v.id) === decodeId(props.contract.policyHolder.id))
: null
)
}
}));
}
Expand Down

0 comments on commit a96ffbd

Please sign in to comment.