Skip to content

Commit

Permalink
feat: /reporter/user-dashboard --> /reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscooke committed Jun 9, 2020
1 parent 8addcca commit e2690cd
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const HeaderLayout = ({
<Row>
{isIndustry ? (
<Col>
<Link href="/reporter/user-dashboard">
<Link href="/reporter">
<Button variant="outline-light">Industry</Button>
</Link>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion app/components/Layout/Subheader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Subheader = () => (
<li className="active">
<Link
href={{
pathname: '/reporter/user-dashboard'
pathname: '/reporter'
}}
>
<a>My Dashboard</a>
Expand Down
2 changes: 1 addition & 1 deletion app/containers/Forms/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export const FormComponent: React.FunctionComponent<Props> = ({
<Col md={3} style={{lineHeight: '48px'}}>
<Link
href={{
pathname: '/reporter/user-dashboard'
pathname: '/reporter'
}}
>
Save &amp; Exit
Expand Down
2 changes: 1 addition & 1 deletion app/cypress/integration/page-access.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('When logged in as a reporter', () => {
it('The index page redirects to the reporter dashboard', () => {
cy.visit('/');
cy.get('#page-content');
cy.url().should('include', '/reporter/user-dashboard');
cy.url().should('include', '/reporter');
});
});

Expand Down
10 changes: 5 additions & 5 deletions app/cypress/integration/reporter-access-all-pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ describe('When logged in as a reporter', () => {
});

it('The reporter should be able to load all pages within their access scope', () => {
cy.visit('/reporter/user-dashboard');
cy.url().should('include', '/reporter/user-dashboard');
cy.visit('/reporter');
cy.url().should('include', '/reporter');
cy.get('tr');
cy.contains('View Facilities').click();
cy.url().should('include', '/reporter/facilities-list');
Expand Down Expand Up @@ -42,8 +42,8 @@ describe('When logged in as a reporter', () => {
cy.get('.admin');
cy.get('input').click({multiple: true});
cy.get('.btn-success').click();
cy.visit('/reporter/user-dashboard');
cy.url().should('include', '/reporter/user-dashboard');
cy.visit('/reporter');
cy.url().should('include', '/reporter');
cy.get('tr');
cy.contains('View Facilities').click();
cy.url().should('include', '/reporter/facilities-list');
Expand All @@ -56,7 +56,7 @@ describe('When logged in as a reporter', () => {
cy.get('.btn').contains('Submit').click();
cy.url().should('include', '/reporter/complete-submit');
cy.contains('Dashboard').click();
cy.url().should('include', '/reporter/user-dashboard');
cy.url().should('include', '/reporter');
cy.get('tr');
cy.contains('View Facilities').click();
cy.url().should('include', '/reporter/facilities-list');
Expand Down
2 changes: 1 addition & 1 deletion app/cypress/integration/reporter-certifier-access.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('When logged in as a certifier(reporter)', () => {
cy.contains('Legal Disclaimer');
cy.contains('View').click();
cy.url().should('include', '/certifier/certify');
cy.visit('/reporter/user-dashboard');
cy.visit('/reporter');
cy.get('.alert-link').contains('View all certification requests.').click();
cy.url().should('include', '/certifier/requests');
});
Expand Down
2 changes: 1 addition & 1 deletion app/data/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"User": {
"pgRole": "ciip_industry_user",
"priority": 10,
"path": "/reporter/user-dashboard"
"path": "/reporter"
},
"Realm Administrator": {
"pgRole": "ciip_administrator",
Expand Down
2 changes: 1 addition & 1 deletion app/pages/registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Registration extends Component<Props> {
router.push(
router.query.redirectTo
? (router.query.redirectTo as string)
: '/reporter/user-dashboard'
: '/reporter'
)
}
/>
Expand Down
2 changes: 1 addition & 1 deletion app/pages/reporter/complete-submit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CompleteSubmit extends Component<Props> {
>
<Link
href={{
pathname: '/reporter/user-dashboard'
pathname: '/reporter'
}}
>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {Col, Row, ListGroup} from 'react-bootstrap';
import {graphql} from 'react-relay';
import {NextRouter} from 'next/router';
import {userDashboardQueryResponse} from 'userDashboardQuery.graphql';
import {reporterQueryResponse} from 'reporterQuery.graphql';
import Organisations from 'containers/Organisations/Organisations';
import DefaultLayout from 'layouts/default-layout';
import {createUserOrganisationMutation} from 'mutations/user_organisation/createUserOrganisation';
Expand All @@ -12,12 +12,12 @@ const ALLOWED_GROUPS = [USER];

interface Props {
router: NextRouter;
query: userDashboardQueryResponse['query'];
query: reporterQueryResponse['query'];
}

export default class UserDashBoard extends Component<Props> {
export default class Reporter extends Component<Props> {
static query = graphql`
query userDashboardQuery {
query reporterQuery {
query {
...Organisations_query
session {
Expand Down
4 changes: 2 additions & 2 deletions app/stories/Pages.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import CiipApplicationSWRSImport from 'pages/reporter/ciip-application-swrs-impo
// import OrganisationRequests from 'pages/analyst/organisation-requests';
// import ProductsBenchmarks from 'pages/admin/products-benchmarks';
import Registration from 'pages/registration';
import UserDashboard from 'pages/reporter/user-dashboard';
import Reporter from 'pages/reporter/index';
import UserList from 'pages/admin/user-list';
// Import UserOrganisationFacilities from 'pages/user-organisation-facilities';
import UserProfile from 'pages/user-profile';
Expand Down Expand Up @@ -63,6 +63,6 @@ export const admin = () => render(Admin);
export const ciip_application_swrs_import = () =>
render(CiipApplicationSWRSImport);
export const registration = () => render(Registration);
export const user_dashboard = () => render(UserDashboard);
export const user_dashboard = () => render(Reporter);
export const user_list = () => render(UserList);
export const user_profile = () => render(UserProfile);
8 changes: 4 additions & 4 deletions app/tests/integration/Forms/__snapshots__/Form.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ exports[`Form should match the snapshot with the administration form 1`] = `
}
>
<a
href="/reporter/user-dashboard"
href="/reporter"
onClick={[Function]}
onMouseEnter={[Function]}
>
Expand Down Expand Up @@ -1315,7 +1315,7 @@ exports[`Form should match the snapshot with the emission form 1`] = `
}
>
<a
href="/reporter/user-dashboard"
href="/reporter"
onClick={[Function]}
onMouseEnter={[Function]}
>
Expand Down Expand Up @@ -1737,7 +1737,7 @@ exports[`Form should match the snapshot with the fuel form 1`] = `
}
>
<a
href="/reporter/user-dashboard"
href="/reporter"
onClick={[Function]}
onMouseEnter={[Function]}
>
Expand Down Expand Up @@ -2115,7 +2115,7 @@ exports[`Form should match the snapshot with the production form 1`] = `
}
>
<a
href="/reporter/user-dashboard"
href="/reporter"
onClick={[Function]}
onMouseEnter={[Function]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ Array [
>
<a
className="jsx-1103754433"
href="/reporter/user-dashboard"
href="/reporter"
onClick={[Function]}
onMouseEnter={[Function]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`It matches the last accepted Snapshot 1`] = `
>
<a
class="jsx-1103754433"
href="/reporter/user-dashboard"
href="/reporter"
>
My Dashboard
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ exports[`The Form Component should match the snapshot 1`] = `
<Link
href={
Object {
"pathname": "/reporter/user-dashboard",
"pathname": "/reporter",
}
}
>
Expand Down Expand Up @@ -709,7 +709,7 @@ exports[`The Form Component should not render an alert reminder to check the gui
<Link
href={
Object {
"pathname": "/reporter/user-dashboard",
"pathname": "/reporter",
}
}
>
Expand Down Expand Up @@ -1353,7 +1353,7 @@ exports[`The Form Component should render alert reminder to check the guidance i
<Link
href={
Object {
"pathname": "/reporter/user-dashboard",
"pathname": "/reporter",
}
}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {shallow} from 'enzyme';
import UserDashboard from 'pages/reporter/user-dashboard';
import {userDashboardQueryResponse} from 'userDashboardQuery.graphql';
import Reporter from 'pages/reporter/index';
import {reporterQueryResponse} from 'reporterQuery.graphql';

const query = {
session: {
Expand All @@ -19,7 +19,7 @@ const query = {
}
};

const queryWithCertRequests: userDashboardQueryResponse['query'] = {
const queryWithCertRequests: reporterQueryResponse['query'] = {
session: {
ciipUserBySub: {
id: 'ciip-reporter@mailinator.com',
Expand All @@ -37,15 +37,15 @@ const queryWithCertRequests: userDashboardQueryResponse['query'] = {

describe('Reporter Dashboard', () => {
it('Reporter with no certification requests', () => {
const wrapper = shallow(<UserDashboard router={null} query={query} />);
const wrapper = shallow(<Reporter router={null} query={query} />);
expect(wrapper).toMatchSnapshot();
expect(
wrapper.find('Relay(OrganisationsComponent)').prop('flagCertRequests')
).toBe(false);
});
it('Reporter with certification requests', () => {
const wrapper = shallow(
<UserDashboard router={null} query={queryWithCertRequests} />
<Reporter router={null} query={queryWithCertRequests} />
);
expect(wrapper).toMatchSnapshot();
expect(
Expand Down

0 comments on commit e2690cd

Please sign in to comment.