Skip to content

Commit fccd203

Browse files
committed
refactor to use hidden as the property for legacy and internal icons
1 parent f2b337a commit fccd203

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Umbraco.Web.UI.Client/devops/icons/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const collectDictionaryIcons = async () => {
4747
const icon = {
4848
name: iconDef.name,
4949
legacy: iconDef.legacy,
50+
hidden: iconDef.legacy ?? iconDef.internal,
5051
fileName: iconFileName,
5152
svg,
5253
output: `${iconsOutputDirectory}/${iconFileName}.ts`,

src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-registry.context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class UmbIconRegistryContext extends UmbContextBase<UmbIconRegistryContex
1313
#manifestMap = new Map();
1414
#icons = new UmbArrayState<UmbIconDefinition>([], (x) => x.name);
1515
readonly icons = this.#icons.asObservable();
16-
readonly approvedIcons = this.#icons.asObservablePart((icons) => icons.filter((x) => x.legacy !== true));
16+
readonly approvedIcons = this.#icons.asObservablePart((icons) => icons.filter((x) => x.hidden !== true));
1717

1818
constructor(host: UmbControllerHost) {
1919
super(host, UMB_ICON_REGISTRY_CONTEXT);

src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ export type * from './extensions/icons.extension.js';
55
export interface UmbIconDefinition<JsType = any> {
66
name: string;
77
path: JsLoaderProperty<JsType>;
8+
/**
9+
* @deprecated `legacy` is deprecated and will be removed in v.17. Use `hidden` instead.
10+
*/
811
legacy?: boolean;
12+
hidden?: boolean;
913
}
1014

1115
export type UmbIconDictionary = Array<UmbIconDefinition>;

0 commit comments

Comments
 (0)