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

Replace profile url and name with dashboard #426

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/manage/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async function loginAccept(req, res) {

// Store id token in session
req.session.idToken = result.id_token
return res.redirect(`${APP_URL}/profile`)
return res.redirect(`${APP_URL}/dashboard`)
} catch (error) {
logger.error(error)
return res.status(500).json('Authentication failed')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/auth.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Check protected routes', () => {
'/organizations/1/edit',
'/organizations/1/profile',
'/organizations/create',
'/profile',
'/dashboard',
]

protectedRoutes.forEach((testRoute) => {
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/profile.cy.js → cypress/e2e/dashboard.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const user3teams = generateSequenceArray(TEAMS_COUNT, 2 * TEAMS_COUNT).map(
})
)

describe('Profile page', () => {
describe('Dashboard page', () => {
before(() => {
cy.task('db:reset')
})
Expand All @@ -43,7 +43,7 @@ describe('Profile page', () => {
cy.login(user1)

// Check state when no teams are available
cy.visit('/profile')
cy.visit('/dashboard')
cy.get('[data-cy=my-teams-table]').contains(
'You are not part of a team yet.'
)
Expand Down Expand Up @@ -73,9 +73,9 @@ describe('Profile page', () => {
moderatorId: user3.id,
})

// Log in and visit profile
// Log in and visit dashboard
cy.login(user1)
cy.visit('/profile')
cy.visit('/dashboard')

// Check page and total count
cy.get('[data-cy=my-teams-table-pagination]').contains('Showing 1-10 of 50')
Expand Down
6 changes: 3 additions & 3 deletions src/components/page-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function PageHeader() {
</NavLink>
))}
{isAuthenticated && (
<NavLink href={'/profile'} passHref legacyBehavior>
<NavLink href={'/dashboard'} passHref legacyBehavior>
<Button
as='a'
variant='outline'
Expand Down Expand Up @@ -175,7 +175,7 @@ export default function PageHeader() {
<MenuDivider />

<MenuItem bg='inherit'>
<NavLink href='/profile'>
<NavLink href='/dashboard'>
<span>Dashboard</span>
</NavLink>
</MenuItem>
Expand Down Expand Up @@ -229,7 +229,7 @@ export default function PageHeader() {
))}
{isAuthenticated && (
<ListItem>
<NavLink href={'/profile'}>
<NavLink href={'/dashboard'}>
<span>Dashboard</span>
</NavLink>
</ListItem>
Expand Down
2 changes: 1 addition & 1 deletion src/middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { default } from 'next-auth/middleware'

export const config = {
matcher: ['/clients', '/organizations/:path*', '/profile'],
matcher: ['/clients', '/organizations/:path*', '/dashboard'],
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const VHS = keyframes`
const Links = [
{ url: '/teams', name: 'Explore all teams' },
{ url: '/teams/create', name: 'Create new team' },
{ url: '/profile', name: 'dashboard' },
{ url: '/dashboard', name: 'dashboard' },
]

export default function Home() {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/organizations/[id]/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default class OrgEdit extends Component {
try {
const res = await destroyOrg(id)
if (res.ok) {
Router.push(join(APP_URL, `/profile`))
Router.push(join(APP_URL, `/dashboard`))
} else {
throw new Error('Could not delete team')
throw new Error('Could not delete organization')
}
} catch (e) {
logger.error(e)
Expand Down