Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/202302 improv #1419

Merged
merged 8 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions documentation/static/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11062,6 +11062,60 @@
"parameters": [],
"extensions": {}
},
"/api/trash/detect-to-use-system-trash": {
"operations": {
"Get": {
"tags": [
{
"name": "Trash",
"extensions": {},
"unresolvedReference": false
}
],
"parameters": [],
"responses": {
"200": {
"description": "Success",
"headers": {},
"content": {
"application/json": {
"schema": {
"type": "boolean",
"readOnly": false,
"writeOnly": false,
"allOf": [],
"oneOf": [],
"anyOf": [],
"required": [],
"properties": {},
"additionalPropertiesAllowed": true,
"enum": [],
"nullable": false,
"deprecated": false,
"extensions": {},
"unresolvedReference": false
},
"examples": {},
"encoding": {},
"extensions": {}
}
},
"links": {},
"extensions": {},
"unresolvedReference": false
}
},
"callbacks": {},
"deprecated": false,
"security": [],
"servers": [],
"extensions": {}
}
},
"servers": [],
"parameters": [],
"extensions": {}
},
"/api/upload": {
"operations": {
"Post": {
Expand Down
3 changes: 2 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Semantic Versioning 2.0.0 is from version 0.1.6+
- [x] (Added) _Back-end_ Add role to info api (PR #1381)
- [x] (Added) _Front-end_ Add settings for Open File (PR #1381)
- [x] (Added) _Back-end_ rename starsky core to starsky.project.web (PR #1381)
- [x] (Removed) _Back-end_ Remove /api/trash/detect-to-use-system-trash (PR #1381)
- [x] (Changed) _Back-end_ Keep /api/trash/detect-to-use-system-trash although its rm here (PR #1381)
- [x] (Removed) _Back-end_ Remove verbose option in UI (setting is hidden now) (PR #1381)
- [x] (Added) _Front-end_ German translations (PR #1381)
- [x] (Added) _Front-end_ command + shift + k go to settings now (PR #1381)
Expand All @@ -61,6 +61,7 @@ Semantic Versioning 2.0.0 is from version 0.1.6+
- [x] (Added) _App_ Add 'App Settings' to the menu (PR #1381)
- [x] (Added) _Front-end_ Add warning when opening a lot pictures at one: "Do you really want to
edit all of the selected photos?" (PR #1381)
- [x] (Changed) _Front-end_ isRelativeUrl check for redirect (PR #1419)

## version 0.6.0-beta.1 - 2024-02-18 {#v0.6.0-beta.1}

Expand Down
2 changes: 1 addition & 1 deletion starsky-tools/end2end/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ Task<List<FileIndexItem>> MoveToTrashAsync(List<string> inputFilePaths,
/// </summary>
/// <returns>Should you use it?</returns>
bool IsEnabled();

/// <summary>
/// Is it supported to use the system trash
/// But it does NOT check if the feature toggle is enabled
/// Used by End2End test to enable system trash if supported on the platform
/// </summary>
/// <returns>true if supported</returns>
public bool DetectToUseSystemTrash();
}
11 changes: 11 additions & 0 deletions starsky/starsky.feature.trash/Services/MoveToTrashService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,15 @@ private async Task SystemTrashInQueue(List<FileIndexItem> moveToTrash)

await _query.RemoveItemAsync(moveToTrash);
}

/// <summary>
/// Is it supported to use the system trash
/// But it does NOT check if the feature toggle is enabled
/// Used for end2end test to check if it an option to enable / disable the system trash
/// </summary>
/// <returns>true if supported</returns>
public bool DetectToUseSystemTrash()
{
return _systemTrashService.DetectToUseSystemTrash();
}
}
15 changes: 15 additions & 0 deletions starsky/starsky/Controllers/TrashController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,19 @@ public async Task<IActionResult> TrashMoveAsync(string f, bool collections = fal

return Json(fileIndexResultsList);
}

/// <summary>
/// Is the system trash supported
/// Used in End2End tests to enable or disable the trash
/// </summary>
/// <returns>bool with json (IActionResult Result)</returns>
/// <response code="200">the item including the updated content</response>
/// <response code="401">User unauthorized</response>
[ProducesResponseType(typeof(bool), 200)]
[HttpGet("/api/trash/detect-to-use-system-trash")]
[Produces("application/json")]
public IActionResult DetectToUseSystemTrash()
{
return Json(_moveToTrashService.DetectToUseSystemTrash());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IExifStatus } from "../../../interfaces/IExifStatus";
import { Orientation } from "../../../interfaces/IFileIndexItem";
import * as DetectAutomaticRotation from "../../../shared/detect-automatic-rotation";
import * as FetchGet from "../../../shared/fetch/fetch-get";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import FileHashImage from "./file-hash-image";
import * as PanAndZoomImage from "./pan-and-zoom-image";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { Orientation } from "../../../interfaces/IFileIndexItem";
import DetectAutomaticRotation from "../../../shared/detect-automatic-rotation";
import FetchGet from "../../../shared/fetch/fetch-get";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import PanAndZoomImage from "./pan-and-zoom-image";

export interface IFileHashImageProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEvent, fireEvent, render, screen, waitFor } from "@testing-library/react";
import * as useIntersection from "../../../hooks/use-intersection-observer";
import { ImageFormat } from "../../../interfaces/IFileIndexItem";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import ListImage from "./list-image";

jest.mock("../../../hooks/use-intersection-observer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { memo, useEffect, useRef, useState } from "react";
import useIntersection from "../../../hooks/use-intersection-observer";
import useLocation from "../../../hooks/use-location/use-location";
import { ImageFormat } from "../../../interfaces/IFileIndexItem";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";

interface IListImageProps {
children?: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useLocation from "../../../hooks/use-location/use-location";
import { IRelativeObjects } from "../../../interfaces/IDetailView";
import localization from "../../../localization/localization.json";
import { Language } from "../../../shared/language";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import Link from "../../atoms/link/link";

interface IRelativeLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useLocation from "../../../hooks/use-location/use-location";
import { PageType } from "../../../interfaces/IDetailView";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import { FileListCache } from "../../../shared/filelist-cache";
import { URLPath } from "../../../shared/url-path";
import { URLPath } from "../../../shared/url/url-path";
import ColorClassSelect from "../color-class-select/color-class-select";

interface IArchiveSidebarColorClassProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import { Router } from "../../../router-app/router-app";
import * as FetchPost from "../../../shared/fetch/fetch-post";
import { Keyboard } from "../../../shared/keyboard";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import * as Notification from "../../atoms/notification/notification";
import ArchiveSidebarLabelEditAddOverwrite from "./archive-sidebar-label-edit-add-overwrite";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { Keyboard } from "../../../shared/keyboard";
import { Language } from "../../../shared/language";
import { ClearSearchCache } from "../../../shared/search/clear-search-cache";
import { SidebarUpdate } from "../../../shared/sidebar-update";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import FormControl from "../../atoms/form-control/form-control";
import Notification, { NotificationType } from "../../atoms/notification/notification";
import Preloader from "../../atoms/preloader/preloader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IExifStatus } from "../../../interfaces/IExifStatus";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import { Router } from "../../../router-app/router-app";
import * as FetchPost from "../../../shared/fetch/fetch-post";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import * as Notification from "../../atoms/notification/notification";
import ArchiveSidebarLabelEditSearchReplace from "./archive-sidebar-label-edit-search-replace";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import FetchPost from "../../../shared/fetch/fetch-post";
import { Language } from "../../../shared/language";
import { ClearSearchCache } from "../../../shared/search/clear-search-cache";
import { SidebarUpdate } from "../../../shared/sidebar-update";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import FormControl from "../../atoms/form-control/form-control";
import Notification, { NotificationType } from "../../atoms/notification/notification";
import Preloader from "../../atoms/preloader/preloader";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { act, createEvent, fireEvent, render, screen } from "@testing-library/react";
import { IFileIndexItem, newIFileIndexItemArray } from "../../../interfaces/IFileIndexItem";
import { Router } from "../../../router-app/router-app";
import { URLPath } from "../../../shared/url-path";
import { URLPath } from "../../../shared/url/url-path";
import ArchiveSidebarSelectionList from "./archive-sidebar-selection-list";
describe("archive-sidebar-selection-list", () => {
it("renders", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import localization from "../../../localization/localization.json";
import { Language } from "../../../shared/language";
import { Select } from "../../../shared/select";
import { URLPath } from "../../../shared/url-path";
import { URLPath } from "../../../shared/url/url-path";

interface IDetailViewSidebarSelectionListProps {
fileIndexItems: Array<IFileIndexItem>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { memo } from "react";
import useLocation from "../../../hooks/use-location/use-location";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import Link from "../../atoms/link/link";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { act, render, screen } from "@testing-library/react";
import { MemoryRouter } from "react-router-dom";
import { Router } from "../../../router-app/router-app";
import { URLPath } from "../../../shared/url-path";
import { URLPath } from "../../../shared/url/url-path";
import ColorClassFilter from "./color-class-filter";
describe("ColorClassFilter", () => {
it("renders", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { URLPath } from "../../../../shared/url-path";
import { URLPath } from "../../../../shared/url/url-path";

export function CleanColorClass(propsSubPath: string, historyLocationSearch: string): string {
if (!propsSubPath) return "/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { URLPath } from "../../../../shared/url-path.ts";
import { SelectCheckIfActive } from "../../../../shared/select-check-if-active.ts";
import { IArchiveProps } from "../../../../interfaces/IArchiveProps.ts";
import { SelectCheckIfActive } from "../../../../shared/select-check-if-active.ts";
import { URLPath } from "../../../../shared/url/url-path.ts";

export function GetFilterUrlColorClass(
item: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IExifStatus } from "../../../interfaces/IExifStatus";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import * as FetchPost from "../../../shared/fetch/fetch-post";
import { Keyboard } from "../../../shared/keyboard";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import ColorClassSelectKeyboard from "./color-class-select-keyboard";
import * as ColorClassUpdateSingle from "./color-class-update-single";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IConnectionDefault, newIConnectionDefault } from "../../../interfaces/I
import { IExifStatus } from "../../../interfaces/IExifStatus";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import * as FetchPost from "../../../shared/fetch/fetch-post";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import * as Notification from "../../atoms/notification/notification";
import ColorClassSelect from "./color-class-select";
import * as ColorClassUpdateSingle from "./color-class-update-single";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import localization from "../../../localization/localization.json";
import { CastToInterface } from "../../../shared/cast-to-interface";
import FetchPost from "../../../shared/fetch/fetch-post";
import { Language, SupportedLanguages } from "../../../shared/language";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";

export class ColorClassUpdateSingle {
private isEnabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { IConnectionDefault, newIConnectionDefault } from "../../../interfaces/I
import { PageType } from "../../../interfaces/IDetailView";
import * as FetchGet from "../../../shared/fetch/fetch-get";
import * as FetchPost from "../../../shared/fetch/fetch-post";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import ForceSyncWaitButton, { ForceSyncRequestNewContent } from "./force-sync-wait-button";

describe("ForceSyncWaitButton", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import FetchGet from "../../../shared/fetch/fetch-get";
import FetchPost from "../../../shared/fetch/fetch-post";
import { FileListCache } from "../../../shared/filelist-cache";
import { Language } from "../../../shared/language";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import Preloader from "../../atoms/preloader/preloader";

type ForceSyncWaitButtonPropTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import localization from "../../../localization/localization.json";
import { BrowserDetect } from "../../../shared/browser-detect";
import { DifferenceInDate } from "../../../shared/date";
import { Language } from "../../../shared/language";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import Notification, { NotificationType } from "../../atoms/notification/notification";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useGlobalSettings from "../../../hooks/use-global-settings";
import { IHealthEntry } from "../../../interfaces/IHealthEntry";
import localization from "../../../localization/localization.json";
import { Language } from "../../../shared/language";
import { UrlQuery } from "../../../shared/url-query";
import { UrlQuery } from "../../../shared/url/url-query";
import Notification, { NotificationType } from "../../atoms/notification/notification";

const HealthStatusError: React.FunctionComponent = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { IDetailView } from "../../../interfaces/IDetailView";
import { INavigateState } from "../../../interfaces/INavigateState";
import localization from "../../../localization/localization.json";
import { Language } from "../../../shared/language";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import Link from "../../atoms/link/link";

type IsSearchQueryMenuSearchItemProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IUseLocation } from "../../../../hooks/use-location/interfaces/IUseLocation";
import { IFileIndexItem } from "../../../../interfaces/IFileIndexItem";
import { URLPath } from "../../../../shared/url-path";
import { URLPath } from "../../../../shared/url/url-path";

/**
* Find the value that is the closest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PageType } from "../../../../interfaces/IDetailView";
import { IFileIndexItem } from "../../../../interfaces/IFileIndexItem";
import localization from "../../../../localization/localization.json";
import { Language } from "../../../../shared/language";
import { UrlQuery } from "../../../../shared/url-query.ts";
import { UrlQuery } from "../../../../shared/url/url-query.ts";

interface IWarningBoxNoPhotosFilterProps {
pageType: PageType | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import useLocation from "../../../hooks/use-location/use-location";
import { PageType } from "../../../interfaces/IDetailView";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import { INavigateState } from "../../../interfaces/INavigateState";
import { URLPath } from "../../../shared/url-path";
import { URLPath } from "../../../shared/url/url-path";
import FlatListItem from "../../atoms/flat-list-item/flat-list-item";
import ListImageChildItem from "../../atoms/list-image-child-item/list-image-child-item";
import ListImageViewSelectContainer from "../list-image-view-select-container/list-image-view-select-container";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { memo, useEffect } from "react";
import useLocation from "../../../hooks/use-location/use-location";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import { URLPath } from "../../../shared/url-path";
import { UrlQuery } from "../../../shared/url-query";
import { URLPath } from "../../../shared/url/url-path";
import { UrlQuery } from "../../../shared/url/url-query";
import Link from "../../atoms/link/link";
import Preloader from "../../atoms/preloader/preloader";

Expand Down
Loading
Loading