Skip to content

Commit

Permalink
feat(platform): Add a new secret and added loader on project screen (#…
Browse files Browse the repository at this point in the history
…603)

Co-authored-by: kriptonian1 <[email protected]>
Co-authored-by: rajdip-b <[email protected]>
  • Loading branch information
3 people authored Jan 11, 2025
1 parent 4b2b675 commit c3a08cc
Show file tree
Hide file tree
Showing 19 changed files with 1,259 additions and 188 deletions.
3 changes: 2 additions & 1 deletion apps/platform/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off'
'@typescript-eslint/no-unsafe-return': 'off',
'no-nested-ternary': 'off'
}
}
1 change: 1 addition & 0 deletions apps/platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.4",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-context-menu": "^2.1.5",
Expand Down
6 changes: 4 additions & 2 deletions apps/platform/public/svg/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import ThreeDotOptionSVG from './3dotOption.svg'
import AddSVG from './add.svg'
import LoadingSVG from './loading.svg'
import MessageSVG from './message.svg'
import VectorSVG from './Vector.svg'
import VectorSVG from './vector.svg'
import ErrorSVG from './Error.svg'
import TrashSVG from './trash.svg'

export {
DropdownSVG,
Expand All @@ -23,5 +24,6 @@ export {
LoadingSVG,
MessageSVG,
VectorSVG,
ErrorSVG
ErrorSVG,
TrashSVG
}
6 changes: 6 additions & 0 deletions apps/platform/public/svg/shared/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
10 changes: 9 additions & 1 deletion apps/platform/src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ import {
} from '@/components/ui/dialog'
import ControllerInstance from '@/lib/controller-instance'
import { Textarea } from '@/components/ui/textarea'
import ProjectScreenLoader from '@/components/ui/project-screen-loader'

export default function Index(): JSX.Element {
const [isSheetOpen, setIsSheetOpen] = useState<boolean>(false)
const [isProjectEmpty, setIsProjectEmpty] = useState<boolean>(true)
const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false)
const [loading, setLoading] = useState<boolean>(false)

// Projects to be displayed in the dashboard
const [projects, setProjects] = useState<ProjectWithCount[]>([])
Expand Down Expand Up @@ -78,6 +80,8 @@ export default function Index(): JSX.Element {
// under that workspace and display it in the dashboard.
useEffect(() => {
async function getAllProjects() {
setLoading(true)

if (currentWorkspace) {
const { success, error, data } =
await ControllerInstance.getInstance().projectController.getAllProjects(
Expand All @@ -92,6 +96,8 @@ export default function Index(): JSX.Element {
console.error(error)
}
}

setLoading(false)
}

getAllProjects()
Expand Down Expand Up @@ -326,7 +332,9 @@ export default function Index(): JSX.Element {
</Dialog>
</div>

{!isProjectEmpty ? (
{loading ? (
<ProjectScreenLoader />
) : !isProjectEmpty ? (
<div className="grid grid-cols-1 gap-5 overflow-y-scroll scroll-smooth p-2 md:grid-cols-2 xl:grid-cols-3">
{projects.map((project: GetAllProjectsResponse['items'][number]) => {
return (
Expand Down
Loading

0 comments on commit c3a08cc

Please sign in to comment.