Skip to content

Commit

Permalink
display github repo url
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 30, 2024
1 parent 1b7fccd commit 3d6ca1f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 9 deletions.
12 changes: 12 additions & 0 deletions webui/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "repositoryUrl",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "speed",
"description": null,
Expand Down
26 changes: 25 additions & 1 deletion webui/src/Containers/Home/MainContent/MainContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Separator,
GithubUserName,
Archive,
LinkGithubRepo,
} from "./styles";
import { Account, Project } from "../../../Hooks/GraphQL";
import { Link } from "react-router-dom";
Expand All @@ -23,6 +24,7 @@ import _ from "lodash";
import { Github, Calendar } from "@styled-icons/bootstrap";
import { Buildings } from "@styled-icons/boxicons-regular";
import { LockClosed } from "@styled-icons/ionicons-outline";
import { GithubOutline } from "@styled-icons/evaicons-outline";
import dayjs from "dayjs";
import Loader from "./Loader";

Expand Down Expand Up @@ -116,9 +118,31 @@ const MainContent: FC<MainContentProps> = (props) => {
{item.archived === true && <Archive>Archive</Archive>}
</Row>
{item.path !== "empty" && !!item.path && (
<Path>{item.path}</Path>
<Path
style={{
marginBottom: item.repositoryUrl ? 0 : 10,
}}
>
{item.path}
</Path>
)}
</Link>

{item.repositoryUrl && (
<div>
<GithubOutline
size={18}
color={"#fff"}
style={{ marginRight: 10 }}
/>
<LinkGithubRepo href={item.repositoryUrl!}>
{item.repositoryUrl.replace(
"https://github.com/",
""
)}
</LinkGithubRepo>
</div>
)}
<div>
{item.tags
?.filter((x) => x)
Expand Down
8 changes: 8 additions & 0 deletions webui/src/Containers/Home/MainContent/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ export const GithubUserName = styled.div`
margin-left: 5px;
`;

export const LinkGithubRepo = styled.a`
font-family: monospace;
color: #fff;
&:hover {
text-decoration: underline;
}
`;

export default {
Tab: {
Tab: {
Expand Down
1 change: 1 addition & 0 deletions webui/src/GraphQL/Fragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const ProjectFragment = gql`
isPrivate
owner
archived
repositoryUrl
}
${RunFragment}
`;
Expand Down
18 changes: 10 additions & 8 deletions webui/src/Hooks/GraphQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export type Project = {
picture: Scalars['String'];
recentRuns?: Maybe<Array<Run>>;
reliability?: Maybe<Scalars['Float']>;
repositoryUrl?: Maybe<Scalars['String']>;
speed?: Maybe<Scalars['Float']>;
tags?: Maybe<Array<Scalars['String']>>;
};
Expand Down Expand Up @@ -498,7 +499,7 @@ export type ExportActionsQuery = { __typename?: 'Query', exportActions: string }

export type RunFragmentFragment = { __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> };

export type ProjectFragmentFragment = { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null };
export type ProjectFragmentFragment = { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null };

export type LogFragmentFragment = { __typename?: 'Log', id: string, message: string, createdAt: string };

Expand Down Expand Up @@ -575,7 +576,7 @@ export type CreateProjectMutationVariables = Exact<{
}>;


export type CreateProjectMutation = { __typename?: 'Mutation', createProject: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } };
export type CreateProjectMutation = { __typename?: 'Mutation', createProject: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } };

export type UpdateProjectMutationVariables = Exact<{
id: Scalars['ID'];
Expand All @@ -585,7 +586,7 @@ export type UpdateProjectMutationVariables = Exact<{
}>;


export type UpdateProjectMutation = { __typename?: 'Mutation', updateProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };
export type UpdateProjectMutation = { __typename?: 'Mutation', updateProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };

export type DeleteProjectMutationVariables = Exact<{
id: Scalars['ID'];
Expand All @@ -599,22 +600,22 @@ export type ArchiveProjectMutationVariables = Exact<{
}>;


export type ArchiveProjectMutation = { __typename?: 'Mutation', archiveProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };
export type ArchiveProjectMutation = { __typename?: 'Mutation', archiveProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };

export type UnarchiveProjectMutationVariables = Exact<{
id: Scalars['ID'];
}>;


export type UnarchiveProjectMutation = { __typename?: 'Mutation', unarchiveProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };
export type UnarchiveProjectMutation = { __typename?: 'Mutation', unarchiveProject?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };

export type ChangeProjectVisibilityMutationVariables = Exact<{
id: Scalars['ID'];
isPublic: Scalars['Boolean'];
}>;


export type ChangeProjectVisibilityMutation = { __typename?: 'Mutation', changeProjectVisibility?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };
export type ChangeProjectVisibilityMutation = { __typename?: 'Mutation', changeProjectVisibility?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };

export type GetProjectsQueryVariables = Exact<{
cursor?: InputMaybe<Scalars['String']>;
Expand All @@ -625,14 +626,14 @@ export type GetProjectsQueryVariables = Exact<{
}>;


export type GetProjectsQuery = { __typename?: 'Query', projects: Array<{ __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null }> };
export type GetProjectsQuery = { __typename?: 'Query', projects: Array<{ __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null }> };

export type GetProjectQueryVariables = Exact<{
id: Scalars['ID'];
}>;


export type GetProjectQuery = { __typename?: 'Query', project?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };
export type GetProjectQuery = { __typename?: 'Query', project?: { __typename?: 'Project', id: string, name: string, displayName?: string | null, description?: string | null, tags?: Array<string> | null, path?: string | null, createdAt: string, picture: string, speed?: number | null, reliability?: number | null, buildsPerWeek?: number | null, isPrivate?: boolean | null, owner?: string | null, archived?: boolean | null, repositoryUrl?: string | null, recentRuns?: Array<{ __typename?: 'Run', id: string, branch?: string | null, commit?: string | null, date: string, project: string, projectId: string, duration?: number | null, message?: string | null, name: string, title: string, cursor?: string | null, status?: string | null, jobs: Array<{ __typename?: 'Job', id: string, name: string, createdAt: string, status: string, duration?: number | null }> }> | null } | null };

export type CountProjectsQueryVariables = Exact<{ [key: string]: never; }>;

Expand Down Expand Up @@ -749,6 +750,7 @@ export const ProjectFragmentFragmentDoc = gql`
isPrivate
owner
archived
repositoryUrl
}
${RunFragmentFragmentDoc}`;
export const LogFragmentFragmentDoc = gql`
Expand Down

0 comments on commit 3d6ca1f

Please sign in to comment.