mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Relocate stuff under sub-features for application update
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
0eeca9386f
commit
1d267c63fd
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import restartAndInstallUpdateInjectable from "../update-button/restart-and-install-update.injectable";
|
import restartAndInstallUpdateInjectable from "../restart-and-install-update.injectable";
|
||||||
import { Countdown } from "../../../../renderer/components/countdown/countdown";
|
import { Countdown } from "../../../../renderer/components/countdown/countdown";
|
||||||
import type { IComputedValue } from "mobx";
|
import type { IComputedValue } from "mobx";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import countdownStateInjectable from "../../../../renderer/components/countdown/countdown-state.injectable";
|
import countdownStateInjectable from "../../../../renderer/components/countdown/countdown-state.injectable";
|
||||||
import secondsAfterInstallStartsInjectable from "./seconds-after-install-starts.injectable";
|
import secondsAfterInstallStartsInjectable from "./seconds-after-install-starts.injectable";
|
||||||
import restartAndInstallUpdateInjectable from "../update-button/restart-and-install-update.injectable";
|
import restartAndInstallUpdateInjectable from "../restart-and-install-update.injectable";
|
||||||
|
|
||||||
const installUpdateCountdownInjectable = getInjectable({
|
const installUpdateCountdownInjectable = getInjectable({
|
||||||
id: "install-update-countdown",
|
id: "install-update-countdown",
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import restartAndInstallUpdateChannel from "../../common/restart-and-install-update-channel/restart-and-install-update-channel.injectable";
|
import restartAndInstallUpdateChannel from "../common/restart-and-install-update-channel/restart-and-install-update-channel.injectable";
|
||||||
import messageToChannelInjectable from "../../../../renderer/utils/channel/message-to-channel.injectable";
|
import messageToChannelInjectable from "../../../renderer/utils/channel/message-to-channel.injectable";
|
||||||
|
|
||||||
const restartAndInstallUpdateInjectable = getInjectable({
|
const restartAndInstallUpdateInjectable = getInjectable({
|
||||||
id: "restart-and-install-update",
|
id: "restart-and-install-update",
|
||||||
@ -6,17 +6,17 @@ import type { AsyncFnMock } from "@async-fn/jest";
|
|||||||
import asyncFn from "@async-fn/jest";
|
import asyncFn from "@async-fn/jest";
|
||||||
import type { RenderResult } from "@testing-library/react";
|
import type { RenderResult } from "@testing-library/react";
|
||||||
import { act } from "@testing-library/react";
|
import { act } from "@testing-library/react";
|
||||||
import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable";
|
import type { CheckForPlatformUpdates } from "../../main/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||||
import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable";
|
import checkForPlatformUpdatesInjectable from "../../main/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||||
import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable";
|
import type { DownloadPlatformUpdate } from "../../main/download-platform-update/download-platform-update.injectable";
|
||||||
import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable";
|
import downloadPlatformUpdateInjectable from "../../main/download-platform-update/download-platform-update.injectable";
|
||||||
import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable";
|
import publishIsConfiguredInjectable from "../../main/publish-is-configured.injectable";
|
||||||
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
|
import electronUpdaterIsActiveInjectable from "../../../../main/electron-app/features/electron-updater-is-active.injectable";
|
||||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import type { ApplicationBuilder } from "../../../../renderer/components/test-utils/get-application-builder";
|
||||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import { getApplicationBuilder } from "../../../../renderer/components/test-utils/get-application-builder";
|
||||||
import processCheckingForUpdatesInjectable from "./main/check-for-updates/process-checking-for-updates.injectable";
|
import processCheckingForUpdatesInjectable from "../../main/check-for-updates/process-checking-for-updates.injectable";
|
||||||
import quitAndInstallUpdateInjectable from "./main/quit-and-install-update.injectable";
|
import quitAndInstallUpdateInjectable from "../../main/quit-and-install-update.injectable";
|
||||||
import { advanceFakeTime, useFakeTime } from "../../common/test-utils/use-fake-time";
|
import { advanceFakeTime, useFakeTime } from "../../../../common/test-utils/use-fake-time";
|
||||||
|
|
||||||
|
|
||||||
function daysToMilliseconds(days: number) {
|
function daysToMilliseconds(days: number) {
|
||||||
@ -7,14 +7,14 @@ import styles from "./styles.module.scss";
|
|||||||
|
|
||||||
import type { HTMLAttributes } from "react";
|
import type { HTMLAttributes } from "react";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { Menu, MenuItem } from "../../../../renderer/components/menu";
|
import { Menu, MenuItem } from "../../../../../../renderer/components/menu";
|
||||||
import { cssNames } from "../../../../renderer/utils";
|
import { cssNames } from "../../../../../../renderer/utils";
|
||||||
import type { IconProps } from "../../../../renderer/components/icon";
|
import type { IconProps } from "../../../../../../renderer/components/icon";
|
||||||
import { Icon } from "../../../../renderer/components/icon";
|
import { Icon } from "../../../../../../renderer/components/icon";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import type { IComputedValue } from "mobx";
|
import type { IComputedValue } from "mobx";
|
||||||
import restartAndInstallUpdateInjectable from "./restart-and-install-update.injectable";
|
import restartAndInstallUpdateInjectable from "../../../../renderer/restart-and-install-update.injectable";
|
||||||
import updateWarningLevelInjectable from "./update-warning-level.injectable";
|
import updateWarningLevelInjectable from "./update-warning-level.injectable";
|
||||||
|
|
||||||
interface UpdateButtonProps extends HTMLAttributes<HTMLButtonElement> {}
|
interface UpdateButtonProps extends HTMLAttributes<HTMLButtonElement> {}
|
||||||
@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import updateDownloadedDateTimeInjectable from "../../common/update-downloaded-date-time/update-downloaded-date-time.injectable";
|
import updateDownloadedDateTimeInjectable from "../../../../common/update-downloaded-date-time/update-downloaded-date-time.injectable";
|
||||||
import { reactiveNow } from "../../../../common/utils/reactive-now/reactive-now";
|
import { reactiveNow } from "../../../../../../common/utils/reactive-now/reactive-now";
|
||||||
|
|
||||||
const updateWarningLevelInjectable = getInjectable({
|
const updateWarningLevelInjectable = getInjectable({
|
||||||
id: "update-warning-level",
|
id: "update-warning-level",
|
||||||
@ -2,18 +2,18 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import type { ApplicationBuilder } from "../../../../renderer/components/test-utils/get-application-builder";
|
||||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
import { getApplicationBuilder } from "../../../../renderer/components/test-utils/get-application-builder";
|
||||||
import type { RenderResult } from "@testing-library/react";
|
import type { RenderResult } from "@testing-library/react";
|
||||||
import electronUpdaterIsActiveInjectable from "../../main/electron-app/features/electron-updater-is-active.injectable";
|
import electronUpdaterIsActiveInjectable from "../../../../main/electron-app/features/electron-updater-is-active.injectable";
|
||||||
import publishIsConfiguredInjectable from "./main/publish-is-configured.injectable";
|
import publishIsConfiguredInjectable from "../../main/publish-is-configured.injectable";
|
||||||
import type { CheckForPlatformUpdates } from "./main/check-for-platform-updates/check-for-platform-updates.injectable";
|
import type { CheckForPlatformUpdates } from "../../main/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||||
import checkForPlatformUpdatesInjectable from "./main/check-for-platform-updates/check-for-platform-updates.injectable";
|
import checkForPlatformUpdatesInjectable from "../../main/check-for-platform-updates/check-for-platform-updates.injectable";
|
||||||
import type { AsyncFnMock } from "@async-fn/jest";
|
import type { AsyncFnMock } from "@async-fn/jest";
|
||||||
import asyncFn from "@async-fn/jest";
|
import asyncFn from "@async-fn/jest";
|
||||||
import type { DownloadPlatformUpdate } from "./main/download-platform-update/download-platform-update.injectable";
|
import type { DownloadPlatformUpdate } from "../../main/download-platform-update/download-platform-update.injectable";
|
||||||
import downloadPlatformUpdateInjectable from "./main/download-platform-update/download-platform-update.injectable";
|
import downloadPlatformUpdateInjectable from "../../main/download-platform-update/download-platform-update.injectable";
|
||||||
import showApplicationWindowInjectable from "../../main/start-main-application/lens-window/show-application-window.injectable";
|
import showApplicationWindowInjectable from "../../../../main/start-main-application/lens-window/show-application-window.injectable";
|
||||||
|
|
||||||
describe("installing update using tray", () => {
|
describe("installing update using tray", () => {
|
||||||
let applicationBuilder: ApplicationBuilder;
|
let applicationBuilder: ApplicationBuilder;
|
||||||
@ -4,18 +4,18 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import updatingIsEnabledInjectable from "./updating-is-enabled.injectable";
|
import updatingIsEnabledInjectable from "../../../main/updating-is-enabled.injectable";
|
||||||
import { trayMenuItemInjectionToken } from "../../tray/main/tray-menu-item/tray-menu-item-injection-token";
|
import { trayMenuItemInjectionToken } from "../../../../tray/main/tray-menu-item/tray-menu-item-injection-token";
|
||||||
import showApplicationWindowInjectable from "../../../main/start-main-application/lens-window/show-application-window.injectable";
|
import showApplicationWindowInjectable from "../../../../../main/start-main-application/lens-window/show-application-window.injectable";
|
||||||
import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable";
|
import discoveredUpdateVersionInjectable from "../../../common/discovered-update-version/discovered-update-version.injectable";
|
||||||
import updateIsBeingDownloadedInjectable from "../common/update-is-being-downloaded/update-is-being-downloaded.injectable";
|
import updateIsBeingDownloadedInjectable from "../../../common/update-is-being-downloaded/update-is-being-downloaded.injectable";
|
||||||
import updatesAreBeingDiscoveredInjectable from "../common/updates-are-being-discovered/updates-are-being-discovered.injectable";
|
import updatesAreBeingDiscoveredInjectable from "../../../common/updates-are-being-discovered/updates-are-being-discovered.injectable";
|
||||||
import progressOfUpdateDownloadInjectable from "../common/progress-of-update-download/progress-of-update-download.injectable";
|
import progressOfUpdateDownloadInjectable from "../../../common/progress-of-update-download/progress-of-update-download.injectable";
|
||||||
import assert from "assert";
|
import assert from "assert";
|
||||||
import processCheckingForUpdatesInjectable from "./check-for-updates/process-checking-for-updates.injectable";
|
import processCheckingForUpdatesInjectable from "../../../main/check-for-updates/process-checking-for-updates.injectable";
|
||||||
import { withErrorSuppression } from "../../../common/utils/with-error-suppression/with-error-suppression";
|
import { withErrorSuppression } from "../../../../../common/utils/with-error-suppression/with-error-suppression";
|
||||||
import { pipeline } from "@ogre-tools/fp";
|
import { pipeline } from "@ogre-tools/fp";
|
||||||
import withErrorLoggingInjectable from "../../../common/utils/with-error-logging/with-error-logging.injectable";
|
import withErrorLoggingInjectable from "../../../../../common/utils/with-error-logging/with-error-logging.injectable";
|
||||||
|
|
||||||
const checkForUpdatesTrayItemInjectable = getInjectable({
|
const checkForUpdatesTrayItemInjectable = getInjectable({
|
||||||
id: "check-for-updates-tray-item",
|
id: "check-for-updates-tray-item",
|
||||||
@ -4,10 +4,10 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import getTrayIconPathInjectable from "../../../tray/main/menu-icon/get-tray-icon-path.injectable";
|
import getTrayIconPathInjectable from "../../../../../tray/main/menu-icon/get-tray-icon-path.injectable";
|
||||||
import { trayIconInjectionToken } from "../../../tray/main/menu-icon/tray-icon-injection-token";
|
import { trayIconInjectionToken } from "../../../../../tray/main/menu-icon/tray-icon-injection-token";
|
||||||
import updatesAreBeingDiscoveredInjectable from "../../common/updates-are-being-discovered/updates-are-being-discovered.injectable";
|
import updatesAreBeingDiscoveredInjectable from "../../../../common/updates-are-being-discovered/updates-are-being-discovered.injectable";
|
||||||
import updateIsBeingDownloadedInjectable from "../../common/update-is-being-downloaded/update-is-being-downloaded.injectable";
|
import updateIsBeingDownloadedInjectable from "../../../../common/update-is-being-downloaded/update-is-being-downloaded.injectable";
|
||||||
|
|
||||||
const checkingForUpdatesTrayIconInjectable = getInjectable({
|
const checkingForUpdatesTrayIconInjectable = getInjectable({
|
||||||
id: "checking-for-updates-tray-icon",
|
id: "checking-for-updates-tray-icon",
|
||||||
@ -3,9 +3,9 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import getTrayIconPathInjectable from "../../../tray/main/menu-icon/get-tray-icon-path.injectable";
|
import getTrayIconPathInjectable from "../../../../../tray/main/menu-icon/get-tray-icon-path.injectable";
|
||||||
import { trayIconInjectionToken } from "../../../tray/main/menu-icon/tray-icon-injection-token";
|
import { trayIconInjectionToken } from "../../../../../tray/main/menu-icon/tray-icon-injection-token";
|
||||||
import updateIsReadyToBeInstalledInjectable from "../update-is-ready-to-be-installed.injectable";
|
import updateIsReadyToBeInstalledInjectable from "../../../../main/update-is-ready-to-be-installed.injectable";
|
||||||
|
|
||||||
const updateIsReadyToBeInstalledTrayIconInjectable = getInjectable({
|
const updateIsReadyToBeInstalledTrayIconInjectable = getInjectable({
|
||||||
id: "update-is-ready-to-be-installed-tray-icon",
|
id: "update-is-ready-to-be-installed-tray-icon",
|
||||||
@ -4,13 +4,13 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { computed } from "mobx";
|
import { computed } from "mobx";
|
||||||
import { trayMenuItemInjectionToken } from "../../tray/main/tray-menu-item/tray-menu-item-injection-token";
|
import { trayMenuItemInjectionToken } from "../../../../tray/main/tray-menu-item/tray-menu-item-injection-token";
|
||||||
import discoveredUpdateVersionInjectable from "../common/discovered-update-version/discovered-update-version.injectable";
|
import discoveredUpdateVersionInjectable from "../../../common/discovered-update-version/discovered-update-version.injectable";
|
||||||
import { withErrorSuppression } from "../../../common/utils/with-error-suppression/with-error-suppression";
|
import { withErrorSuppression } from "../../../../../common/utils/with-error-suppression/with-error-suppression";
|
||||||
import { pipeline } from "@ogre-tools/fp";
|
import { pipeline } from "@ogre-tools/fp";
|
||||||
import withErrorLoggingInjectable from "../../../common/utils/with-error-logging/with-error-logging.injectable";
|
import withErrorLoggingInjectable from "../../../../../common/utils/with-error-logging/with-error-logging.injectable";
|
||||||
import quitAndInstallUpdateInjectable from "./quit-and-install-update.injectable";
|
import quitAndInstallUpdateInjectable from "../../../main/quit-and-install-update.injectable";
|
||||||
import updateIsReadyToBeInstalledInjectable from "./update-is-ready-to-be-installed.injectable";
|
import updateIsReadyToBeInstalledInjectable from "../../../main/update-is-ready-to-be-installed.injectable";
|
||||||
|
|
||||||
const installApplicationUpdateTrayItemInjectable = getInjectable({
|
const installApplicationUpdateTrayItemInjectable = getInjectable({
|
||||||
id: "install-update-tray-item",
|
id: "install-update-tray-item",
|
||||||
@ -18,7 +18,7 @@ import type { NavigateToCatalog } from "../../../../common/front-end-routing/rou
|
|||||||
import navigateToCatalogInjectable from "../../../../common/front-end-routing/routes/catalog/navigate-to-catalog.injectable";
|
import navigateToCatalogInjectable from "../../../../common/front-end-routing/routes/catalog/navigate-to-catalog.injectable";
|
||||||
import catalogRouteInjectable from "../../../../common/front-end-routing/routes/catalog/catalog-route.injectable";
|
import catalogRouteInjectable from "../../../../common/front-end-routing/routes/catalog/catalog-route.injectable";
|
||||||
import routeIsActiveInjectable from "../../../routes/route-is-active.injectable";
|
import routeIsActiveInjectable from "../../../routes/route-is-active.injectable";
|
||||||
import { UpdateButton } from "../../../../behaviours/application-update/renderer/update-button";
|
import { UpdateButton } from "../../../../behaviours/application-update/sub-features/top-bar/renderer/update-button";
|
||||||
import topBarPrevEnabledInjectable from "./prev-enabled.injectable";
|
import topBarPrevEnabledInjectable from "./prev-enabled.injectable";
|
||||||
import topBarNextEnabledInjectable from "./next-enabled.injectable";
|
import topBarNextEnabledInjectable from "./next-enabled.injectable";
|
||||||
import openAppContextMenuInjectable from "./open-app-context-menu.injectable";
|
import openAppContextMenuInjectable from "./open-app-context-menu.injectable";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user