Skip to content

Commit

Permalink
show a delete service instance banner (hyperledger-labs#535)
Browse files Browse the repository at this point in the history
Signed-off-by: David Huffman <dshuffma@us.ibm.com>
  • Loading branch information
dshuffma-ibm committed Oct 17, 2023
1 parent bc54314 commit 3354829
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/apollo/src/assets/i18n/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,7 @@
"log_detail_desc": "The full details of this activity log are below.",
"log_columns_desc": "Display",
"audit_no_access_msg": "Only users with the \"Manager\" can view this page",
"threat_message":"This service instance must be deleted by Oct 31, 2023 to avoid a blockchain network outage",
"hide_archived_channels": "Hide Archived Channels",
"show_archived_channels": "Show Archived Channels"
}
11 changes: 11 additions & 0 deletions packages/apollo/src/components/PageHeader/PageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class PageHeader extends Component {
migratedConsoleUrl: resp ? resp.migrated_console_url : '',
showDeleteBanner: false,
migrationType: this.detectBannerType(resp ? resp.deadline : 0),
showThreat: resp ? resp.migration_enabled : false,
};
migrationState.showDeleteBanner = migrationState.isMigrationComplete;
migrationState.showReadOnlyBanner = migrationState.isMigrationComplete;
Expand All @@ -123,6 +124,7 @@ export class PageHeader extends Component {
migrationState.showMigrationBanner = false;
migrationState.showDeleteBanner = false;
migrationState.showReadOnlyBanner = false;
migrationState.showThreat = false;
}

this.props.updateState(SCOPE, migrationState);
Expand Down Expand Up @@ -412,6 +414,14 @@ export class PageHeader extends Component {
title={translate('migration_done_title')}
/>
)}
{this.props.showAnnouncement && this.props.showThreat && (
<InlineNotification
className='threat-style'
kind="error"
hideCloseButton
title={translate('threat_message')}
/>
)}
{this.props.showAnnouncement && this.props.showReadOnlyBanner && (
<InlineNotification
kind="warning"
Expand Down Expand Up @@ -493,6 +503,7 @@ const dataProps = {
showCertUpdateNotice: PropTypes.bool,
upCompList: PropTypes.string,
migrationType: PropTypes.string,
showThreat: PropTypes.bool,
};

PageHeader.propTypes = {
Expand Down
25 changes: 25 additions & 0 deletions packages/apollo/src/components/PageHeader/_pageHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,28 @@
line-height: 1.125rem;
margin-top: 0.5rem;
}

.threat-style {
background: #000 !important;
.bx--inline-notification__text-wrapper {
color: #cc0000;
animation: color-change 3s infinite;
}
}

@keyframes color-change {
0% {
color: #cc0000;
font-weight: 900;
}

50% {
color: #fff;
font-weight: 300;
}

100% {
color: #cc0000;
font-weight: 900;
}
}

0 comments on commit 3354829

Please sign in to comment.