Skip to content

Commit

Permalink
Merge pull request galaxyproject#16894 from jmchilton/ts_bug
Browse files Browse the repository at this point in the history
Fix "Latest Updates" order in tool shed 2.0
  • Loading branch information
mvdbeek authored Aug 16, 2024
2 parents 64bd95d + 2a5f9d5 commit 19fa41c
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 50 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 @@ -38,7 +38,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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const columns = computed(() => {
const tableLoading = ref(false)
async function onVirtualScroll(details: ScrollDetails) {
console.log(details)
const { to, direction } = details
if (direction == "decrease") {
return
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 19fa41c

Please sign in to comment.