cli icon indicating copy to clipboard operation
cli copied to clipboard

Add allow_direct_linking to UIExtension schema

Open qamorim opened this issue 1 year ago β€’ 4 comments

Part 2 of https://github.com/Shopify/core-issues/issues/74004 Vault project: https://vault.shopify.io/gsd/projects/39317

WHY are these changes introduced?

Following the decision on the tech design to introduce a property called allow_direct_linking for an extension point's configurable capabilities. This allows app developers to configure whether the app extension can be used inside navigations (do they render a root url)

https://github.com/Shopify/shopify/pull/524406 is for the core side validations and updates the UiExtension API schema to incorporate target-level capabilities. This pull request allows allow_direct_linking to be configured for a ui_extension target.

WHAT is this pull request doing?

Add an optional capabilities hash which includes an optional allow_direct_linking boolean to the NewExtensionPointSchema.

How to test your changes?

Make sure you have a spin instance with partners constellation, can use customer-accounts-dev-ui. Check out https://github.com/Shopify/shopify/pull/524406 there and enable the api client flag bin/rails g verdict:configure_flag enable_ui_extension_allow_direct_linking --subject_type "api_client" --percent 100

  1. Clone the CLI tool dev clone cli locally
  2. Checkout this branch. From the cli directory, install pnpm pnpm install, then create an app SHOPIFY_CLI_1P_DEV=1 SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm create @shopify/app
  3. Create an extension, SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm shopify app generate extension from the app's directory
  4. Install the app to your development store by using the partner dashboard > apps > select your app > test your app > select store
  5. Add allow_direct_linking to the shopify.extension.toml shopify.extension.toml configuration found inside your extension directory
[[extensions.targeting]]
module = "./src/FullPageExtension.tsx"
target = "customer-account.page.render"

  [extensions.targeting.capabilities]
  allow_direct_linking = true
  1. Change directory back to main cli directory and deploy SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm shopify app deploy --path /Users/path_to_your_app

Post-release steps

We will need to have docs updated when Configure header menu for customer accounts is released tracked in this issue https://github.com/Shopify/core-issues/issues/75186

Measuring impact

How do we know this change was effective? Please choose one:

  • [x] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • [x] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • [x] I've considered possible documentation changes

qamorim avatar Aug 07 '24 18:08 qamorim

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/app-management

github-actions[bot] avatar Aug 07 '24 18:08 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
72.8% (+0.1% πŸ”Ό)
8030/11030
🟑 Branches
69.23% (+0.04% πŸ”Ό)
3913/5652
🟑 Functions
71.51% (+0.01% πŸ”Ό)
2103/2941
🟑 Lines
73.13% (+0.1% πŸ”Ό)
7592/10381

Test suite run success

1813 tests passing in 825 suites.

Report generated by πŸ§ͺjest coverage report action from dacd9c8341e80c30c10647bf1c7cc3af3a612759

github-actions[bot] avatar Aug 13 '24 23:08 github-actions[bot]

We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.

github-actions[bot] avatar Aug 14 '24 15:08 github-actions[bot]

Wooohooo! πŸ™‡β€β™€οΈπŸš’πŸ„πŸ»β€β™€οΈ

laurieoulikesfood avatar Aug 14 '24 22:08 laurieoulikesfood