Skip to content

Commit

Permalink
Merge branch 'master' into feature/202410_thumbnail_refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Oct 24, 2024
2 parents cfbcfa7 + 967ff2c commit b4fa5c2
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 12 deletions.
9 changes: 4 additions & 5 deletions documentation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Semantic Versioning 2.0.0 is from version 0.1.6+
## List of versions

## version 0.6.3 - _(Unreleased)_ - 2024-08-?? {#v0.6.3}
- nothing

- [x] (Fixed) _Front-end_ OkAndSame status in Upload Modal gives the wrong status (PR #1783)

## version 0.6.2 - 2024-10-11 {#v0.6.2}

Expand Down
2 changes: 1 addition & 1 deletion starsky/build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0"/>
<PackageReference Include="Nuke.Common" Version="8.1.1" />
<PackageReference Include="Nuke.Common" Version="8.1.2" />
<PackageReference Include="ReportGenerator.Core" Version="5.2.5" />
<PackageReference Include="SimpleExec" Version="12.0.0"/>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion starsky/nuget-packages-list.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
"Microsoft.AspNetCore.Mvc.NewtonsoftJson 8.0.10",
"Microsoft.Extensions.Hosting.WindowsServices 8.0.1",
"Swashbuckle.AspNetCore 6.8.1",
"Swashbuckle.AspNetCore 6.9.0",
"Microsoft.Extensions.Caching.Abstractions 8.0.0",
"Microsoft.Extensions.Caching.Memory 8.0.1",
"Microsoft.Extensions.Hosting.Abstractions 8.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,39 @@ describe("ItemTextListView", () => {
);
});

const statusCorrectlyTheoryData = [
{ status: IExifStatus.OkAndSame, shouldShowError: false },
{ status: IExifStatus.ServerError, shouldShowError: true },
{ status: IExifStatus.NotFoundSourceMissing, shouldShowError: true },
{ status: IExifStatus.Ok, shouldShowError: false },
{ status: IExifStatus.ReadOnly, shouldShowError: true }
];

test.each(statusCorrectlyTheoryData)(
"error-status should render %s",
({ status, shouldShowError }) => {
const fileIndexItems = [
{
filePath: "/test/image.jpg",
fileName: "image.jpg",
status: status,
isDirectory: false
}
] as IFileIndexItem[];
const list = render(<ItemTextListView fileIndexItems={fileIndexItems} callback={() => {}} />);

const item = screen.queryByTestId("image.jpg-error-status");

if (shouldShowError) {
expect(item).toBeTruthy();
} else {
expect(item).toBeFalsy();
}

list.unmount();
}
);

it("list of 1 directory item", () => {
const fileIndexItems = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FunctionComponent } from "react";
import useGlobalSettings from "../../../hooks/use-global-settings";
import { IExifStatus } from "../../../interfaces/IExifStatus";
import { IFileIndexItem } from "../../../interfaces/IFileIndexItem";
import localization from "../../../localization/localization.json";
import { Language } from "../../../shared/language";
import { FunctionComponent } from "react";
import { GetBoxClassName } from "./internal/get-box-class-name.ts";

interface ItemListProps {
Expand Down Expand Up @@ -51,8 +51,12 @@ const ItemTextListView: FunctionComponent<ItemListProps> = (props) => {
</button>
) : null}
{!item.isDirectory ? item.fileName : null}
{item.status !== IExifStatus.Ok && item.status !== IExifStatus.Default ? (
<em className="error-status">{item.status}</em>
{item.status !== IExifStatus.Ok &&
item.status !== IExifStatus.Default &&
item.status !== IExifStatus.OkAndSame ? (
<em data-test={item.fileName + "-error-status"} className="error-status">
{item.status}
</em>
) : null}
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion starsky/starsky/starsky.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.10" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
</ItemGroup>
<!-- generate xml file for swagger -->
<PropertyGroup>
Expand Down

0 comments on commit b4fa5c2

Please sign in to comment.