diff --git a/CHANGELOG.md b/CHANGELOG.md index 2864ca1dec75..77343f06adb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ We published the first iteration of a [journey landing page](https://docs.github
Update the setting to restrict notifications to only verified or approved domains available to an owner.
", + "isDeprecated": false, "inputFields": [ { "name": "input", @@ -9236,6 +9237,7 @@ "id": "updatesubscription", "href": "/graphql/reference/mutations#updatesubscription", "description": "Updates the state for subscribable subjects.
", + "isDeprecated": false, "inputFields": [ { "name": "input", @@ -31410,6 +31412,7 @@ "id": "marketplacecategory", "href": "/graphql/reference/objects#marketplacecategory", "description": "A public description of a Marketplace category.
", + "isDeprecated": false, "implements": [ { "name": "Node", @@ -31488,6 +31491,7 @@ "id": "marketplacelisting", "href": "/graphql/reference/objects#marketplacelisting", "description": "A listing in the GitHub integration marketplace.
", + "isDeprecated": false, "implements": [ { "name": "Node", @@ -80689,6 +80693,7 @@ "id": "subscribable", "href": "/graphql/reference/interfaces#subscribable", "description": "Entities that can be subscribed to for web and email notifications.
", + "isDeprecated": false, "fields": [ { "name": "id", @@ -80718,6 +80723,7 @@ "id": "subscribablethread", "href": "/graphql/reference/interfaces#subscribablethread", "description": "Entities that can be subscribed to for web and email notifications.
", + "isDeprecated": false, "fields": [ { "name": "id", @@ -83259,6 +83265,7 @@ "id": "notificationrestrictionsettingvalue", "href": "/graphql/reference/enums#notificationrestrictionsettingvalue", "description": "The possible values for the notification restriction setting.
", + "isDeprecated": false, "values": [ { "name": "DISABLED", @@ -84628,6 +84635,7 @@ "id": "pullrequestorderfield", "href": "/graphql/reference/enums#pullrequestorderfield", "description": "Properties by which pull_requests connections can be ordered.
", + "isDeprecated": false, "values": [ { "name": "CREATED_AT", @@ -87642,6 +87650,7 @@ "id": "subscriptionstate", "href": "/graphql/reference/enums#subscriptionstate", "description": "The possible states of a subscription.
", + "isDeprecated": false, "values": [ { "name": "IGNORED", @@ -87822,6 +87831,7 @@ "id": "threadsubscriptionformaction", "href": "/graphql/reference/enums#threadsubscriptionformaction", "description": "The possible states of a thread subscription form action.
", + "isDeprecated": false, "values": [ { "name": "NONE", @@ -87842,6 +87852,7 @@ "id": "threadsubscriptionstate", "href": "/graphql/reference/enums#threadsubscriptionstate", "description": "The possible states of a subscription.
", + "isDeprecated": false, "values": [ { "name": "DISABLED", @@ -98041,6 +98052,7 @@ "id": "pullrequestorder", "href": "/graphql/reference/input-objects#pullrequestorder", "description": "Ways in which lists of issues can be ordered upon return.
", + "isDeprecated": false, "inputFields": [ { "name": "direction", diff --git a/src/graphql/data/ghec/schema.docs.graphql b/src/graphql/data/ghec/schema.docs.graphql index 7fc8536379b1..ea5789cb043d 100644 --- a/src/graphql/data/ghec/schema.docs.graphql +++ b/src/graphql/data/ghec/schema.docs.graphql @@ -23430,7 +23430,7 @@ type MarkedAsDuplicateEvent implements Node { """ A public description of a Marketplace category. """ -type MarketplaceCategory implements Node { +type MarketplaceCategory implements Node @docsCategory(name: "apps") { """ The category's description. """ @@ -23480,7 +23480,7 @@ type MarketplaceCategory implements Node { """ A listing in the GitHub integration marketplace. """ -type MarketplaceListing implements Node { +type MarketplaceListing implements Node @docsCategory(name: "apps") { """ The GitHub App this listing represents. """ @@ -28212,7 +28212,7 @@ type Mutation { Parameters for UpdateNotificationRestrictionSetting """ input: UpdateNotificationRestrictionSettingInput! - ): UpdateNotificationRestrictionSettingPayload + ): UpdateNotificationRestrictionSettingPayload @docsCategory(name: "activity") """ Sets whether private repository forks are enabled for an organization. @@ -28495,7 +28495,7 @@ type Mutation { Parameters for UpdateSubscription """ input: UpdateSubscriptionInput! - ): UpdateSubscriptionPayload + ): UpdateSubscriptionPayload @docsCategory(name: "activity") """ Updates team review assignment. @@ -28571,7 +28571,7 @@ interface Node { """ The possible values for the notification restriction setting. """ -enum NotificationRestrictionSettingValue { +enum NotificationRestrictionSettingValue @docsCategory(name: "activity") { """ The setting is disabled for the owner. """ @@ -43585,7 +43585,7 @@ enum PullRequestMergeMethod { """ Ways in which lists of issues can be ordered upon return. """ -input PullRequestOrder { +input PullRequestOrder @docsCategory(name: "pulls") { """ The direction in which to order pull requests by the specified field. """ @@ -43600,7 +43600,7 @@ input PullRequestOrder { """ Properties by which pull_requests connections can be ordered. """ -enum PullRequestOrderField { +enum PullRequestOrderField @docsCategory(name: "pulls") { """ Order pull_requests by creation time """ @@ -62470,7 +62470,7 @@ type SubmoduleEdge { """ Entities that can be subscribed to for web and email notifications. """ -interface Subscribable { +interface Subscribable @docsCategory(name: "activity") { """ The Node ID of the Subscribable object """ @@ -62490,7 +62490,7 @@ interface Subscribable { """ Entities that can be subscribed to for web and email notifications. """ -interface SubscribableThread { +interface SubscribableThread @docsCategory(name: "activity") { """ The Node ID of the SubscribableThread object """ @@ -62535,7 +62535,7 @@ type SubscribedEvent implements Node { """ The possible states of a subscription. """ -enum SubscriptionState { +enum SubscriptionState @docsCategory(name: "activity") { """ The User is never notified. """ @@ -64567,7 +64567,7 @@ type TextMatchHighlight { """ The possible states of a thread subscription form action """ -enum ThreadSubscriptionFormAction { +enum ThreadSubscriptionFormAction @docsCategory(name: "activity") { """ The User cannot subscribe or unsubscribe to the thread """ @@ -64587,7 +64587,7 @@ enum ThreadSubscriptionFormAction { """ The possible states of a subscription. """ -enum ThreadSubscriptionState { +enum ThreadSubscriptionState @docsCategory(name: "activity") { """ The subscription status is currently disabled. """ diff --git a/src/graphql/data/ghec/schema.json b/src/graphql/data/ghec/schema.json index 1c1943b3099e..0c4959e9efaf 100644 --- a/src/graphql/data/ghec/schema.json +++ b/src/graphql/data/ghec/schema.json @@ -8446,6 +8446,7 @@ "id": "updatenotificationrestrictionsetting", "href": "/graphql/reference/mutations#updatenotificationrestrictionsetting", "description": "Update the setting to restrict notifications to only verified or approved domains available to an owner.
", + "isDeprecated": false, "inputFields": [ { "name": "input", @@ -9236,6 +9237,7 @@ "id": "updatesubscription", "href": "/graphql/reference/mutations#updatesubscription", "description": "Updates the state for subscribable subjects.
", + "isDeprecated": false, "inputFields": [ { "name": "input", @@ -31410,6 +31412,7 @@ "id": "marketplacecategory", "href": "/graphql/reference/objects#marketplacecategory", "description": "A public description of a Marketplace category.
", + "isDeprecated": false, "implements": [ { "name": "Node", @@ -31488,6 +31491,7 @@ "id": "marketplacelisting", "href": "/graphql/reference/objects#marketplacelisting", "description": "A listing in the GitHub integration marketplace.
", + "isDeprecated": false, "implements": [ { "name": "Node", @@ -80689,6 +80693,7 @@ "id": "subscribable", "href": "/graphql/reference/interfaces#subscribable", "description": "Entities that can be subscribed to for web and email notifications.
", + "isDeprecated": false, "fields": [ { "name": "id", @@ -80718,6 +80723,7 @@ "id": "subscribablethread", "href": "/graphql/reference/interfaces#subscribablethread", "description": "Entities that can be subscribed to for web and email notifications.
", + "isDeprecated": false, "fields": [ { "name": "id", @@ -83259,6 +83265,7 @@ "id": "notificationrestrictionsettingvalue", "href": "/graphql/reference/enums#notificationrestrictionsettingvalue", "description": "The possible values for the notification restriction setting.
", + "isDeprecated": false, "values": [ { "name": "DISABLED", @@ -84628,6 +84635,7 @@ "id": "pullrequestorderfield", "href": "/graphql/reference/enums#pullrequestorderfield", "description": "Properties by which pull_requests connections can be ordered.
", + "isDeprecated": false, "values": [ { "name": "CREATED_AT", @@ -87642,6 +87650,7 @@ "id": "subscriptionstate", "href": "/graphql/reference/enums#subscriptionstate", "description": "The possible states of a subscription.
", + "isDeprecated": false, "values": [ { "name": "IGNORED", @@ -87822,6 +87831,7 @@ "id": "threadsubscriptionformaction", "href": "/graphql/reference/enums#threadsubscriptionformaction", "description": "The possible states of a thread subscription form action.
", + "isDeprecated": false, "values": [ { "name": "NONE", @@ -87842,6 +87852,7 @@ "id": "threadsubscriptionstate", "href": "/graphql/reference/enums#threadsubscriptionstate", "description": "The possible states of a subscription.
", + "isDeprecated": false, "values": [ { "name": "DISABLED", @@ -98041,6 +98052,7 @@ "id": "pullrequestorder", "href": "/graphql/reference/input-objects#pullrequestorder", "description": "Ways in which lists of issues can be ordered upon return.
", + "isDeprecated": false, "inputFields": [ { "name": "direction", diff --git a/src/landings/components/CategoryLanding.tsx b/src/landings/components/CategoryLanding.tsx index e2d12bafeba8..ff5081490f00 100644 --- a/src/landings/components/CategoryLanding.tsx +++ b/src/landings/components/CategoryLanding.tsx @@ -17,7 +17,12 @@ import { UtmPreserver } from '@/frame/components/UtmPreserver' export const CategoryLanding = () => { const { t } = useTranslation('cookbook_landing') const router = useRouter() - const { title, intro, tocItems, spotlight } = useCategoryLandingContext() + const { title, intro, tocItems, spotlight, filters } = useCategoryLandingContext() + + // The category filter is always shown. Surface and complexity are opt-in via + // the `filters` frontmatter array on the landing page. + const showSurface = filters ? filters.includes('surface') : true + const showComplexity = filters ? filters.includes('complexity') : false // tocItems contains directories and its children, we only want the child articles const onlyFlatItems: ArticleCardItems = tocItems.flatMap((item) => item.childTocItems || []) @@ -25,6 +30,7 @@ export const CategoryLanding = () => { const [searchQuery, setSearchQuery] = useState('') const [selectedCategory, setSelectedCategory] = useState('All') const [selectedComplexity, setSelectedComplexity] = useState('All') + const [selectedSurface, setSelectedSurface] = useState('All') const applyFilters = () => { let results = onlyFlatItems @@ -53,6 +59,10 @@ export const CategoryLanding = () => { results = results.filter((item) => item.complexity?.includes(selectedComplexity)) } + if (selectedSurface !== 'All') { + results = results.filter((item) => item.surface?.includes(selectedSurface)) + } + return results } @@ -62,9 +72,11 @@ export const CategoryLanding = () => { setSearchQuery(query) } - const handleFilter = (option: string, type: 'category' | 'complexity') => { + const handleFilter = (option: string, type: 'category' | 'complexity' | 'surface') => { if (type === 'category') { setSelectedCategory(option) + } else if (type === 'surface') { + setSelectedSurface(option) } else if (type === 'complexity') { setSelectedComplexity(option) } @@ -73,6 +85,7 @@ export const CategoryLanding = () => { const handleResetFilter = () => { setSearchQuery('') setSelectedCategory('All') + setSelectedSurface('All') setSelectedComplexity('All') } @@ -156,6 +169,8 @@ export const CategoryLanding = () => { onSearch={handleSearch} handleFilter={handleFilter} handleResetFilter={handleResetFilter} + showSurface={showSurface} + showComplexity={showComplexity} /> @@ -170,6 +185,7 @@ export const CategoryLanding = () => { ...(item.industry || []), ...(item.category || []), ...(item.complexity || []), + ...(item.surface || []), ]} url={item.fullPath} /> diff --git a/src/landings/components/CookBookArticleCard.tsx b/src/landings/components/CookBookArticleCard.tsx index d11352af963a..6aec08b2acb9 100644 --- a/src/landings/components/CookBookArticleCard.tsx +++ b/src/landings/components/CookBookArticleCard.tsx @@ -14,6 +14,7 @@ type Props = { spotlight?: boolean image?: string complexity?: string + surface?: string } function setImage(image: string, alt: string) { diff --git a/src/landings/components/CookBookFilter.module.scss b/src/landings/components/CookBookFilter.module.scss index d12bcd8755e6..f320804bb0d5 100644 --- a/src/landings/components/CookBookFilter.module.scss +++ b/src/landings/components/CookBookFilter.module.scss @@ -11,3 +11,8 @@ color: var(--fgColor-muted, var(--color-fg-muted, #656d76)); display: inline-block; } + +.surfaceLabel { + color: var(--fgColor-muted, var(--color-fg-muted, #656d76)); + display: inline-block; +} diff --git a/src/landings/components/CookBookFilter.tsx b/src/landings/components/CookBookFilter.tsx index d6ab5cd51d3d..b68b6db1c279 100644 --- a/src/landings/components/CookBookFilter.tsx +++ b/src/landings/components/CookBookFilter.tsx @@ -10,8 +10,10 @@ type Props = { tokens: ArticleCardItems onSearch: (query: string) => void isSearchOpen?: boolean - handleFilter: (option: string, type: 'category' | 'complexity') => void + handleFilter: (option: string, type: 'category' | 'surface' | 'complexity') => void handleResetFilter: () => void + showSurface?: boolean + showComplexity?: boolean } export const CookBookFilter = ({ @@ -20,8 +22,11 @@ export const CookBookFilter = ({ tokens, handleFilter, handleResetFilter, + showSurface = true, + showComplexity = false, }: Props) => { const categories: string[] = ['All', ...new Set(tokens.flatMap((item) => item.category || []))] + const surfaces: string[] = ['All', ...new Set(tokens.flatMap((item) => item.surface || []))] const complexities: string[] = [ 'All', ...new Set(tokens.flatMap((item) => item.complexity || [])), @@ -29,13 +34,16 @@ export const CookBookFilter = ({ const { t } = useTranslation('cookbook_landing') const [selectedCategory, setSelectedCategory] = useState(0) + const [selectedSurface, setSelectedSurface] = useState(0) const [selectedComplexity, setSelectedComplexity] = useState(0) const inputRef = useRef