From c4447684822704fe011b46cf1e2439490a313e50 Mon Sep 17 00:00:00 2001 From: dshuffma-ibm Date: Fri, 4 Aug 2023 15:41:55 -0400 Subject: [PATCH] add blank page and route for audit logs (#519) * add blank page and route for audit logs * add duplicate cve in npm audit file --------- Signed-off-by: David Huffman --- packages/apollo/src/app.scss | 1 + .../apollo/src/assets/i18n/en/messages.json | 1 + .../src/components/AuditLogs/AuditLogs.js | 106 ++++++++++++++++++ .../src/components/AuditLogs/_auditLogs.scss | 3 + .../apollo/src/components/LeftNav/LeftNav.js | 13 +++ packages/apollo/src/components/Main/Main.js | 5 + packages/athena/.nsprc | 4 + 7 files changed, 133 insertions(+) create mode 100644 packages/apollo/src/components/AuditLogs/AuditLogs.js create mode 100644 packages/apollo/src/components/AuditLogs/_auditLogs.scss diff --git a/packages/apollo/src/app.scss b/packages/apollo/src/app.scss index 04aee3db..f492be07 100644 --- a/packages/apollo/src/app.scss +++ b/packages/apollo/src/app.scss @@ -79,6 +79,7 @@ @import './components/Login/login'; @import './components/Main/main'; @import './components/MigrationPage/migrationPage'; +@import './components/AuditLogs/auditLogs'; @import './components/Access/access'; @import './components/MSPDefinitionModal/mSPDefinitionModal'; @import './components/MspDeleteModal/mspDeleteModal'; diff --git a/packages/apollo/src/assets/i18n/en/messages.json b/packages/apollo/src/assets/i18n/en/messages.json index 4e7c4cd8..b0df4a45 100644 --- a/packages/apollo/src/assets/i18n/en/messages.json +++ b/packages/apollo/src/assets/i18n/en/messages.json @@ -2810,6 +2810,7 @@ "mig_users_text": "2. (optional step) Additional local users can be created by using the \"Users\" tab on your new console. You should create a user on the new console for every active user of this console.", "mig_test_txt": "3. Next check if the new console is working. Open a new tab to the new console and click on each of the node tiles. You will need to associate each node with an appropriate identity from your wallet. Compare the Fabric related content seen on the new console with the content seen on this console, it should be identical. If the new console is missing content double check that the correct identity was associated and switch the identity if needed.", "mig_delete_txt": "4. If the new console is working well it's time to delete this console. Go to your [[IBM Cloud resources]](https://cloud.ibm.com/resources) dashboard, under \"Blockchain\" find the row for this console, and open it. You should be on the page which used to have the blue button that launches the console. This page should now have the text \"This console has been migrated!\". If so then it is safe to delete by using the \"Actions...\" dropdown and the \"Delete service\" option. If this text is missing contact support.", + "audit_logs": "Audit logs", "hide_archived_channels": "Hide Archived Channels", "show_archived_channels": "Show Archived Channels" } diff --git a/packages/apollo/src/components/AuditLogs/AuditLogs.js b/packages/apollo/src/components/AuditLogs/AuditLogs.js new file mode 100644 index 00000000..eefdc031 --- /dev/null +++ b/packages/apollo/src/components/AuditLogs/AuditLogs.js @@ -0,0 +1,106 @@ +/* + * Copyright contributors to the Hyperledger Fabric Operations Console project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +import PropTypes from 'prop-types'; +import React, { Component } from 'react'; +import { withLocalize } from 'react-localize-redux'; +import { connect } from 'react-redux'; +import { showBreadcrumb, updateState } from '../../redux/commonActions'; +import { SkeletonText } from 'carbon-components-react'; +import Helper from '../../utils/helper'; +import PageContainer from '../PageContainer/PageContainer'; +//import Logger from '../Log/Logger'; +import PageHeader from '../PageHeader/PageHeader'; +const SCOPE = 'AuditLogs'; +//const Log = new Logger(SCOPE); + +class AuditLogs extends Component { + debounce = null; + monitorInterval = null; + + async componentDidMount() { + this.props.showBreadcrumb('settings', {}, this.props.history.location.pathname, true); + this.props.updateState(SCOPE, { + loading: true, + }); + + setTimeout(() => { + this.props.updateState(SCOPE, { + loading: false, + }); + }, 500); + } + + // -------------------------------------------------------------------------- + // Main Migration Content + // -------------------------------------------------------------------------- + render() { + //const translate = this.props.translate; + + return ( + +
+
+ + + {this.props.loading && +
+ + +
+ } + + {!this.props.loading && +
+

Coming soon

+
+ } +
+
+
+ ); + } +} + +const dataProps = { + loading: PropTypes.bool, + settings: PropTypes.object, + errorMsg: PropTypes.string, +}; + +AuditLogs.propTypes = { + ...dataProps, + updateState: PropTypes.func, + translate: PropTypes.func, + history: PropTypes.object, +}; + +export default connect(state => { + return Helper.mapStateToProps(state[SCOPE], dataProps); +}, { + updateState, + showBreadcrumb +})(withLocalize(AuditLogs)); diff --git a/packages/apollo/src/components/AuditLogs/_auditLogs.scss b/packages/apollo/src/components/AuditLogs/_auditLogs.scss new file mode 100644 index 00000000..c65986f1 --- /dev/null +++ b/packages/apollo/src/components/AuditLogs/_auditLogs.scss @@ -0,0 +1,3 @@ +.tinyTextWhite { + font-size: 0.8rem; +} diff --git a/packages/apollo/src/components/LeftNav/LeftNav.js b/packages/apollo/src/components/LeftNav/LeftNav.js index 4d77a63e..5babf225 100644 --- a/packages/apollo/src/components/LeftNav/LeftNav.js +++ b/packages/apollo/src/components/LeftNav/LeftNav.js @@ -55,6 +55,12 @@ const mainNav = [ id: 'organizations', globalNavSubmenu: [], }, + { + icon: 'fingerprint', // 'terminal' looks good to + path: '/audit-logs', + id: 'audit_logs', + globalNavSubmenu: [], + }, { icon: 'member', path: '/access', @@ -119,6 +125,13 @@ class LeftNav extends Component { if (this.props.submenu) { return this.props.submenu; } + + for (let i in mainNav) { + if (mainNav[i] && mainNav[i].id === 'audit_logs') { + // todo, contextually bring back audit_logs + mainNav.splice(i, 1); + } + } return mainNav; } diff --git a/packages/apollo/src/components/Main/Main.js b/packages/apollo/src/components/Main/Main.js index 7437beff..a6291331 100644 --- a/packages/apollo/src/components/Main/Main.js +++ b/packages/apollo/src/components/Main/Main.js @@ -47,6 +47,7 @@ import Settings from '../Settings/Settings'; import Support from '../Support/Support'; import TitleBar from '../TitleBar/TitleBar'; import MigrationPage from '../MigrationPage/MigrationPage'; +import AuditLogs from '../AuditLogs/AuditLogs'; const SCOPE = 'main'; const Log = new Logger(SCOPE); @@ -246,6 +247,10 @@ class Main extends Component { component={MigrationPage} exact /> + diff --git a/packages/athena/.nsprc b/packages/athena/.nsprc index 12767ae4..e1dbf4ef 100644 --- a/packages/athena/.nsprc +++ b/packages/athena/.nsprc @@ -10,5 +10,9 @@ "1092779": { "active": true, "notes": "same as 1091459" + }, + "1092826": { + "active": true, + "notes": "same as 1091459" } }