-
Notifications
You must be signed in to change notification settings - Fork 7
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
GH-244 - Extensible source support #245
Conversation
I tried to strike a balance between changing very deep parts of Sidekick / Admin and simply bolting on something that cannot be maintained. My hope is that this can work for XWalk / UE as well. |
Supporting this makes sense to me, and I don’t see any immediate issues with this approach. However, @rofe might have a different perspective. It would also be good to get input from UE to confirm if this works for them as you suggested. One suggestion: instead of |
39e6ad5
to
7c0e0c2
Compare
I changed things to get closer to your comment above. A couple notes:
Let me know what y'all think. Happy to adjust further. The final {
"project": "DA Block Collection",
"sourceFormat": {
"label": "Document Authoring",
"pattern": "https://da.live/edit#/{{org}}/{{repo}}{{pathname}}"
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, but I'm a little concerned that this will be a one-off solution since I'm not sure any of the other BYOM sources will be able provide a pattern containing org
and site
...
src/extension/app/store/site.js
Outdated
@@ -247,6 +247,7 @@ export class SiteStore { | |||
specialViews, | |||
transient = false, | |||
scriptUrl = 'https://www.hlx.live/tools/sidekick/index.js', | |||
sourceFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think editUrlFormat
would be more descriptive.
src/extension/app/store/app.js
Outdated
if (!contentSourcePattern || typeof contentSourcePattern !== 'string') return null; | ||
const url = contentSourcePattern | ||
.replace('{{org}}', owner) | ||
.replace('{{repo}}', repo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consistently switch from owner/repo
to org/site
in all public facing API surfaces.
.replace('{{repo}}', repo) | |
.replace('{{site}}', repo) |
I looked at some existing xwalk mountpoints and it looks like the pattern could be fulfilled. Letting @buuhuu confirm. |
Wondering if the label ever need to be localized? If so, you could add an additional, optional |
@rofe @auniverseaway and I chatted about this on Slack, I think this will work with XWalk as well. Today we have a Sidekick overlay which just does
In the new format this would be
It will require us to put the content source URL here a second time, which I think is similar to DA was well. But give this is typically one time config it might be fine. Alternative would be to have a |
We should not duplicate the |
@buuhuu, For an XWalk project, I show:contentSourceUrlhttps://author-p15404-e146221-cmstg.adobeaemcloud.com/bin/franklin.delivery/mhaack/my-aem-project/main Edit URLhttps://author-p15404-e146221-cmstg.adobeaemcloud.com/bin/franklin.delivery/mhaack/my-aem-project/main/index?cmd=open Which means that should work well for UE. DA / WordPress / Drupal / etc have different content and edit URLs. |
Can you elaborate on this? With hlx5 repo-less it cannot be in the boilerplate / it changes from project to project. |
@buuhuu the reason for supporting variables is that this edit url format can stay fully generic and doesn't need to be changed from project to project. @auniverseaway I approve :) |
7c0e0c2
to
524b0ad
Compare
I think I accounted for all feedback and suggestions. @rofe the only thing I didn't add was I modified the original comment with the updated spec, but here it is as well. If I can get thumbs on the final naming conventions I can work on tests and docs. Thanks! Sidekick specUE{
"project": "XWalk Block Collection",
"editUrlFormat": {
"label": "Universal Editor",
"pattern": "{{contentSourceUrl}}{{pathname}}?cmd=open"
}
} DA{
"project": "DA Block Collection",
"editUrlFormat": {
"label": "Document Authoring",
"pattern": "https://da.live/edit#/{{org}}/{{site}}{{pathname}}"
}
} |
@auniverseaway we'd also need to update the config schema. That makes me wonder if it wouldn't be easier to just add 2 top level properies instead of an object? |
Tested it with https://main--my-aem-project--mhaack.aem.page/ for UE & Crosswalks, works nicely. cc @buuhuu |
@rofe I saw that as I was writing tests and getting yelled at by TypeScript. I'll make them both top level. |
@auniverseaway You'll want to add them to ClientConfig typedef to get the type checker to stop complaining. |
* Provides ability to let project spec an `editUrlFormat` object * Supports `{{contentSourceUrl}} {{org}} {{site}} {{pathname}}` placeholders in pattern
524b0ad
to
c27170c
Compare
@rofe @dylandepass I think I've got all suggestions covered. I didn't see the schema in the codebase, so my assumption is that it's generated from the TS def? |
At the moment, the schema needs to be updated manually here: |
@rofe updated: adobe/helix-website#657 |
@auniverseaway I'll merge this into a branch to make sure all checks are passing before mergin to |
Co-authored-by: Chris Millar <[email protected]>
# [1.32.0](v1.31.4...v1.32.0) (2024-09-24) ### Bug Fixes * dynamically load in ui.js ([a4fc57d](a4fc57d)) * remove dynamic import from background script ([58cc888](58cc888)) ### Features * extensible source support ([#245](#245)) ([#268](#268)) ([a834be2](a834be2)) * **publish:** add confirm option ([#262](#262)) ([7e8e1fc](7e8e1fc)) * support transient site token ([#272](#272)) ([2aeb56a](2aeb56a))
Description
editUrlFormat
object{{contentSourceUrl}} {{org}} {{site}} {{pathname}}
placeholders in patternAPI
UE
DA
Related Issue
Resolves: GH-244
Motivation and Context
See the GH issue.
How Has This Been Tested?
E2E for now. Once approach is agreed upon, will write tests.
Screenshots (if appropriate):
Types of changes
Checklist: