Commit Graph

134 Commits

Author SHA1 Message Date
Niels Lyngsø
f03a7d332b Introduce delay and expand path matching on Backoffice router for lazy-loaded routes (#19409)
* implement use of pathMatch: 'full' for empty redirects

* awaitStability feature for route redirects

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2025-05-26 09:25:17 +02:00
Niels Lyngsø
62cedeec13 V16/hotfix/ensure self destroy before clean up (#19367)
* move destroy to top

* clean up example

* use the unprovide method when disconnecting
2025-05-21 09:32:34 +00:00
Niels Lyngsø
e9a5dafc62 Fix #19221 (#19254) 2025-05-08 09:27:59 +00:00
Niels Lyngsø
6d330a30eb V16: Context Api can unprovide Contexts (#19113)
* make consume return undefined

* make consume return undefined

* a few more undefined context handlings

* unprovide context

* rename

* jsdocs

* refactor UmbContextBase to not use generic types

* reset target on disconnect

* posible undefined context

* callback with undefined when disconnected

* update comment

* correct types

* correct error handling

* do not throw an error when missing

* always return permitted to onChange callback

* fix not existing store

* fix resetting structure manager

* fix requestAuditLogs

* support gone context

* support context not begin present

* use UMB_ENTITY_WORKSPACE_CONTEXT for right typing

* correct type to use UMB_SUBMITTABLE_WORKSPACE_CONTEXT

* correct context consumption

* fix tests

* fix tests

* catch modal registration that has been destroyed

* catch

* handle context unprovide

* more clean up

* fix context consumption

* Update repository-details.manager.ts

* enable store to be undefined

* enable UmbRelationTypeDetailRepository store to be undefined

* remove log

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2025-04-24 08:57:02 +00:00
Niels Lyngsø
3187d99d23 Custom validator example take2 (#19093)
* declare type and constant

* implement for example

* commit example

* fix document data

* make rte blocks optional

* remove blocks from this mock data

* fix mock data for RTE

* comment and destroy method implementation

* set to 8

* update comments

* remove console.log

* host may be undefined

* prevent duplicate messages
2025-04-23 12:47:19 +02:00
Niels Lyngsø
8849647dcd declare type and constant (#19091) 2025-04-23 07:08:08 +00:00
Jacob Overgaard
889bd0b6e4 fix a bad merge 2025-04-16 14:07:42 +02:00
Jacob Overgaard
3939742917 V16: Replace legacy/fetch with @hey-api/client-fetch (#19002)
* feat: adds new backend-api and http-client packages and generates the api with @hey-api/client-fetch

* feat: maps generic T back to promise to avoid usage of 'any'

* feat: sets up baseUrl and auth for the new client

* feat: gets the api base url from server context instead of the http client

* feat: gets the api base url from server context instead of the http client

* feat: allows undefined token for xhr requests

* feat: changes the response object to be either type T directly (to support @hey-api/client-fetch) or the given type if the response does not contain a 'data' object

* revert interface

* feat: creates an api return type to comply with @hey-api/client-fetch

* feat: maps T back to the data model for non-api types

* feat: simplify api response to return the promise you sent to it with an optional error object

* feat: moves http related modules to the core package

* feat: updates the required type of the client for the api interceptors

* docs: removes invalid property

* feat: adds request parameters to documents

* feat: adds request parameters to imaging

* feat: adds return type to item-server-data-source-base

* feat: adds request parameters to webhooks

* feat: adds request parameters to users

* feat: renames all `requestBody` to `body` to conform with new client-fetch

* feat: uses query to take parameters in

* feat: adds data source response to tree types

* feat: adds request parameters to templating

* feat: adds request parameters to templating

* feat: adds request parameters to telemetry

* feat: adds request parameters to tags

* feat: adds request parameters to examine management

* feat: adds request parameters to relations

* feat: adds request parameters to packages

* feat: catches new api errors that are direct problem details objects

* feat: adds default interceptor to handle Umb-Generated-Resource headers

* feat: uses an error interceptor specifically to catch errors to avoid overhead

* feat: adds request parameters to members

* Revert "feat: uses an error interceptor specifically to catch errors to avoid overhead"

This reverts commit 7ffb7b29bfe4ddbc51736434db78372767731dd1.

* feat: adds request parameters to media

* feat: adds request parameters to log viewer

* feat: adds request parameters to languages

* feat: adds request parameters to health check

* feat: adds request parameters to oembed

* feat: adds request parameters to documents

* feat: adds request parameters to redirect management

* feat: adds request parameters to blueprints

* feat: adds request parameters to dictionary

* feat: adds request parameters to data types

* feat: adds request parameters to temporary file

* feat: instructs delete methods to return an unknown value

* feat: allows default value to be unknown

* feat: adds request parameters to culture

* chore: import path

* feat: adds correct models to mocks

* feat: adds correct models to installer and upgrader

* feat: adds correct models to mocks

* chore: forgot to move ignore line

* chore: ignores generated files in eslint

* chore: removes old generated files

* feat: moves network connection status manager back into the main app to avoid imports from core

* chore: update imports

* feat: generate API for login screen without relying on the backoffice

* feat: uses the generated models on the login screen

* feat: sets 'credentials' to 'include' and adds it back to openapiconfiguration to avoid a breaking change

* adds back in commands moved to a workspace

* chore: vscode workspace settings formatted and useFlatConfig added for better compatibility
2025-04-14 10:21:42 +02:00
Mads Rasmussen
684790df70 Chore: Add script to check for "illegal" imports (#18992)
* stop webhook module from importing itself

* wip script to list all module imports from a folder

* Update package.json

* fix ufm

* fix tip tap

* order by name

* fix stylesheet module

* fix self import

* fix self import

* pass folder as a variable

* implement folder variable

* allow to pass module name + prettify log output

* check for imports from core to packages and report error

* add comments

* run as part of test

* Update package.json

* add threshold

* Update index.js

* add report of module self imports

* Update index.js

* Update index.js

* Update src/Umbraco.Web.UI.Client/devops/module-dependencies/index.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* remove self imports in /extension-api

* fix order

* fix self imports

* fix self import

* fix self imports

* fix self imports

* fix collection self import

* fix self imports

* fix self import

* Update collection-pagination.element.ts

* Update entity-action.extension.ts

* fix self imports

* lower threshold

* fix self imports

* fix self imports

* fix self imports

* fix merge

* fix tree self imports

* Update sort-children-of-modal.element.ts

* Update section.context.ts

* change threshold

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-14 07:55:20 +00:00
Niels Lyngsø
16ee7227ae Feature: Document Property Value Permission (#18997)
* add property visibility state manager

* implement in structure manager

* filter properties based on visibility

* wip document type structure permissions

* rename

* register entity permission for document type property

* add entity permission for media type property

* pass fallback permissions to document granular permissions

* set as preset

* clean up

* wip document type property picker

* add preset value

* Update input-document-type-structure-granular-user-permission.element.ts

* move files

* rename

* Update input-document-value-granular-user-permission.element.ts

* remove temp test

* Update manifests.ts

* remove unused

* Update input-document-value-granular-user-permission.element.ts

* rename see permission + add write permission

* fix missing type

* require property type unique

* add unique to property type

* rename to property type

* map to unique

* deprecate id on property type

* return unique from property picker

* more explicit naming

* use type

* render detail

* Update input-document-value-granular-user-permission.element.ts

* wip modal flow

* clean up

* add headlines

* hide actions

* pass preset value

* add edit permission method

* include property in permission name

* add read and write managers

* implement read and write state managers

* Update content-type-structure-manager.class.ts

* enforce property permissions

* Storage for granular permissions at property type level

* add guards

* make variant property version

* Rename server models to include "property"

* generate server types

* add permissionType to model

* add mappers to user group permission data

* add mapper to current user permission data

* destroy

* clear state

* use permission type for guard check

* add permission type

* require specific permission type

* use correct schema type

* add mappings

* clean up

* log errors

* fix mapping

* null check for icon

* use fallback if there is no forDataModel

* add translations

* sort group alphabetically

* add empty state for no verbs

* organize folders

* always require unique and variant id

* Allow storing empty lists of verbs

* pass variant id to all states

* Remove empty verbs

* add alias to name

* prevent picking the same property type multiple times

* fix lint errors

* fix create state by observing variant options

* move to workspace context

* Update document-property-value-user-permission.workspace-context.ts

* Update content-editor-properties.element.ts

* clean up

* Rename models (last time, promise!)

* Add migration for default document property value permissions

* generate new server models

* update after model changes

* Correct the default permission identifiers

* Add default permissions to newly created DBs

* Add validation and clean-up

* rename to visibility state

* rename to view

* add helpers

* apply to blocks

* Update document-property-value-user-permission.workspace-context.ts

* disable view and write state by default

* add tests for start and stopping a state

* throw errors if adding to a state that is not running

* export consts

* export consts

* fix circular

* fix circular

* set the entity type when setting values

* only apply for block in document values

* split logic

* start states for document blocks

* only apply states when state is running

* Fixed typos in test method names.

* add readonly type

* Enforce: AllowEditInvariantFromNonDefault configuration (#18758)

* add read only state

* handle read only property state in properties element

* prevent editing shared props on non default

* enforce configuration

* clean up

* set variant id

* move to property module

---------

Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>

* remove unnecessary messages

* make sure to destroy consumer

* Thoughts as TODO

* use Entry type

* use Entry type

* get rid of things not yet released

* clean up

* use generic methods

* TODO comment

* use generic observable

* catch if not found

* move variant id out of property type

* mega refactor temp commit

* Guard Manager

* set readOnly as a property on property editors

* further rename

* remove property state managers

* revert state manager

* fix sorting rule

* mega rename and correction

* refactor properties elements

* todo note

* clean up

* impl

* mega refactor moving permission guards to workspace

* rename

* type change

* rearrange

* correct import

* fix tests

* correct tests

* reset viewGuards block

* type correction

* refactor read only for user permissions setting

* todo note

* align property element

* await promise

* impl view guard property filtering

* correct const name

* fix fallback user permissions in mock data

* correct property type id mock data

* toggle permissions example

* complex permission

* Move migration to 16.0.

* rename fallBackToDisallowed to fallbackToNotPermitted

* clean up setReadOnlyStateForUserPermission

* capital o

* align read only naming

* rename method

* add js docs

* remove unused

* correct method name

* add js docs

* add js docs

* camel case function

* fix eslint problems

* camelcase const

* align method names

* remove unused

* fix host

* fix spelling mistake

* align naming

* fix spelling mistake

* add alias

* use read only state methods

* camel case function

* correct method name

* add js docs

* camelcase function

* camel case function

* align method names

* change method name wording

* Include document property value permissions in the current user's aggregated permissions.

* use is read only

* delete unused

* fix implementation of AllowEditInvariantFromNonDefault

* don't know what is happening here. Local is it lower on github it is higher

* Update document-workspace.context.ts

* revert to v16 dev

* simplify if statement

* make it explicit that these are ui only permissions

* add action label for read

* remove duplicates

* use read instead of browse

* align description

* use document instead of node

* make the base class abstract

* extend in test

* Update guard.manager.base.test.ts

* fix example

* style adjustment

* group styling

* refactor guard rule resolving

* remove imports

* remove console.log

* improve disconnected context consumer rejection message

* fix publishableVariantsFilter

* Update document-workspace.context.ts

---------

Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: kjac <kja@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-04-11 14:16:59 +02:00
Andy Butland
ecbfc72323 Merge branch 'v15/dev' into v16/merge-from-15
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Controllers/PublishedCache/RebuildPublishedCacheController.cs
#	src/Umbraco.Cms.Api.Management/Factories/UserPresentationFactory.cs
#	src/Umbraco.Core/Persistence/Repositories/ITrackedReferencesRepository.cs
#	src/Umbraco.Core/Services/ContentEditingService.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	src/Umbraco.Core/Services/IContentEditingService.cs
#	src/Umbraco.Core/Services/IDataTypeService.cs
#	src/Umbraco.Core/Services/ITrackedReferencesService.cs
#	src/Umbraco.Core/Services/RelationService.cs
#	src/Umbraco.Core/Services/TrackedReferencesService.cs
#	src/Umbraco.Infrastructure/Examine/Deferred/DeliveryApiContentIndexHandleContentTypeChanges.cs
#	src/Umbraco.Infrastructure/Examine/DeliveryApiIndexingHandler.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TrackedReferencesRepository.cs
#	src/Umbraco.Web.UI.Client/src/external/backend-api/src/sdk.gen.ts
#	src/Umbraco.Web.UI.Client/src/mocks/data/document-blueprint/document-blueprint.data.ts
#	src/Umbraco.Web.UI.Client/src/mocks/data/document/document.db.ts
#	src/Umbraco.Web.UI.Client/src/packages/core/router/modal-registration/modal-route-registration.controller.ts
#	src/Umbraco.Web.UI.Client/src/packages/core/router/route/route.context.ts
#	src/Umbraco.Web.UI.Client/src/packages/core/router/route/route.interface.ts
#	src/Umbraco.Web.UI.Client/src/packages/core/router/route/router-slot.element.ts
#	src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot/model.ts
#	src/Umbraco.Web.UI.Client/src/packages/data-type/reference/repository/data-type-reference.server.data.ts
#	src/Umbraco.Web.UI.Client/src/packages/documents/documents/publishing/repository/document-publishing.server.data-source.ts
#	src/Umbraco.Web.UI.Client/src/packages/documents/documents/rollback/entity-action/rollback.action.ts
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.Common/Builders/UserGroupBuilder.cs
#	tests/Umbraco.Tests.Integration/Umbraco.Core/Services/TemporaryFileServiceTests.cs
2025-04-09 22:45:56 +02:00
Niels Lyngsø
ba0028c03d Feature: Use uui invalid color (Awaiting new UUI version) (#18273)
* display validation on save + use uui-color-invalid

* update css vars

* use standalone color for property layout

* remove color from label

* fix badge

* fix create button color

* clean up

* correct badge colors
2025-04-09 10:14:26 +00:00
Jacob Overgaard
7b4bfbb28e Merge branch 'v15/dev' into v16/dev 2025-04-01 10:31:59 +02:00
Niels Lyngsø
ae87f9ccd4 Implement context base for a few last contexts (#18865)
* do not destroy instance

* UmbDashboardHealthCheckElement

* correct last contexts to use context-base

* informing user that Umb.Condition.MenuAlias does not work

* parse host to Section Context
2025-03-31 10:02:25 +02:00
Niels Lyngsø
b9eb988d29 V16/feature: get context resolves in undefined if not found (#18611)
* implement getContext rejecter + allow for resolving in undefined

* fix test

* timeout concept

* adjustments

* adapt implementation

* ability to set timeoutFrame for faster test

* update

* make sure provider only provides when connected

* make sure action apis can fail without resolving

* make sure to await the arrival of the UMB_AUTH_CONTEXT

* no need to be async

* consume to stay up to date

* one rendering cycle approach

* adjusting context consumption part 1

* implementation adjustments

* correction patch 2

* correction patch 3

* correction batch 4

* correction batch 5

* correction batch 6
2025-03-14 14:06:45 +00:00
Niels Lyngsø
2d428cc0fc Hotfix: ensure we export all extension types (#17787)
* export all Extension Manifest Types

* clean up

* lint fix
2024-12-12 12:36:33 +01:00
Niels Lyngsø
5adcc43351 fx imports 2024-11-07 21:45:40 +01:00
Niels Lyngsø
7e7e45c8f6 Merge branch 'main' into 1506-custom-modal
# Conflicts:
#	src/packages/core/modal/component/modal.element.ts
2024-11-07 21:41:54 +01:00
Niels Lyngsø
0ac646517c simplifying 2024-11-07 16:52:53 +01:00
Niels Lyngsø
090a74d9b9 clean up 2024-11-07 15:55:34 +01:00
Niels Lyngsø
a26d49e5b7 clean up 2024-11-07 15:45:45 +01:00
Niels Lyngsø
ce99552975 Merge branch 'main' into routed-modal-issue 2024-11-07 11:20:30 +01:00
Warren Buckley
540f829a2f Fixes duplicate alias that fails npm run compile
Fixes issue when running `npm run compile`

```
examples/ufm-custom-component/index.ts:12:4 - error TS1117: An object literal cannot have multiple properties with the same name.

12    alias: 'myCustomComponent',
      ~~~~~


Found 1 error in examples/ufm-custom-component/index.ts:12
```
2024-11-06 19:35:38 +00:00
Mads Rasmussen
1efff16e39 Merge branch 'release/15.0' 2024-11-06 13:57:17 +01:00
Niels Lyngsø
bd9fa6fb04 Merge branch 'main' into routed-modal-issue
# Conflicts:
#	src/packages/tiny-mce/vite.config.ts
2024-11-05 13:22:35 +01:00
Niels Lyngsø
cc3ad6f3ce Merge branch 'main' into 1506-custom-modal 2024-11-05 13:17:32 +01:00
Niels Lyngsø
8448123c29 fix example 2024-11-05 10:33:55 +01:00
Niels Lyngsø
674c3e85b2 Merge branch 'main' into example-validation-context-server-error 2024-11-05 10:17:15 +01:00
Niels Lyngsø
4dffbf3bcb resolve merge conflict 2024-11-04 15:06:32 +01:00
Warren Buckley
e3d0acc8a2 Adds CONST for 'Umb.Condition.WorkspaceAlias' (#2454)
* Add a const for 'Umb.Condition.WorkspaceAlias'

* Update usages 'Umb.Condition.WorkspaceAlias' of to the new CONST

* Somehow accidently deleted .nvmrc

* Change from 'src/packages/core/workspace/conditions/const.js' to '@umbraco-cms/backoffice/workspace' as the import

* Another fix from the build errors from GitHub - didnt come up locally which was weird

* Update src/packages/core/workspace/conditions/workspace-alias.condition.ts

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>

* Renames the consts as agreed in the PR and adds the deprecated notice

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2024-10-15 09:17:11 +02:00
Markus Johansson
c41a994a07 Merge branch 'main' of https://github.com/umbraco/Umbraco.CMS.Backoffice into 1506-custom-modal 2024-10-14 17:31:08 +02:00
Markus Johansson
68fefbca84 Cleanup, worked on example and added comments 2024-10-14 17:30:10 +02:00
Markus Johansson
caeab9a21b Adjusting custom modal implementation, rename factory, change to support import element 2024-10-14 17:18:49 +02:00
Lee Kelleher
8e39004c59 Chore: Lee's code sweep (during Hacktoberfest '24) (#2450)
* Removed my outdated TODO comments

* Manifest Picker code tidy-up

* Attribute tidy-up

Things I'd picked up during development

* Corrects Storybook control type for `umb-localize` key

* Ran `npm run lint:fix`
2024-10-14 08:44:19 +02:00
Markus Johansson
9844f2d1cd Cleanup example and moved dashboard to content-section 2024-10-11 23:18:10 +02:00
Markus Johansson
dee2a25085 Extended validation demo with multiple tabs
(cherry picked from commit 207dd3e55c8b965ce688057efc36b1594f98f92d)
2024-10-11 23:05:50 +02:00
Markus Johansson
a7c9a024c6 Updated example again to use form. in path 2024-10-10 21:28:25 +02:00
Markus Johansson
33fde19770 Updated example for validation context 2024-10-10 21:12:27 +02:00
Markus Johansson
ba96750ec0 Added example of multiple server errors in single context 2024-10-10 20:57:20 +02:00
Niels Lyngsø
77cb1e39a5 update comment and example 2024-10-08 13:36:56 +02:00
Mads Rasmussen
ebc37ceddd move files 2024-09-30 14:12:26 +02:00
Mads Rasmussen
d1538f205f fix imports 2024-09-30 09:27:17 +02:00
Niels Lyngsø
ac956ceb02 move property editor extension 2024-09-28 21:41:45 +02:00
Niels Lyngsø
133f6d278d correct to use element 2024-09-14 21:02:21 +02:00
Niels Lyngsø
23a5386b5c move workspace extension manifest types 2024-09-14 20:50:52 +02:00
Niels Lyngsø
69cd51e4f3 rename global manifest type 2024-09-13 11:28:06 +02:00
Niels Lyngsø
881625ab78 tsc corrections 2024-09-13 11:23:37 +02:00
Niels Lyngsø
ed93c94cb6 Merge branch 'main' into v14/feature/POC-dynamic-global-manifest-types 2024-09-12 19:24:19 +02:00
Jacob Overgaard
9696441e33 chore: add correct import type to modules 2024-09-12 12:03:05 +02:00
Niels Lyngsø
063c4b3152 move block editor custom view into its own module 2024-08-30 23:13:31 +02:00