Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- 'scripts/**'
- 'third-party/**'
- 'toolchains/**'
- 'workflows/web-test*'

name: Base GitHub Action for Check, Test and Lints

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/web-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test Web UI
on:
pull_request_target:
pull_request:
push:
branches:
- main
Expand All @@ -9,7 +9,7 @@ on:
- 'moon/**'

env:
TIPTAP_PRIVATE_REGISTRY_KEY: ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }}
TIPTAP_PRIVATE_REGISTRY_KEY: CjqFil0n7z4GGur+RPric21fBBeSB4R4FoNdRYOE1bQEz6AXLCoANCc+o9rLIg6Q

jobs:
test-web-ui:
Expand All @@ -20,7 +20,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0
# ref: ${{ github.event.pull_request.base.ref }}

- uses: actions/setup-node@v4
with:
Expand All @@ -45,11 +46,12 @@ jobs:
${{ runner.os }}-pnpm-store-

- run: pnpm config set "@tiptap-pro:registry" https://registry.tiptap.dev/
- run: pnpm config set "//registry.tiptap.dev/:_authToken" ${{ secrets.TIPTAP_PRIVATE_REGISTRY_KEY }}
- run: pnpm config set "//registry.tiptap.dev/:_authToken" ${{ env.TIPTAP_PRIVATE_REGISTRY_KEY }}
- run: pnpm -v

- name: Install dependencies
working-directory: ./moon
run: pnpm i --frozen-lockfile
run: pnpm i --no-frozen-lockfile

- name: Run ESLint
working-directory: ./moon
Expand Down
1 change: 0 additions & 1 deletion moon/apps/web/components/CommandMenu/LocalCommandMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
cn,
CodeIcon,
Command,
ComponentIcon, //test目录
desktopJoinCall,
DismissibleLayer,
GearIcon,
Expand Down
1 change: 0 additions & 1 deletion moon/apps/web/components/Sidebar/SidebarTest.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState } from 'react'
import router from 'next/router'

import { SidebarLink } from './SidebarLink'
Expand Down
21 changes: 5 additions & 16 deletions moon/apps/web/components/TestView/CodeTabe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
FolderIcon,
DocumentIcon,
} from '@heroicons/react/20/solid'
import { ReactElement, JSXElementConstructor, ReactNode, ReactPortal, AwaitedReactNode } from 'react'

export interface DataType {
oid: string;
Expand All @@ -29,7 +28,7 @@ const CodeTable = ({ directory, readmeContent}:any) => {
title: 'Name',
dataIndex: ['name', 'content_type'],
key: 'name',
render: (_: any, record: { content_type: string; name: string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | null | undefined }) => {
render: (_, record) => {
return <>
<Space>
{record.content_type === "directory" && <FolderIcon className="size-6" />}
Expand All @@ -43,20 +42,20 @@ const CodeTable = ({ directory, readmeContent}:any) => {
title: 'Message',
dataIndex: 'message',
key: 'message',
render: (text:string) => <a>{text}</a>,
render: (text) => <a>{text}</a>,
},
{
title: 'Date',
dataIndex: 'date',
key: 'date',
render: (_:any, { date }:any) => (
render: (_, { date }) => (
<>
{date && formatDistance(fromUnixTime(date), new Date(), { addSuffix: true })}
</>
)
}
];
const handleRowClick = (record: { content_type: string; name: any }) => {
const handleRowClick = (record: DataType) => {
if (record.content_type === "file") {
const newPath = `/blob/${real_path}/${record.name}`;

Expand All @@ -75,23 +74,13 @@ const CodeTable = ({ directory, readmeContent}:any) => {
}
}

const handleGoBack = () => {
const safePath = real_path?.split('/');

if (safePath?.length == 1) {
router.push('/')
} else {
router.push(`/tree/${safePath?.slice(0, -1).join('/')}`);
}
};

return (
<div>
<Table style={{ clear: "none" }} rowClassName={styles.dirShowTr}
pagination={false} columns={columns}
dataSource={directory}
rowKey="name"
onRow={(record: { content_type: string; name: any }) => {
onRow={(record) => {
return {
onClick: () => { handleRowClick(record) }
};
Expand Down
4 changes: 2 additions & 2 deletions moon/apps/web/components/TestView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function TestView() {

setReadmeContent(readmeContent);
} catch (error) {
console.error('Error fetching data:', error);
// console.error('Error fetching data:', error);
}
};

Expand All @@ -38,7 +38,7 @@ async function getDirectory(pathname: string) {
return directory
}

async function getReadmeContent(pathname:string, directory:Array) {
async function getReadmeContent(pathname:string, directory: any) {
let readmeContent = '';

for (const project of directory || []) {
Expand Down
6 changes: 3 additions & 3 deletions moon/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@gitmono/editor": "workspace:*",
"@gitmono/regex": "workspace:*",
"@gitmono/ui": "workspace:*",
"@heroicons/react": "^2.2.0",
"@heroicons/react": "catalog:",
"@hocuspocus/provider": "catalog:",
"@hookform/resolvers": "catalog:",
"@next/bundle-analyzer": "catalog:",
Expand All @@ -49,15 +49,15 @@
"@todesktop/client-core": "catalog:",
"@vercel/og": "catalog:",
"@vercel/speed-insights": "catalog:",
"antd": "^5.25.1",
"antd": "catalog:",
"cookies-next": "catalog:",
"d3-selection": "catalog:",
"d3-zoom": "catalog:",
"date-fns": "catalog:",
"deepmerge": "catalog:",
"fast-deep-equal": "catalog:",
"framer-motion": "catalog:",
"github-markdown-css": "^5.8.1",
"github-markdown-css": "catalog:",
"gray-matter": "catalog:",
"jotai": "catalog:",
"jotai-scope": "catalog:",
Expand Down
2 changes: 0 additions & 2 deletions moon/apps/web/pages/[org]/test/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import Head from 'next/head'
import { useRouter } from 'next/router'

import { AppLayout } from '@/components/Layout/AppLayout'
import { AuthAppProviders } from '@/components/Providers/AuthAppProviders'
import { PageWithLayout } from '@/utils/types'
import TestView from '@/components/TestView'

const OrganizationTestPage: PageWithLayout<any> = () => {
const router = useRouter()

return (
<>
Expand Down
53 changes: 49 additions & 4 deletions moon/packages/types/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3033,6 +3033,22 @@ export type FigmaKeyPair = {
write_key: string
}

export type CommonResultVecTreeBriefItem = {
data?: {
content_type: string
name: string
path: string
}[]
err_message: string
req_result: boolean
}

export type TreeBriefItem = {
content_type: string
name: string
path: string
}

export type PostActivityViewsData = UserNotificationCounts

export type GetAttachmentsCommentersData = OrganizationMember[]
Expand Down Expand Up @@ -4166,6 +4182,13 @@ export type PostThreadsV2Data = V2MessageThread

export type PostSignInFigmaData = FigmaKeyPair

export type GetApiTreeParams = {
refs?: string
path?: string
}

export type GetApiTreeData = CommonResultVecTreeBriefItem

export type QueryParamsType = Record<string | number, any>
export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>

Expand Down Expand Up @@ -4247,7 +4270,7 @@ export enum ContentType {
}

export class HttpClient<SecurityDataType = unknown> {
public baseUrl: string = 'https://api.gitmono.com'
public baseUrl: string = ''
Comment thread
benjamin-747 marked this conversation as resolved.
private securityData: SecurityDataType | null = null
private securityWorker?: ApiConfig<SecurityDataType>['securityWorker']
private abortControllers = new Map<CancelToken, AbortController>()
Expand Down Expand Up @@ -4445,10 +4468,8 @@ function dataTaggedQueryKey(key: unknown) {
}

/**
* @title Campsite API
* @title Gitmono API
* @version 2.0.0
* @baseUrl https://api.gitmono.com
* @contact <support@gitmono.com>
*/
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
organizations = {
Expand Down Expand Up @@ -12446,4 +12467,28 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
}
}
}
v1 = {
/**
* No description
Comment thread
benjamin-747 marked this conversation as resolved.
*
* @tags crate::api::api_router
* @name GetApiTree
* @request GET:api/v1/tree/
*/
getApiTree: () => {
const base = 'GET:api/v1/tree/' as const

return {
baseKey: dataTaggedQueryKey<GetApiTreeData>([base]),
requestKey: (params: GetApiTreeParams) => dataTaggedQueryKey<GetApiTreeData>([base, params]),
request: (query: GetApiTreeParams, params: RequestParams = {}) =>
this.request<GetApiTreeData>({
path: `api/v1/tree/`,
method: 'GET',
query: query,
...params
})
}
}
}
}
Loading