Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compliance tabs #511

Merged
merged 48 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
150ff63
Update to release 1.17.0
kuanfandevops Dec 18, 2020
c3a1b1a
changed comments to be associated with history instead of transfer id…
emi-hi Dec 18, 2020
e2f8b7d
ZEVA 358 - Director reject comment (#461)
emi-hi Dec 18, 2020
9c075d2
ZEVA-365: Added Permission Checks for Credit Transfer and Credit Appl…
amichard Dec 18, 2020
e6454b0
Fixed the ordering in credit transaction page. Add association of cre…
amichard Dec 18, 2020
82139a9
Fixed permission errors (#466)
amichard Dec 18, 2020
879d188
Added typeof check to function (#467)
amichard Dec 18, 2020
2e4d61d
added new status for transfers - rescind_pre_approval, for when trans…
emi-hi Dec 21, 2020
bdcd163
Update jenkins executor number to be 5 (#469)
kuanfandevops Dec 24, 2020
7da4fb9
Update User Fixtures (#473)
amichard Jan 4, 2021
d508b50
ZEVA 347 - Credit transfer status alerts (#470)
emi-hi Jan 4, 2021
9d9e1f3
updated email address on dashboard from CEVinquiries to ZEVRegulation…
emi-hi Jan 4, 2021
fd61602
ZEVA 360 - Delete transfer (#474)
emi-hi Jan 4, 2021
db33e78
ZEVA-330, 331: Add email notification configurations for IDIR and BCe…
NavpreetGrewal Jan 5, 2021
b2834ab
Bump axios from 0.19.2 to 0.21.1 in /.pipeline (#475)
dependabot[bot] Jan 5, 2021
21b63f9
Bump axios from 0.19.2 to 0.21.1 in /.pipeline-v3 (#476)
dependabot[bot] Jan 5, 2021
4a7d2d9
Update patroni health check and liveness check (#480)
kuanfandevops Jan 5, 2021
e10f712
ZEVA-369: Fixed Name Associated with the Status History (#478)
amichard Jan 6, 2021
96091a0
Minor label changes/fixes (#483)
amichard Jan 6, 2021
4d7e9f7
ZEVA-376, 379: Send email notification to Analyst and Director based …
NavpreetGrewal Jan 6, 2021
01aa7c7
adds user prop to supplier tabs and checks permissions before showing…
emi-hi Jan 6, 2021
d194c45
Only deploy needed apps for test and prod (#486)
kuanfandevops Jan 6, 2021
5560dbe
ZEVA-381: Send notifications to the transfer partner based on thier s…
NavpreetGrewal Jan 7, 2021
f99669b
removed navbar link and activity section from bceid users that dont h…
emi-hi Jan 7, 2021
cd432ee
Automatically clear the error messsage when a new file is selected or…
amichard Jan 7, 2021
3137370
Remove openshift v3 and add upload process pod for testing (#488)
kuanfandevops Jan 7, 2021
f256637
added condition for displaying credit transaction tab in navbar to id…
emi-hi Jan 7, 2021
a1628c3
fixed condition for showing button on transfer modal (#490)
emi-hi Jan 7, 2021
25b4a80
Fix Notification Alerts (#491)
NavpreetGrewal Jan 8, 2021
f4dee0c
Thursday Jan 8 Transfer bugs and changes (#494)
emi-hi Jan 8, 2021
30128f8
Added a command to populate the notification subscription for exiting…
amichard Jan 8, 2021
62c1669
Fixed dashboard not showing the right banner for Approved (#493)
amichard Jan 8, 2021
6fc112c
fixed rounding on transfer details table (#495)
emi-hi Jan 11, 2021
6afa0fe
Add dashboard red alert for "rejected by transfer partner" option. (#…
NavpreetGrewal Jan 11, 2021
21f2d32
Show Sign off checkboxes only if user has permission to submit the tr…
NavpreetGrewal Jan 11, 2021
7f2e970
ZEVA-406: Dashboard now limits the finalized activities from 28 days …
amichard Jan 11, 2021
0f5d70b
Notification fix (#499)
NavpreetGrewal Jan 11, 2021
58721e9
Restored validate_transfer call (#500)
amichard Jan 12, 2021
86c9886
ZEVA 394 - Vehicle workflow (#502)
emi-hi Jan 13, 2021
8441cc0
Notification in the front-end is now configurable (#501)
amichard Jan 13, 2021
1029606
ZEVA 394: Vehicle workflow redirect (#503)
emi-hi Jan 13, 2021
14ff985
set up compliance front end
emi-hi Jan 13, 2021
ea795a2
zeva 394: Vehicle workflow fix (#504)
emi-hi Jan 13, 2021
3e9fdcf
ZEVA-396: Fixed Filter for ICBC Verification Page (#505)
amichard Jan 13, 2021
268b799
Fixed the reload by pushing a route to list then replacing it (#507)
amichard Jan 14, 2021
01447b7
added compliance to navbar, added compliance tabs and containers for …
emi-hi Jan 14, 2021
f5101f9
Merge branch 'release-1.17.0' into complianceTabs
emi-hi Jan 14, 2021
b5a45ef
merged to 18, fixed conflicts
emi-hi Jan 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions frontend/src/app/components/ComplianceTabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react';
import { Link } from 'react-router-dom';
import ROUTES_COMPLIANCE from '../routes/Compliance';
import PropTypes from 'prop-types';
import CustomPropTypes from '../utilities/props';

const ComplianceTabs = (props) => {
const { active, user } = props;

return (
<ul
className="nav nav-tabs"
key="tabs"
role="tablist"
>
<li
className={`nav-item ${(active === 'sales') ? 'active' : ''}`}
role="presentation"
>
<Link to={ROUTES_COMPLIANCE.LDVSALES}>LDV Sales</Link>
</li>
<li
className={`nav-item ${(active === 'reports') ? 'active' : ''}`}
role="presentation"
>
<Link to={ROUTES_COMPLIANCE.REPORTS}>Compliance Reports</Link>
</li>
<li
className={`nav-item ${(active === 'ratios') ? 'active' : ''}`}
role="presentation"
>
<Link to={ROUTES_COMPLIANCE.RATIOS}>Compliance Ratios</Link>
</li>

</ul>
);
};

ComplianceTabs.propTypes = {
active: PropTypes.string.isRequired,
user: CustomPropTypes.user.isRequired,
};

export default ComplianceTabs;
14 changes: 14 additions & 0 deletions frontend/src/app/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ROUTES_CREDIT_REQUESTS from '../routes/CreditRequests';
import ROUTES_ORGANIZATIONS from '../routes/Organizations';
import ROUTES_ROLES from '../routes/Roles';
import ROUTES_VEHICLES from '../routes/Vehicles';
import ROUTES_COMPLIANCE from '../routes/Compliance';

class Navbar extends Component {
constructor(props) {
Expand Down Expand Up @@ -159,6 +160,19 @@ class Navbar extends Component {
<span>Home</span>
</NavLink>
</li>
{CONFIG.FEATURES.COMPLIANCE_REPORT.ENABLED
&& ((!user.isGovernment && user.hasPermission('EDIT_SALES'))
|| (user.isGovernment && user.hasPermission('VIEW_SALES')))
&& (
<li className="nav-item">
<NavLink
activeClassName="active"
to={ROUTES_COMPLIANCE.LDVSALES}
>
<span>Compliance Reporting</span>
</NavLink>
</li>
)}
{CONFIG.FEATURES.MODEL_YEAR_REPORT.ENABLED && (
<li className="nav-item">
<NavLink
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const CONFIG = {
CREDIT_TRANSACTIONS: {
ENABLED: getConfig('credit_transactions.enabled', false),
},
COMPLIANCE_REPORT: {
ENABLED: getConfig('compliance_report.enabled', false),
},
INITIATIVE_AGREEMENTS: {
ENABLED: getConfig('initiative_agreements.enabled', false),
},
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/config/features.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
window.zeva_config = {
'compliance_report.enabled': true,
'credit_transfers.enabled': true,
'credit_transactions.enabled': true,
'initiative_agreements.enabled': false,
Expand Down
30 changes: 24 additions & 6 deletions frontend/src/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import UserEditContainer from '../users/UserEditContainer';
import VehicleDetailsContainer from '../vehicles/VehicleDetailsContainer';
import VehicleEditContainer from '../vehicles/VehicleEditContainer';
import VehicleListContainer from '../vehicles/VehicleListContainer';
import ComplianceReportsContainer from '../compliance/ComplianceReportsContainer';
import ComplianceRatiosContainer from '../compliance/ComplianceRatiosContainer';
import LDVSalesContainer from '../compliance/LDVSalesContainer';

import ErrorHandler from './components/ErrorHandler';
import Loading from './components/Loading';
import StatusInterceptor from './components/StatusInterceptor';
Expand All @@ -41,6 +45,7 @@ import ROUTES_ORGANIZATIONS from './routes/Organizations';
import ROUTES_NOTIFICATIONS from './routes/Notifications';
import ROUTES_USERS from './routes/Users';
import ROUTES_VEHICLES from './routes/Vehicles';
import ROUTES_COMPLIANCE from './routes/Compliance';

class Router extends Component {
constructor(props) {
Expand Down Expand Up @@ -121,6 +126,18 @@ class Router extends Component {
<PageLayout keycloak={keycloak} user={user}>
<ErrorHandler statusCode={statusCode}>
<Switch>
<Route
path={ROUTES_COMPLIANCE.LDVSALES}
render={() => <LDVSalesContainer keycloak={keycloak} user={user} />}
/>
<Route
path={ROUTES_COMPLIANCE.REPORTS}
render={() => <ComplianceReportsContainer keycloak={keycloak} user={user} />}
/>
<Route
path={ROUTES_COMPLIANCE.RATIOS}
render={() => <ComplianceRatiosContainer keycloak={keycloak} user={user} />}
/>
<Route
exact
path={ROUTES_ORGANIZATIONS.MINE_ADD_USER}
Expand Down Expand Up @@ -157,12 +174,12 @@ class Router extends Component {
/>
<Route
path={ROUTES_ORGANIZATIONS.EDIT}
render={() => (typeof user.hasPermission === 'function'&& user.hasPermission('EDIT_ORGANIZATIONS') && user.isGovernment) ?
<VehicleSupplierEditContainer keycloak={keycloak} user={user} /> : (
<Redirect
to={{
path: "/"}}/>
)}
render={() => ((typeof user.hasPermission === 'function' && user.hasPermission('EDIT_ORGANIZATIONS') && user.isGovernment)
? <VehicleSupplierEditContainer keycloak={keycloak} user={user} /> : (
<Redirect
to={{ path: '/' }}
/>
))}
/>
<Route
path={ROUTES_ORGANIZATIONS.DETAILS}
Expand Down Expand Up @@ -271,6 +288,7 @@ class Router extends Component {
path={ROUTES_CREDIT_REQUESTS.LIST}
render={() => <CreditRequestListContainer keycloak={keycloak} user={user} />}
/>

<Route
exact
path="/"
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/app/routes/Compliance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const API_BASE_PATH = '/compliance';

const COMPLIANCE = {
LDVSALES: `${API_BASE_PATH}/ldv-sales`,
REPORTS: `${API_BASE_PATH}/reports`,
RATIOS: `${API_BASE_PATH}/ratios`,
};

export default COMPLIANCE;
20 changes: 20 additions & 0 deletions frontend/src/compliance/ComplianceRatiosContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../app/utilities/props';
import ComplianceTabs from '../app/components/ComplianceTabs';
import ComplianceRatiosDetailsPage from './components/ComplianceRatiosDetailsPage';

const ComplianceRatiosContainer = (props) => {
const { user } = props;
return (
<>
<ComplianceTabs active="ratios" user={user} />
<ComplianceRatiosDetailsPage user={user} />
</>
);
};
ComplianceRatiosContainer.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default ComplianceRatiosContainer;
20 changes: 20 additions & 0 deletions frontend/src/compliance/ComplianceReportsContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../app/utilities/props';
import ComplianceTabs from '../app/components/ComplianceTabs';
import ComplianceReportsDetailsPage from './components/ComplianceReportsDetailsPage';

const ComplianceReportsContainer = (props) => {
const { user } = props;
return (
<>
<ComplianceTabs active="reports" user={user} />
<ComplianceReportsDetailsPage user={user} />
</>
);
};
ComplianceReportsContainer.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default ComplianceReportsContainer;
20 changes: 20 additions & 0 deletions frontend/src/compliance/LDVSalesContainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../app/utilities/props';
import ComplianceTabs from '../app/components/ComplianceTabs';
import LDVSalesDetailsPage from './components/LDVSalesDetailsPage';

const LDVSalesContainer = (props) => {
const { user } = props;
return (
<>
<ComplianceTabs active="sales" />
<LDVSalesDetailsPage user={user} />
</>
);
};
LDVSalesContainer.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default LDVSalesContainer;
20 changes: 20 additions & 0 deletions frontend/src/compliance/components/ComplianceRatiosDetailsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../../app/utilities/props';

const ComplianceRatiosDetailsPage = (props) => {
const { user } = props;
return (
<div id="compliance-ldvsales-details" className="page">
<div className="row mt-3 mb-2">
<div className="col-sm-12">
<h2>Compliance Ratios</h2>
</div>
</div>
</div>
);
};
ComplianceRatiosDetailsPage.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default ComplianceRatiosDetailsPage;
20 changes: 20 additions & 0 deletions frontend/src/compliance/components/ComplianceReportsDetailsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../../app/utilities/props';

const ComplianceReportsDetailsPage = (props) => {
const { user } = props;
return (
<div id="compliance-ldvsales-details" className="page">
<div className="row mt-3 mb-2">
<div className="col-sm-12">
<h2>Model Year Compliance Reports</h2>
</div>
</div>
</div>
);
};
ComplianceReportsDetailsPage.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default ComplianceReportsDetailsPage;
20 changes: 20 additions & 0 deletions frontend/src/compliance/components/LDVSalesDetailsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import CustomPropTypes from '../../app/utilities/props';

const LDVSalesDetailsPage = (props) => {
const { user } = props;
return (
<div id="compliance-ldvsales-details" className="page">
<div className="row mt-3 mb-2">
<div className="col-sm-12">
<h2>Annual LDV Sales</h2>
</div>
</div>
</div>
);
};
LDVSalesDetailsPage.propTypes = {
user: CustomPropTypes.user.isRequired,
};
export default LDVSalesDetailsPage;