Skip to content

Release 0.25.0 #1824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
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
14 changes: 14 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Release Notes
=============

Version 0.25.0
--------------

- Mechanism to sync server prefetch with client API calls (#1798)
- show more button for v2 drawer dates (#1809)
- Add data-ph- elements to CTA buttons (#1821)
- Endpoints for userlist/learningpath memberships (#1808)
- Clear resource_type filter when leaving Learning Materials search tab (#1780)
- Update opensearchproject/opensearch Docker tag to v2.18.0 (#1812)
- Update dependency postcss-styled-syntax to ^0.7.0 (#1811)
- Update dependency ruff to v0.7.3 (#1810)
- Update dependency @chromatic-com/storybook to v3 (#1764)
- learning resource drawer v2 run comparison table (#1782)

Version 0.24.3 (Released November 14, 2024)
--------------

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.opensearch.base.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
opensearch:
image: opensearchproject/opensearch:2.17.1
image: opensearchproject/opensearch:2.18.0
environment:
- "cluster.name=opensearch-cluster"
- "bootstrap.memory_lock=true" # along with the memlock settings below, disables swapping
Expand Down
1 change: 1 addition & 0 deletions frontends/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"./v1": "./src/generated/v1/api.ts",
"./hooks/*": "./src/hooks/*/index.ts",
"./constants": "./src/common/constants.ts",
"./ssr/*": "./src/ssr/*.ts",
"./test-utils/factories": "./src/test-utils/factories/index.ts",
"./test-utils": "./src/test-utils/index.ts"
},
Expand Down
186 changes: 186 additions & 0 deletions frontends/api/src/generated/v1/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18233,6 +18233,45 @@ export const LearningpathsApiAxiosParamCreator = function (
options: localVarRequestOptions,
}
},
/**
* Get a list of all learning path items
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
learningpathsMembershipList: async (
options: RawAxiosRequestConfig = {},
): Promise<RequestArgs> => {
const localVarPath = `/api/v1/learningpaths/membership/`
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
let baseOptions
if (configuration) {
baseOptions = configuration.baseOptions
}

const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
}
const localVarHeaderParameter = {} as any
const localVarQueryParameter = {} as any

setSearchParams(localVarUrlObj, localVarQueryParameter)
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {}
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
}

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
}
},
/**
* Update individual fields of a learning path
* @summary Update
Expand Down Expand Up @@ -18672,6 +18711,35 @@ export const LearningpathsApiFp = function (configuration?: Configuration) {
configuration,
)(axios, operationBasePath || basePath)
},
/**
* Get a list of all learning path items
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async learningpathsMembershipList(
options?: RawAxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<Array<MicroLearningPathRelationship>>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.learningpathsMembershipList(options)
const index = configuration?.serverIndex ?? 0
const operationBasePath =
operationServerMap["LearningpathsApi.learningpathsMembershipList"]?.[
index
]?.url
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
)(axios, operationBasePath || basePath)
},
/**
* Update individual fields of a learning path
* @summary Update
Expand Down Expand Up @@ -18917,6 +18985,19 @@ export const LearningpathsApiFactory = function (
)
.then((request) => request(axios, basePath))
},
/**
* Get a list of all learning path items
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
learningpathsMembershipList(
options?: RawAxiosRequestConfig,
): AxiosPromise<Array<MicroLearningPathRelationship>> {
return localVarFp
.learningpathsMembershipList(options)
.then((request) => request(axios, basePath))
},
/**
* Update individual fields of a learning path
* @summary Update
Expand Down Expand Up @@ -19456,6 +19537,19 @@ export class LearningpathsApi extends BaseAPI {
.then((request) => request(this.axios, this.basePath))
}

/**
* Get a list of all learning path items
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LearningpathsApi
*/
public learningpathsMembershipList(options?: RawAxiosRequestConfig) {
return LearningpathsApiFp(this.configuration)
.learningpathsMembershipList(options)
.then((request) => request(this.axios, this.basePath))
}

/**
* Update individual fields of a learning path
* @summary Update
Expand Down Expand Up @@ -24126,6 +24220,45 @@ export const UserlistsApiAxiosParamCreator = function (
options: localVarRequestOptions,
}
},
/**
* Get a list of all userlist items for a user
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
userlistsMembershipList: async (
options: RawAxiosRequestConfig = {},
): Promise<RequestArgs> => {
const localVarPath = `/api/v1/userlists/membership/`
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL)
let baseOptions
if (configuration) {
baseOptions = configuration.baseOptions
}

const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
}
const localVarHeaderParameter = {} as any
const localVarQueryParameter = {} as any

setSearchParams(localVarUrlObj, localVarQueryParameter)
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {}
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
}

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
}
},
/**
* Viewset for UserLists
* @summary Update
Expand Down Expand Up @@ -24504,6 +24637,33 @@ export const UserlistsApiFp = function (configuration?: Configuration) {
configuration,
)(axios, operationBasePath || basePath)
},
/**
* Get a list of all userlist items for a user
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async userlistsMembershipList(
options?: RawAxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<Array<MicroUserListRelationship>>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.userlistsMembershipList(options)
const index = configuration?.serverIndex ?? 0
const operationBasePath =
operationServerMap["UserlistsApi.userlistsMembershipList"]?.[index]?.url
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration,
)(axios, operationBasePath || basePath)
},
/**
* Viewset for UserLists
* @summary Update
Expand Down Expand Up @@ -24722,6 +24882,19 @@ export const UserlistsApiFactory = function (
)
.then((request) => request(axios, basePath))
},
/**
* Get a list of all userlist items for a user
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
userlistsMembershipList(
options?: RawAxiosRequestConfig,
): AxiosPromise<Array<MicroUserListRelationship>> {
return localVarFp
.userlistsMembershipList(options)
.then((request) => request(axios, basePath))
},
/**
* Viewset for UserLists
* @summary Update
Expand Down Expand Up @@ -25127,6 +25300,19 @@ export class UserlistsApi extends BaseAPI {
.then((request) => request(this.axios, this.basePath))
}

/**
* Get a list of all userlist items for a user
* @summary List
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof UserlistsApi
*/
public userlistsMembershipList(options?: RawAxiosRequestConfig) {
return UserlistsApiFp(this.configuration)
.userlistsMembershipList(options)
.then((request) => request(this.axios, this.basePath))
}

/**
* Viewset for UserLists
* @summary Update
Expand Down
2 changes: 2 additions & 0 deletions frontends/api/src/hooks/channels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const useChannelDetail = (channelType: string, channelName: string) => {
...channels.detailByType(channelType, channelName),
})
}

const useChannelCounts = (channelType: string) => {
return useQuery({
...channels.countsByType(channelType),
Expand Down Expand Up @@ -54,4 +55,5 @@ export {
useChannelsList,
useChannelPartialUpdate,
useChannelCounts,
channels as channelsKeyFactory,
}
8 changes: 1 addition & 7 deletions frontends/api/src/hooks/learningResources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,6 @@ const useSchoolsList = () => {
return useQuery(learningResources.schools())
}

/*
* Not intended to be imported except for special cases.
* It's used in the ResourceCarousel to dynamically build a single useQueries hook
* from config because a React component cannot conditionally call hooks during renders.
*/
export { default as learningResourcesKeyFactory } from "./keyFactory"

export {
useLearningResourcesList,
useFeaturedLearningResourcesList,
Expand Down Expand Up @@ -538,4 +531,5 @@ export {
useListItemMove,
usePlatformsList,
useSchoolsList,
learningResources as learningResourcesKeyFactory,
}
7 changes: 6 additions & 1 deletion frontends/api/src/hooks/newsEvents/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ const useNewsEventsDetail = (id: number) => {
return useQuery(newsEvents.detail(id))
}

export { useNewsEventsList, useNewsEventsDetail, NewsEventsListFeedTypeEnum }
export {
useNewsEventsList,
useNewsEventsDetail,
NewsEventsListFeedTypeEnum,
newsEvents as newsEventsKeyFactory,
}
6 changes: 5 additions & 1 deletion frontends/api/src/hooks/testimonials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ const useTestimonialDetail = (id: number | undefined) => {
})
}

export { useTestimonialDetail, useTestimonialList }
export {
useTestimonialDetail,
useTestimonialList,
testimonials as testimonialsKeyFactory,
}
3 changes: 2 additions & 1 deletion frontends/api/src/hooks/widget_lists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
import { widgetListsApi } from "../../clients"
import widgetLists from "./keyFactory"
import { WidgetInstance } from "api/v0"

/**
* Query is diabled if id is undefined.
* Query is disabled if id is undefined.
*/
const useWidgetList = (id: number | undefined) => {
return useQuery({
Expand Down
13 changes: 13 additions & 0 deletions frontends/api/src/ssr/prefetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { QueryClient, dehydrate } from "@tanstack/react-query"
import type { Query } from "@tanstack/react-query"

// Utility to avoid repetition in server components
export const prefetch = async (queries: (Query | unknown)[]) => {
const queryClient = new QueryClient()

await Promise.all(
queries.map((query) => queryClient.prefetchQuery(query as Query)),
)

return dehydrate(queryClient)
}
Loading