-
Notifications
You must be signed in to change notification settings - Fork 42
feat: restructure frontier admin files and add config for the admin folder #1333
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
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e1f225f
feat: add config for admin folder
paanSinghCoder 3c87b33
chore: update various configurations and dependencies across multiple…
paanSinghCoder 54520ae
fix: update admin-ui dist path in Dockerfile.dev
paanSinghCoder 40c8024
Merge branch 'main' into feat/importable-admin-pages
paanSinghCoder 67e0967
fix: add type assertion for style prop
paanSinghCoder 47a2bb8
fix: update admin-ui embed path to include subdirectory
paanSinghCoder d3cc37d
chore: update working directory paths in GitHub workflows to point to…
paanSinghCoder 9d49e21
chore: add admin-ui embed.go to golangci linters configuration
paanSinghCoder 0100450
chore: add Node.js and pnpm setup to GitHub workflows for building ad…
paanSinghCoder 3f6a2e7
chore: remove Node.js and pnpm setup from GitHub workflows as they ar…
paanSinghCoder 4e6435c
chore: update @bufbuild/protobuf dependency to version 2.10.2 and adj…
paanSinghCoder 70fc07d
refactor: reorganize import statements in server.go for better clarit…
paanSinghCoder 0774f0b
chore: rename apps/admin-ui to apps/admin
paanSinghCoder 4bafcb3
chore: update golangci configuration to reflect the new path for admi…
paanSinghCoder 28336bc
fix: remove unnecessary type assertion for style prop in PageHeader c…
paanSinghCoder 8b2651c
Merge branch 'main' into feat/importable-admin-pages
paanSinghCoder 0a58422
Merge branch 'main' into feat/importable-admin-pages
paanSinghCoder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| .PHONY: dist test | ||
|
|
||
| build: dep dist | ||
|
|
||
| dist: | ||
| @pnpm run build | ||
|
|
||
| test: | ||
| @pnpm run test | ||
|
|
||
| dep: | ||
| @pnpm install |
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| package ui | ||
| package adminui | ||
|
|
||
| import ( | ||
| "embed" | ||
| ) | ||
|
|
||
| //go:embed all:dist | ||
| //go:embed all:dist/admin | ||
| var Assets embed.FS |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { useEffect } from 'react'; | ||
| import type { AdminConfig } from '../types'; | ||
|
|
||
| export function AdminPageTitle({ | ||
| title, | ||
| appName, | ||
| config | ||
| }: { | ||
| title?: string; | ||
| appName?: string; | ||
| config?: AdminConfig; | ||
| }) { | ||
| const titleAppName = appName || config?.title || 'Frontier Admin'; | ||
| const fullTitle = title ? `${title} | ${titleAppName}` : titleAppName; | ||
|
|
||
| useEffect(() => { | ||
| document.title = fullTitle; | ||
| return () => { | ||
| document.title = titleAppName; | ||
| }; | ||
| }, [fullTitle, titleAppName]); | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import '@raystack/apsara/style.css'; | ||
|
|
||
| export type { AdminConfig, AdminLoginProps } from './types'; | ||
| export { AdminPageTitle } from './components/PageTitle'; | ||
| export { AdminLogin } from './pages/auth/Login'; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| "use client"; | ||
|
|
||
| import { Box, Flex, Image } from '@raystack/apsara'; | ||
| import { Header } from '../../../react/components/Header'; | ||
| import { MagicLink } from '../../../react/components/onboarding/magiclink'; | ||
| import { AdminPageTitle } from '../../components/PageTitle'; | ||
| import type { AdminLoginProps } from '../../types'; | ||
|
|
||
| export function AdminLogin({ config, logoIcon }: AdminLoginProps) { | ||
| return ( | ||
| <Flex> | ||
| <AdminPageTitle title="Login" config={config} /> | ||
| <Box style={{ width: '100%' }}> | ||
| <Flex | ||
| direction="column" | ||
| justify="center" | ||
| align="center" | ||
| style={{ | ||
| margin: 'auto', | ||
| height: '100vh', | ||
| width: '280px' | ||
| }} | ||
| > | ||
| <Flex direction="column" gap={5} style={{ width: '100%' }}> | ||
| <Header | ||
| logo={ | ||
| config?.logo ? ( | ||
| <Image | ||
| alt="logo" | ||
| src={config.logo} | ||
| width={80} | ||
| height={80} | ||
| style={{ borderRadius: 'var(--rs-space-3)' }} | ||
| /> | ||
| ) : ( | ||
| logoIcon | ||
| ) | ||
| } | ||
| title={`Login to ${config?.title || 'Frontier Admin'}`} | ||
| /> | ||
| <MagicLink open /> | ||
| </Flex> | ||
| </Flex> | ||
| </Box> | ||
| </Flex> | ||
| ); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type React from 'react'; | ||
|
|
||
| export type AdminConfig = { | ||
| title?: string; | ||
| logo?: string; | ||
| }; | ||
|
|
||
| export type AdminLoginProps = { | ||
| config?: AdminConfig; | ||
| logoIcon?: React.ReactNode; | ||
| }; | ||
|
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dummy file just to test the new Admin folder. This will contain the exportable frontier admin files coming from ui folder.