Skip to content

Commit 416bf62

Browse files
committed
Remove duplicated network api docs
Rename Picker api's internal Badge interface so it does not collide with the real Badge component
1 parent 8e3731d commit 416bf62

File tree

2 files changed

+6
-128
lines changed

2 files changed

+6
-128
lines changed

packages/ui-extensions/docs/surfaces/admin/staticPages/admin-extensions.doc.ts

Lines changed: 4 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,23 @@ const data: LandingTemplateSchema = {
3838
type: 'app',
3939
},
4040
{
41-
subtitle: 'App authentication',
42-
name: "Make authenticated requests to your app's backend",
43-
url: '#app-authentication',
44-
type: 'tool',
41+
subtitle: 'Network Features',
42+
name: 'Learn about the network features available to admin extensions',
43+
url: '/docs/api/admin-extensions/api/network-features',
44+
type: 'globe',
4545
},
4646
{
4747
subtitle: 'Using Forms',
4848
name: 'Use the Form component to integrate with the contextual save bar of the resource page',
4949
url: '#using-forms',
5050
type: 'tool',
5151
},
52-
{
53-
subtitle: 'Direct API access',
54-
name: 'Access the Shopify GraphQL API directly',
55-
url: '#direct-api-access',
56-
type: 'tool',
57-
},
5852
{
5953
subtitle: 'Picking resources',
6054
name: 'Prompt the user to select resources',
6155
url: '#picking-resources',
6256
type: 'tool',
6357
},
64-
{
65-
subtitle: 'Custom protocols',
66-
name: 'Easily construct URLs to navigate to common locations',
67-
url: '#custom-protocols',
68-
type: 'gear',
69-
},
7058
],
7159
},
7260
{
@@ -144,42 +132,6 @@ const data: LandingTemplateSchema = {
144132
],
145133
},
146134
},
147-
{
148-
type: 'Generic',
149-
title: 'Direct API access',
150-
sectionContent:
151-
"You can make Shopify Admin API requests directly from your extension using the [query API](/docs/api/admin-extensions/api/standard-api#standardapi-propertydetail-query) or the standard [web fetch API](https://developer.mozilla.org/en-US/docs/Web/API/fetch)!\n\nAny `fetch()` calls from your extension to Shopify's Admin GraphQL API are automatically authenticated by default. These calls are fast too, because Shopify handles requests directly.\n\nDirect API requests use [online access](https://shopify.dev/docs/apps/build/authentication-authorization/access-token-types/online-access-tokens) mode by default. If you want to use [offline access](https://shopify.dev/docs/apps/build/authentication-authorization/access-token-types/offline-access-tokens) mode, you can set the `direct_api_mode` property to `offline` in your [app TOML file](/docs/apps/tools/cli/configuration#admin).\n\nNote: Direct API can't be used to manage storefront access tokens.",
152-
anchorLink: 'direct-api-access',
153-
codeblock: {
154-
title: 'Query Shopify data',
155-
tabs: [
156-
{
157-
code: './examples/direct-api-fetch.jsx',
158-
language: 'tsx',
159-
title: 'Fetch Product data',
160-
},
161-
{
162-
code: './examples/direct-api-query.jsx',
163-
language: 'tsx',
164-
title: 'Query Product data',
165-
},
166-
],
167-
},
168-
sectionCard: [
169-
{
170-
name: "Direct API can't be used to manage storefront access tokens.",
171-
subtitle: 'Note',
172-
url: '/docs/api/admin-extensions#direct-api-access',
173-
type: 'information',
174-
},
175-
{
176-
name: 'Learn more about access scopes',
177-
subtitle: 'Developer guide',
178-
url: '/docs/api/usage/access-scopes',
179-
type: 'information',
180-
},
181-
],
182-
},
183135
{
184136
type: 'GenericAccordion',
185137
title: 'Picking Resources',
@@ -221,80 +173,6 @@ const data: LandingTemplateSchema = {
221173
},
222174
],
223175
},
224-
{
225-
type: 'GenericAccordion',
226-
title: 'Custom Protocols',
227-
sectionContent:
228-
'Custom protocols make it easier to navigate to common locations, and construct URLs.',
229-
anchorLink: 'custom-protocols',
230-
accordionContent: [
231-
{
232-
title: 'Shopify Protocol',
233-
description:
234-
'Use the `shopify:admin` protocol when you want to construct a URL with a root of the Shopify Admin.',
235-
codeblock: {
236-
title: 'shopify:admin',
237-
tabs: [
238-
{
239-
title: 'Link to Product Page',
240-
language: 'tsx',
241-
code: './examples/link-to-product-page.jsx',
242-
},
243-
{
244-
title: 'Fetch data',
245-
language: 'ts',
246-
code: './examples/fetch-data.js',
247-
},
248-
],
249-
},
250-
},
251-
{
252-
title: 'App Protocol',
253-
description:
254-
'Use the `app:` protocol to construct a URL for your app. Shopify will handle constructing the base URL for your app. This works for both embedded and non-embedded apps.',
255-
codeblock: {
256-
title: 'app:',
257-
tabs: [
258-
{
259-
title: 'Link to Settings',
260-
language: 'tsx',
261-
code: './examples/link-to-settings.jsx',
262-
},
263-
],
264-
},
265-
},
266-
{
267-
title: 'Extension Protocol',
268-
description:
269-
'Triggers an action extension from a block extension using the `extension:` protocol. The `extensionTarget` is the target of the action extension. The handle is the handle of the action extension that will be opened.',
270-
codeblock: {
271-
title: 'extension:',
272-
tabs: [
273-
{
274-
title: 'Trigger Action Extension from a Block extension',
275-
language: 'tsx',
276-
code: './examples/link-to-action.jsx',
277-
},
278-
],
279-
},
280-
},
281-
{
282-
title: 'Relative Urls',
283-
description:
284-
'Relative urls are relative to your app and are useful when you want to link to a route within your app. This works for both embedded and non-embedded apps.',
285-
codeblock: {
286-
title: '/relative/urls',
287-
tabs: [
288-
{
289-
title: 'Link to route in your app',
290-
language: 'tsx',
291-
code: './examples/link-to-route.jsx',
292-
},
293-
],
294-
},
295-
},
296-
],
297-
},
298176
{
299177
type: 'Generic',
300178
title: 'Deploying',

packages/ui-extensions/src/surfaces/admin/api/picker/picker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface PickerOptions {
4141
export type Tone = 'info' | 'success' | 'warning' | 'critical';
4242
export type Progress = 'incomplete' | 'partiallyComplete' | 'complete';
4343
type DataPoint = string | number | undefined;
44-
interface Badge {
44+
interface PickerBadge {
4545
content: string;
4646
tone?: Tone;
4747
progress?: Progress;
@@ -72,7 +72,7 @@ interface Item {
7272
/**
7373
* The badges to display in the first column of the row. These are used to display additional information about the item, such as progress of an action or tone indicating the status of that item.
7474
*/
75-
badges?: Badge[];
75+
badges?: PickerBadge[];
7676
/**
7777
* The thumbnail to display at the start of the row. This is used to display an image or icon for the item.
7878
*/

0 commit comments

Comments
 (0)