Skip to content

Commit

Permalink
Merge pull request #754 from ckpaliwal/issue-6129
Browse files Browse the repository at this point in the history
automation test case issue debug point and issue fix
  • Loading branch information
ckpaliwal authored Jun 19, 2024
2 parents 0912bfd + c0ba259 commit 15827ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
19 changes: 11 additions & 8 deletions packages/apollo/src/components/Form/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class Form extends Component {
label={field.name}
id={field.name}
name={field.name}
ariaLabel={translate(field.label || field.name, field.labelOptions)}
aria-label={translate(field.label || field.name, field.labelOptions)}
items={fixed_options}
selectedItem={fixed_value ? fixed_value : field.default}
disabled={field.disabled}
Expand Down Expand Up @@ -531,15 +531,18 @@ class Form extends Component {
return '';
}}
onChange={(item) => {
console.log('dropdown on change');
const data = {};
data[field.name] = this.fixChangedItem(field.options, item.selectedItem);
this.props.updateState(this.props.scope, data);
if (this.props.onChange) {
const valid = this.isFormValid({
...this.props,
...data,
});
this.props.onChange(data, valid, field, this.props.formProps);
if (JSON.stringify(this.props.scope[field.name]) !== JSON.stringify(data[field.name])) {
this.props.updateState(this.props.scope, data);
if (this.props.onChange) {
const valid = this.isFormValid({
...this.props,
...data,
});
this.props.onChange(data, valid, field, this.props.formProps);
}
}
}}
/>
Expand Down
17 changes: 11 additions & 6 deletions packages/apollo/src/components/OrdererModal/OrdererModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ class OrdererModal extends React.Component {

async associateIdentityWithOrderer() {
const keys = Object.keys(this.props.associatedIdentities);
keys.reduce(async (previousPromise, msp_id) => {
await keys.reduce(async (previousPromise, msp_id) => {
await previousPromise;
const id = this.props.associatedIdentities[msp_id];
try {
Expand All @@ -1160,9 +1160,9 @@ class OrdererModal extends React.Component {
throw newError;
}
}, Promise.resolve());
setTimeout(() => {
this.props.onComplete();
}, 10);

this.props.onComplete();

return;
}

Expand All @@ -1180,11 +1180,11 @@ class OrdererModal extends React.Component {
const options = this.props.applicableIdentities[msp_id] ? [do_not_associate, ...this.props.applicableIdentities[msp_id]] : [];
fields.push({
name: 'identity_' + msp_id,
label: 'orderer_admin_identity',
type: 'dropdown',
tooltip: 'existing_identity_dropdown_tooltip',
options,
required: false,
label: 'orderer_admin_identity',
default: !this.identities || !this.identities.length ? translate('no_identities') : msp_identity ? msp_identity : do_not_associate,
});
});
Expand All @@ -1203,13 +1203,18 @@ class OrdererModal extends React.Component {
id={SCOPE + '-associate'}
fields={fields}
onChange={data => {
console.log('triggering with data', data);
const changed = Object.keys(data);
const associatedIdentities = { ...this.props.associatedIdentities };
changed.forEach(field => {
const msp_id = field.substring(9);
associatedIdentities[msp_id] = data[field];
});
this.props.updateState(SCOPE, { associatedIdentities });
setTimeout(() => {
if (JSON.stringify(this.props.associatedIdentities) !== JSON.stringify(associatedIdentities)) {
this.props.updateState(SCOPE, { associatedIdentities });
}
}, 100);
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/athena/public/releaseNotes.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"version": "1.0.9-19",
"version": "1.0.9-20",
"date": "04 July 2024",
"description": [
{
Expand Down

0 comments on commit 15827ba

Please sign in to comment.