mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 15:56:35 +00:00
Remove all exceptions from supervisor localize keys (#13402)
This commit is contained in:
parent
24509425ca
commit
52a1594969
@ -40,6 +40,7 @@ import "../../../../src/components/ha-settings-row";
|
||||
import "../../../../src/components/ha-svg-icon";
|
||||
import "../../../../src/components/ha-switch";
|
||||
import {
|
||||
AddonCapability,
|
||||
fetchHassioAddonChangelog,
|
||||
fetchHassioAddonInfo,
|
||||
HassioAddonDetails,
|
||||
@ -701,7 +702,7 @@ class HassioAddonInfo extends LitElement {
|
||||
}
|
||||
|
||||
private _showMoreInfo(ev): void {
|
||||
const id = ev.currentTarget.id;
|
||||
const id = ev.currentTarget.id as AddonCapability;
|
||||
showHassioMarkdownDialog(this, {
|
||||
title: this.supervisor.localize(`addon.dashboard.capability.${id}.title`),
|
||||
content:
|
||||
|
@ -17,9 +17,12 @@ import {
|
||||
} from "../../../src/data/hassio/backup";
|
||||
import { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||
import { PolymerChangedEvent } from "../../../src/polymer-types";
|
||||
import { HomeAssistant } from "../../../src/types";
|
||||
import { HomeAssistant, TranslationDict } from "../../../src/types";
|
||||
import "./supervisor-formfield-label";
|
||||
|
||||
type BackupOrRestoreKey = keyof TranslationDict["supervisor"]["backup"] &
|
||||
keyof TranslationDict["ui"]["panel"]["page-onboarding"]["restore"];
|
||||
|
||||
interface CheckboxItem {
|
||||
slug: string;
|
||||
checked: boolean;
|
||||
@ -108,9 +111,9 @@ export class SupervisorBackupContent extends LitElement {
|
||||
this._focusTarget?.focus();
|
||||
}
|
||||
|
||||
private _localize = (string: string) =>
|
||||
this.supervisor?.localize(`backup.${string}`) ||
|
||||
this.localize!(`ui.panel.page-onboarding.restore.${string}`);
|
||||
private _localize = (key: BackupOrRestoreKey) =>
|
||||
this.supervisor?.localize(`backup.${key}`) ||
|
||||
this.localize!(`ui.panel.page-onboarding.restore.${key}`);
|
||||
|
||||
protected render(): TemplateResult {
|
||||
if (!this.onboarding && !this.supervisor) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { atLeastVersion } from "../../common/config/version";
|
||||
import type { HaFormSchema } from "../../components/ha-form/types";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { HomeAssistant, TranslationDict } from "../../types";
|
||||
import { supervisorApiCall } from "../supervisor/common";
|
||||
import { StoreAddonDetails } from "../supervisor/store";
|
||||
import { Supervisor, SupervisorArch } from "../supervisor/supervisor";
|
||||
@ -10,6 +10,10 @@ import {
|
||||
HassioResponse,
|
||||
} from "./common";
|
||||
|
||||
export type AddonCapability = Exclude<
|
||||
keyof TranslationDict["supervisor"]["addon"]["dashboard"]["capability"],
|
||||
"label" | "role" | "stages"
|
||||
>;
|
||||
export type AddonStage = "stable" | "experimental" | "deprecated";
|
||||
export type AddonAppArmour = "disable" | "default" | "profile";
|
||||
export type AddonRole = "default" | "homeassistant" | "manager" | "admin";
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { atLeastVersion } from "../../common/config/version";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { HomeAssistant, TranslationDict } from "../../types";
|
||||
import { hassioApiResultExtractor, HassioResponse } from "./common";
|
||||
|
||||
export interface HassioResolution {
|
||||
unsupported: string[];
|
||||
unhealthy: string[];
|
||||
unsupported: (keyof TranslationDict["supervisor"]["system"]["supervisor"]["unsupported_reason"])[];
|
||||
unhealthy: (keyof TranslationDict["supervisor"]["system"]["supervisor"]["unhealthy_reason"])[];
|
||||
issues: string[];
|
||||
suggestions: string[];
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { AddonStage } from "../hassio/addon";
|
||||
import { AddonRole, AddonStage } from "../hassio/addon";
|
||||
import { supervisorApiCall } from "./common";
|
||||
import { SupervisorArch } from "./supervisor";
|
||||
|
||||
@ -31,7 +31,7 @@ export interface StoreAddonDetails extends StoreAddon {
|
||||
documentation: boolean;
|
||||
full_access: boolean;
|
||||
hassio_api: boolean;
|
||||
hassio_role: string;
|
||||
hassio_role: AddonRole;
|
||||
homeassistant_api: boolean;
|
||||
host_network: boolean;
|
||||
host_pid: boolean;
|
||||
|
@ -60,9 +60,7 @@ export interface SupervisorEvent {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type SupervisorKeys =
|
||||
| FlattenObjectKeys<TranslationDict["supervisor"]>
|
||||
| `${keyof TranslationDict["supervisor"]}.${string}`;
|
||||
export type SupervisorKeys = FlattenObjectKeys<TranslationDict["supervisor"]>;
|
||||
|
||||
export interface Supervisor {
|
||||
host: HassioHostInfo;
|
||||
|
@ -4564,6 +4564,7 @@
|
||||
"hide_log": "Hide full log",
|
||||
"full_backup": "[%key:supervisor::backup::full_backup%]",
|
||||
"partial_backup": "[%key:supervisor::backup::partial_backup%]",
|
||||
"name": "[%key:supervisor::backup::name%]",
|
||||
"type": "[%key:supervisor::backup::type%]",
|
||||
"select_type": "[%key:supervisor::backup::select_type%]",
|
||||
"folders": "[%key:supervisor::backup::folders%]",
|
||||
|
Loading…
x
Reference in New Issue
Block a user