diff --git a/packages/apollo/src/assets/i18n/en/messages.json b/packages/apollo/src/assets/i18n/en/messages.json index b0df4a45..8b25288f 100644 --- a/packages/apollo/src/assets/i18n/en/messages.json +++ b/packages/apollo/src/assets/i18n/en/messages.json @@ -120,6 +120,7 @@ "grant_tooltip": "The only supported grant is \"authorization_code\".", "response_type_label": "Response type", "response_type_tooltip": "The only supported response type is \"code\".", + "msp_admin_type_tooltip": "These are identities in your wallet that are also admins on this channel", "debug_label": "User login debug logs", "debug_logs_tooltip": "Extra console server logs during user login can help debug OAuth2.0 setup issues, but for maximum user privacy this setting should be off once login problems are resolved.", "default_password_placeholder": "Enter a password here", diff --git a/packages/apollo/src/components/UpdateChannelMspModal/UpdateChannelMspModal.js b/packages/apollo/src/components/UpdateChannelMspModal/UpdateChannelMspModal.js index 13095607..5e8c0e6d 100644 --- a/packages/apollo/src/components/UpdateChannelMspModal/UpdateChannelMspModal.js +++ b/packages/apollo/src/components/UpdateChannelMspModal/UpdateChannelMspModal.js @@ -176,6 +176,7 @@ class UpdateChannelMspModal extends React.Component { disableSubmit: !this.props.isOrdererMSP, }); } + async onSelectMSP(event) { if (event.selectedMsp) { this.populateMSP(event.selectedMsp); @@ -342,30 +343,21 @@ class UpdateChannelMspModal extends React.Component { default: 'select_msp_id', }, ]; - if (this.props.submit_identity_options && !this.props.isOrdererMSP && this.props.submit_identity_options.length < 6) { - this.props.submit_identity_options.map((admin, index) => { - if (!admin.cas) { - if (index < 1) { - fields.push({ - label: 'Admins', - name: 'admin_identity', - type: 'text', - default: admin.name, - readonly: true, - }); - } - else { - fields.push({ - label: 'Admins', - name: 'admin_identity', - type: 'text', - default: admin.name, - readonly: true, - hideLabel: true, - }); - } - } - }) + if (this.props.submit_identity_options && !this.props.isOrdererMSP) { + let mspAdmins = this.populateMSPAdmins(); + fields.push({ + label: 'Known channel admins', + name: 'admin_identity', + type: 'component', + default: + mspAdmins.map((val, idx) => +
+

{val}

+
), + readonly: true, + tooltip: 'msp_admin_type_tooltip', + tooltipDirection: 'top', + }); } if (!this.props.isOrdererMSP) { fields.push({ @@ -379,6 +371,20 @@ class UpdateChannelMspModal extends React.Component { return fields; } + populateMSPAdmins() + { + const admin_identites = []; + this.props.submit_identity_options.forEach(value => { + const parsed_msp_cert = StitchApi.parseCertificate(value.cert); + if (admin_identites.length < 6) + { + if (parsed_msp_cert.subject_parts.OU === 'admin') { + admin_identites.push(value.name); + } + } + }); + return admin_identites; + } renderUploadMSPDefinition(translate) { return (