Skip to content

Commit

Permalink
fix: adjust link of help icon in editor card (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
idaho committed Dec 15, 2023
1 parent 7f831c8 commit 2765e49
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cards/trash-card/trash-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { HassEntity } from 'home-assistant-js-websocket';
import { loadHaComponents } from 'lovelace-mushroom/src/utils/loader';
import { normaliseEvents } from '../../utils/normaliseEvents';
import type { RawCalendarEvent } from '../../utils/calendarEvents';
import { registerCustomCard } from 'lovelace-mushroom/src/utils/custom-cards';
import { registerCustomCard } from '../../utils/registerCustomCard';
import setupCustomlocalize from '../../localize';
import { styleMap } from 'lit/directives/style-map.js';
import type { TrashCardConfig } from './trash-card-config';
Expand Down
28 changes: 28 additions & 0 deletions src/utils/registerCustomCard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { repository } from '../../package.json';

interface RegisterCardParams {
type: string;
name: string;
description: string;
}
const registerCustomCard = (params: RegisterCardParams) => {
const windowWithCards = window as unknown as Window & {
customCards: unknown[];
};

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
windowWithCards.customCards = windowWithCards.customCards || [];

// Const cardPage = params.type.replace('-card', '').replace('mushroom-', '');

windowWithCards.customCards.push({
...params,
preview: true,
// eslint-disable-next-line @typescript-eslint/naming-convention
documentationURL: `${repository.url}/blob/main/README.md`
});
};

export {
registerCustomCard
};

0 comments on commit 2765e49

Please sign in to comment.