Prepare shared libs#161
Draft
bdb-dd wants to merge 7 commits intoAltinn:mainfrom
Draft
Conversation
- Move frontend and backend applications into `apps/` directory structure - Add classnames dependency to frontend package.json - Use PNPM as package manager
- Add Playwright config mirroring astro-kinorge setup (chromium, firefox, webkit, mobile variants) - Add test scripts: test:e2e, test:e2e:ui, test:e2e:update - Add devDeps: @playwright/test 1.44.0, @axe-core/playwright ^4.10.0, @types/node ^22.10.7 - Author specs: routes.spec.ts (smoke), accessibility.spec.ts (axe + landmarks + keyboard), functional.spec.ts (title, locale-root, navigation, responsive), visual.spec.ts (snapshots) - 4 pre-existing axe failures carried forward
- Add packages/umbraco-client with createDeliveryApiClient, mapMedia, getMediaUrl, richTextToHtml, getPlainText helpers and the shared Umbraco delivery-API types. - Rewire apps/astro-infoportal/src/api/umbraco/client.ts to consume the package. - Add packages/* to pnpm-workspace.yaml. - Un-ignore /packages/ in .gitignore (the legacy NuGet rule **/[Pp]ackages/* was hiding this workspace package).
Move the Microsoft Entra ID auth trio and the Azure Blob filesystem composer into a new dotnet/Portals.Umbraco.Shared/ project, consumed by umbraco-infoportal via ProjectReference. Also rename Adapters/Infoportal.Adapters.Elasticsearch/ → dotnet/Infoportal.Adapters.Elasticsearch/ (groups all in-repo .NET libraries under dotnet/). Two intentional behavior changes carried over from the original extraction: - Role mapping is now config-driven: appsettings.json declares MicrosoftEntraId.RoleMappings + DefaultUmbracoGroup. Existing mappings (umbraco-admin → admin, umbraco-editor-startogdrive → editorStarteOgDrive, umbraco-editor-nyheter → editorNyheter) are preserved verbatim. - AzureBlobFileSystemComposer auto-disables when Umbraco.Storage.AzureBlob.Media.ConnectionString is empty. Altinn's deploy sets this via env var so the gate is satisfied in prod.
Portals.Umbraco.Shared.AzureBlobFileSystemComposer auto-registers when ConnectionString is set, so the explicit AddAzureBlobMediaFileSystem / AddAzureBlobImageSharpCache calls in Program.cs are redundant.
Land the editor-facing preview flow on altinn-infoportal: middleware verifies HMAC-signed preview links, PreviewBanner exits on demand, /api/exit-preview clears the cookie, the umbraco client passes preview through to delivery API calls, and the layouts surface the banner. Deviation from the original Task 9 deferral: HeadlessPreviewUrlProvider lives in dotnet/Portals.Umbraco.Shared/Composers/ rather than in apps/umbraco-infoportal/Composers/. Per portal-owners' decision, headless preview will land on the second portal soon, so the provider belongs in the shared lib. Kjac.HeadlessPreview 3.0.0 moves to Portals.Umbraco.Shared.csproj as a transitive dep for any future consumer.
Move Options/KeyVaultOptions.cs into Portals.Shared.Configuration and add KeyVaultConfigurationExtensions.AddPortalsKeyVault to encapsulate the DefaultAzureCredential wiring. Program.cs collapses 25+ lines of inline KeyVault setup into one call. The Azure.Extensions.AspNetCore.Configuration.Secrets and Azure.Identity NuGet refs move to Portals.Umbraco.Shared.csproj.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preparation to consider adding Playwright tests and headless preview
Other changes that can prepare for extracting a shared library for Entra ID and Content Delivery client.
Motivation was mostly to do a concrete analysis and these changes are not verified by hand yet.