Skip to content

Commit

Permalink
add blank page and route for audit logs (#519)
Browse files Browse the repository at this point in the history
* add blank page and route for audit logs
* add duplicate cve in npm audit file
---------
Signed-off-by: David Huffman <dshuffma@us.ibm.com>
  • Loading branch information
dshuffma-ibm authored Aug 4, 2023
1 parent 01fd493 commit c444768
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/apollo/src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
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 @@ -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"
}
106 changes: 106 additions & 0 deletions packages/apollo/src/components/AuditLogs/AuditLogs.js
Original file line number Diff line number Diff line change
@@ -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 (
<PageContainer>
<div className="bx--row migrationPanel">
<div className="bx--col-lg-13">
<PageHeader
history={this.props.history}
headerName="audit_logs"
staticHeader
/>

{this.props.loading &&
<div>
<SkeletonText
style={{
paddingTop: '.5rem',
width: '8rem',
height: '1rem',
}}
/>
<SkeletonText />
</div>
}

{!this.props.loading &&
<div>
<h3>Coming soon</h3>
</div>
}
</div>
</div >
</PageContainer >
);
}
}

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));
3 changes: 3 additions & 0 deletions packages/apollo/src/components/AuditLogs/_auditLogs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.tinyTextWhite {
font-size: 0.8rem;
}
13 changes: 13 additions & 0 deletions packages/apollo/src/components/LeftNav/LeftNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions packages/apollo/src/components/Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -246,6 +247,10 @@ class Main extends Component {
component={MigrationPage}
exact
/>
<Route exact
path="/audit-logs"
component={AuditLogs}
/>
<Route path="*"
component={NotFound}
/>
Expand Down
4 changes: 4 additions & 0 deletions packages/athena/.nsprc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
"1092779": {
"active": true,
"notes": "same as 1091459"
},
"1092826": {
"active": true,
"notes": "same as 1091459"
}
}

0 comments on commit c444768

Please sign in to comment.