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

Add a tree list for navigation to apps and envs in the sidebar #265 #320

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
35 changes: 0 additions & 35 deletions backend/ee/LICENSE
Original file line number Diff line number Diff line change
@@ -1,36 +1 @@
The Phase Console Enterprise license (the “Enterprise License”)
Copyright © 2023 Phase Security Inc.

With regard to the Phase Software:

This software and associated documentation files (the "Software") may only be
used in production, if you (and any entity that you represent) have agreed to,
and are in compliance with, the Phase Subscription Terms of Service, available
at https://phase.dev/legal/terms, or other
agreement governing the use of the Software, as agreed by you and Phase,
and otherwise have a valid Phase Console Enterprise License for the
correct number of user seats. Subject to the foregoing sentence, you are free to
modify this Software and publish patches to the Software. You agree that Phase
and/or its licensors (as applicable) retain all right, title and interest in and
to all such modifications and/or patches, and all such modifications and/or
patches may only be used, copied, modified, displayed, distributed, or otherwise
exploited with a valid Phase Console Enterprise subscription for the correct number of
user seats. Notwithstanding the foregoing, you may copy and modify
the Software for development and testing purposes, without requiring a
subscription. You agree that Phase and/or its licensors (as applicable) retain
all right, title and interest in and to all such modifications. You are not
granted any other rights beyond what is expressly stated herein. Subject to the
foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
and/or sell the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

For all third party components incorporated into the Phase Software, those
components are licensed under the original license provided by the owner of the
applicable component.
31 changes: 23 additions & 8 deletions frontend/app/[team]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,35 @@ import Sidebar from '@/components/layout/Sidebar'
import { organisationContext } from '@/contexts/organisationContext'
import clsx from 'clsx'
import { usePathname, useRouter } from 'next/navigation'
import { useContext, useEffect } from 'react'

import { useContext, useEffect,useState } from 'react'
//Importing utilities for tree sidebar
import { useQuery } from '@apollo/client'
import { GetApps } from '@/graphql/queries/getApps.gql'
import { AppType } from '@/apollo/graphql'
import loading from '../loading'
import UnlockKeyringDialog from '@/components/auth/UnlockKeyringDialog'

export default function RootLayout({
children,
params,
}: {
children: React.ReactNode
params: { team: string }
}) {
const { activeOrganisation, setActiveOrganisation, organisations, loading } =
params: { team: string, app:string }
}) {

//Fetching app data
const { activeOrganisation, setActiveOrganisation, organisations } =
useContext(organisationContext)
const { activeOrganisation: organisation } = useContext(organisationContext)
const { data } = useQuery(GetApps, {
variables: {
organisationId: organisation?.id,
},
skip: !organisation,
})

const apps = data?.apps as AppType[]


const router = useRouter()

Expand All @@ -44,7 +60,6 @@ export default function RootLayout({
const path = usePathname()

const showNav = !path?.split('/').includes('recovery')

return (
<div
className={clsx(
Expand All @@ -54,8 +69,8 @@ export default function RootLayout({
>
{activeOrganisation && <UnlockKeyringDialog organisation={activeOrganisation} />}
{showNav && <NavBar team={params.team} />}
{showNav && <Sidebar />}
{showNav && <Sidebar apps={apps} key={apps?.length} />} {/*Sending app data*/}
<div className={clsx('min-h-screen overflow-auto', showNav && 'pt-16')}>{children}</div>
</div>
)
}
}
Loading