Skip to content

Commit

Permalink
Bug fixes for the tool shed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Oct 23, 2023
1 parent eecaeb7 commit 36a46f1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 73 deletions.
2 changes: 1 addition & 1 deletion lib/tool_shed/webapp/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"vue-tsc": "^1.0.16"
},
"dependencies": {
"@apollo/client": "^3.7.3",
"@apollo/client": "^3.8.6",
"@quasar/extras": "^1.12.4",
"@vue/apollo-composable": "^4.0.0-beta.1",
"@vue/apollo-option": "^4.0.0-alpha.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import RepositoryCreation from "@/components/RepositoryCreation.vue"
const query = graphql(`
query recentlyCreatedRepositories {
relayRepositories(first: 10, sort: UPDATE_TIME_DESC) {
relayRepositories(first: 10, sort: CREATE_TIME_DESC) {
edges {
node {
...RepositoryCreationItem
Expand Down
26 changes: 2 additions & 24 deletions lib/tool_shed/webapp/frontend/src/components/RepositoriesGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ const columns = computed(() => {
const tableLoading = ref(false)
async function onScroll(details: ScrollDetails) {
console.log(details)
async function handleScroll(details: ScrollDetails) {
const { to, direction } = details
if (direction == "decrease") {
return
Expand Down Expand Up @@ -95,7 +94,7 @@ const adaptedRows = computed(() =>
:pagination="pagination"
:rows-per-page-options="[0]"
:no-data-label="noDataLabel"
@virtual-scroll="onScroll"
@virtual-scroll="handleScroll"
hide-header
hide-bottom
>
Expand All @@ -122,27 +121,6 @@ const adaptedRows = computed(() =>
</q-tr>
</template>
</q-table>
<!--
<q-table
v-if="loading || rows.length > 0"
style="height: 90vh"
:title="title"
:rows="rows"
:columns="columns"
:loading="tableLoading"
row-key="index"
virtual-scroll
:virtual-scroll-item-size="48"
:virtual-scroll-sticky-size-start="48"
:pagination="pagination"
:rows-per-page-options="[0]"
:no-data-label="noDataLabel"
@virtual-scroll="onScroll"
hide-header
hide-bottom
>
</q-table>
-->
<q-banner rounded class="bg-warning text-white" v-else>
<!-- the no-data-label doesn't seem to be working,
probably because we're overriding the whole body
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
<script setup lang="ts">
import UtcDate from "@/components/UtcDate.vue"
import { graphql } from "@/gql"
import { type FragmentType, useFragment } from "@/gql/fragment-masking"
import { goToRepository } from "@/router"
const CreateFragment = graphql(/* GraphQL */ `
fragment RepositoryCreationItem on RelayRepository {
encodedId
name
user {
username
}
createTime
}
`)
import { CreateFragment } from "@/gqlFragements"
const props = defineProps<{
creation: FragmentType<typeof CreateFragment>
Expand Down
22 changes: 11 additions & 11 deletions lib/tool_shed/webapp/frontend/src/gql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/
* Therefore it is highly recommended to use the babel-plugin for production.
*/
const documents = {
"\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: UPDATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n":
"\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: CREATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n":
types.RecentlyCreatedRepositoriesDocument,
"\n query recentRepositoryUpdates {\n relayRepositories(first: 10, sort: UPDATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryUpdateItem\n }\n }\n }\n }\n":
types.RecentRepositoryUpdatesDocument,
"\n query repositoriesByOwner($username: String, $cursor: String) {\n relayRepositoriesForOwner(username: $username, sort: UPDATE_TIME_DESC, first: 10, after: $cursor) {\n edges {\n cursor\n node {\n ...RepositoryListItemFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n":
types.RepositoriesByOwnerDocument,
"\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n":
types.RepositoryCreationItemFragmentDoc,
"\n query repositoriesByCategory($categoryId: String, $cursor: String) {\n relayRepositoriesForCategory(encodedId: $categoryId, sort: UPDATE_TIME_DESC, first: 10, after: $cursor) {\n edges {\n cursor\n node {\n ...RepositoryListItemFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n":
types.RepositoriesByCategoryDocument,
"\n fragment RepositoryListItemFragment on RelayRepository {\n encodedId\n name\n user {\n username\n }\n description\n type\n updateTime\n homepageUrl\n remoteRepositoryUrl\n }\n":
types.RepositoryListItemFragmentFragmentDoc,
"\n fragment RepositoryUpdateItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n updateTime\n }\n":
types.RepositoryUpdateItemFragmentDoc,
"\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n":
types.RepositoryCreationItemFragmentDoc,
}

/**
Expand All @@ -47,8 +47,8 @@ export function graphql(source: string): unknown
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: UPDATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n"
): (typeof documents)["\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: UPDATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n"]
source: "\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: CREATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n"
): (typeof documents)["\n query recentlyCreatedRepositories {\n relayRepositories(first: 10, sort: CREATE_TIME_DESC) {\n edges {\n node {\n ...RepositoryCreationItem\n }\n }\n }\n }\n"]
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand All @@ -61,12 +61,6 @@ export function graphql(
export function graphql(
source: "\n query repositoriesByOwner($username: String, $cursor: String) {\n relayRepositoriesForOwner(username: $username, sort: UPDATE_TIME_DESC, first: 10, after: $cursor) {\n edges {\n cursor\n node {\n ...RepositoryListItemFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"
): (typeof documents)["\n query repositoriesByOwner($username: String, $cursor: String) {\n relayRepositoriesForOwner(username: $username, sort: UPDATE_TIME_DESC, first: 10, after: $cursor) {\n edges {\n cursor\n node {\n ...RepositoryListItemFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n"]
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n"
): (typeof documents)["\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n"]
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand All @@ -85,6 +79,12 @@ export function graphql(
export function graphql(
source: "\n fragment RepositoryUpdateItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n updateTime\n }\n"
): (typeof documents)["\n fragment RepositoryUpdateItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n updateTime\n }\n"]
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n"
): (typeof documents)["\n fragment RepositoryCreationItem on RelayRepository {\n encodedId\n name\n user {\n username\n }\n createTime\n }\n"]

export function graphql(source: string) {
return (documents as any)[source] ?? {}
Expand Down
48 changes: 24 additions & 24 deletions lib/tool_shed/webapp/frontend/src/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,6 @@ export type RepositoriesByOwnerQuery = {
} | null
}

export type RepositoryCreationItemFragment = {
__typename?: "RelayRepository"
encodedId: string
name: string
createTime?: any | null
user: { __typename?: "SimpleUser"; username: string }
} & { " $fragmentName"?: "RepositoryCreationItemFragment" }

export type RepositoriesByCategoryQueryVariables = Exact<{
categoryId?: InputMaybe<Scalars["String"]>
cursor?: InputMaybe<Scalars["String"]>
Expand Down Expand Up @@ -433,12 +425,20 @@ export type RepositoryUpdateItemFragment = {
user: { __typename?: "SimpleUser"; username: string }
} & { " $fragmentName"?: "RepositoryUpdateItemFragment" }

export const RepositoryCreationItemFragmentDoc = {
export type RepositoryCreationItemFragment = {
__typename?: "RelayRepository"
encodedId: string
name: string
createTime?: any | null
user: { __typename?: "SimpleUser"; username: string }
} & { " $fragmentName"?: "RepositoryCreationItemFragment" }

export const RepositoryListItemFragmentFragmentDoc = {
kind: "Document",
definitions: [
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "RepositoryCreationItem" },
name: { kind: "Name", value: "RepositoryListItemFragment" },
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "RelayRepository" } },
selectionSet: {
kind: "SelectionSet",
Expand All @@ -453,18 +453,22 @@ export const RepositoryCreationItemFragmentDoc = {
selections: [{ kind: "Field", name: { kind: "Name", value: "username" } }],
},
},
{ kind: "Field", name: { kind: "Name", value: "createTime" } },
{ kind: "Field", name: { kind: "Name", value: "description" } },
{ kind: "Field", name: { kind: "Name", value: "type" } },
{ kind: "Field", name: { kind: "Name", value: "updateTime" } },
{ kind: "Field", name: { kind: "Name", value: "homepageUrl" } },
{ kind: "Field", name: { kind: "Name", value: "remoteRepositoryUrl" } },
],
},
},
],
} as unknown as DocumentNode<RepositoryCreationItemFragment, unknown>
export const RepositoryListItemFragmentFragmentDoc = {
} as unknown as DocumentNode<RepositoryListItemFragmentFragment, unknown>
export const RepositoryUpdateItemFragmentDoc = {
kind: "Document",
definitions: [
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "RepositoryListItemFragment" },
name: { kind: "Name", value: "RepositoryUpdateItem" },
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "RelayRepository" } },
selectionSet: {
kind: "SelectionSet",
Expand All @@ -479,22 +483,18 @@ export const RepositoryListItemFragmentFragmentDoc = {
selections: [{ kind: "Field", name: { kind: "Name", value: "username" } }],
},
},
{ kind: "Field", name: { kind: "Name", value: "description" } },
{ kind: "Field", name: { kind: "Name", value: "type" } },
{ kind: "Field", name: { kind: "Name", value: "updateTime" } },
{ kind: "Field", name: { kind: "Name", value: "homepageUrl" } },
{ kind: "Field", name: { kind: "Name", value: "remoteRepositoryUrl" } },
],
},
},
],
} as unknown as DocumentNode<RepositoryListItemFragmentFragment, unknown>
export const RepositoryUpdateItemFragmentDoc = {
} as unknown as DocumentNode<RepositoryUpdateItemFragment, unknown>
export const RepositoryCreationItemFragmentDoc = {
kind: "Document",
definitions: [
{
kind: "FragmentDefinition",
name: { kind: "Name", value: "RepositoryUpdateItem" },
name: { kind: "Name", value: "RepositoryCreationItem" },
typeCondition: { kind: "NamedType", name: { kind: "Name", value: "RelayRepository" } },
selectionSet: {
kind: "SelectionSet",
Expand All @@ -509,12 +509,12 @@ export const RepositoryUpdateItemFragmentDoc = {
selections: [{ kind: "Field", name: { kind: "Name", value: "username" } }],
},
},
{ kind: "Field", name: { kind: "Name", value: "updateTime" } },
{ kind: "Field", name: { kind: "Name", value: "createTime" } },
],
},
},
],
} as unknown as DocumentNode<RepositoryUpdateItemFragment, unknown>
} as unknown as DocumentNode<RepositoryCreationItemFragment, unknown>
export const RecentlyCreatedRepositoriesDocument = {
kind: "Document",
definitions: [
Expand All @@ -537,7 +537,7 @@ export const RecentlyCreatedRepositoriesDocument = {
{
kind: "Argument",
name: { kind: "Name", value: "sort" },
value: { kind: "EnumValue", value: "UPDATE_TIME_DESC" },
value: { kind: "EnumValue", value: "CREATE_TIME_DESC" },
},
],
selectionSet: {
Expand Down
11 changes: 11 additions & 0 deletions lib/tool_shed/webapp/frontend/src/gqlFragements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ export const UpdateFragment = graphql(/* GraphQL */ `
updateTime
}
`)

export const CreateFragment = graphql(/* GraphQL */ `
fragment RepositoryCreationItem on RelayRepository {
encodedId
name
user {
username
}
createTime
}
`)

0 comments on commit 36a46f1

Please sign in to comment.