Skip to content

Commit

Permalink
Update more buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Still34 committed Jun 3, 2021
1 parent cec5ac0 commit a134f09
Show file tree
Hide file tree
Showing 43 changed files with 223 additions and 84 deletions.
2 changes: 1 addition & 1 deletion ui/v2.5/src/components/Galleries/DeleteGalleriesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const DeleteGalleriesDialog: React.FC<IDeleteGalleryDialogProps> = (
}}
cancel={{
onClick: () => props.onClose(false),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
isRunning={isDeleting}
Expand Down
9 changes: 7 additions & 2 deletions ui/v2.5/src/components/Galleries/EditGalleriesDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import { Form, Col, Row } from "react-bootstrap";
import { useIntl } from "react-intl";
import _ from "lodash";
import { useBulkGalleryUpdate } from "src/core/StashService";
import * as GQL from "src/core/generated-graphql";
Expand All @@ -17,6 +18,7 @@ interface IListOperationProps {
export const EditGalleriesDialog: React.FC<IListOperationProps> = (
props: IListOperationProps
) => {
const intl = useIntl();
const Toast = useToast();
const [rating, setRating] = useState<number>();
const [studioId, setStudioId] = useState<string>();
Expand Down Expand Up @@ -348,10 +350,13 @@ export const EditGalleriesDialog: React.FC<IListOperationProps> = (
show
icon="pencil-alt"
header="Edit Galleries"
accept={{ onClick: onSave, text: "Apply" }}
accept={{
onClick: onSave,
text: intl.formatMessage({ id: "actions.apply" }),
}}
cancel={{
onClick: () => props.onClose(false),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
isRunning={isUpdating}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from "react";
import { FormattedMessage, useIntl } from "react-intl";
import { useHistory } from "react-router-dom";
import {
Button,
Expand Down Expand Up @@ -49,6 +50,7 @@ interface IExistingProps {
export const GalleryEditPanel: React.FC<
IProps & (INewProps | IExistingProps)
> = ({ gallery, isNew, isVisible, onDelete }) => {
const intl = useIntl();
const Toast = useToast();
const history = useHistory();
const [title, setTitle] = useState<string>(gallery?.title ?? "");
Expand Down Expand Up @@ -249,7 +251,7 @@ export const GalleryEditPanel: React.FC<
<DropdownButton
className="d-inline-block"
id="gallery-scrape"
title="Scrape with..."
title={intl.formatMessage({ id: "actions.scrape_with" })}
>
{queryableScrapers.map((s) => (
<Dropdown.Item key={s.name} onClick={() => onScrapeClicked(s)}>
Expand All @@ -260,7 +262,9 @@ export const GalleryEditPanel: React.FC<
<span className="fa-icon">
<Icon icon="sync-alt" />
</span>
<span>Reload scrapers</span>
<span>
<FormattedMessage id="actions.reload_scrapers" />
</span>
</Dropdown.Item>
</DropdownButton>
);
Expand Down Expand Up @@ -359,14 +363,14 @@ export const GalleryEditPanel: React.FC<
<div className="form-container row px-3 pt-3">
<div className="col edit-buttons mb-3 pl-0">
<Button className="edit-button" variant="primary" onClick={onSave}>
Save
<FormattedMessage id="actions.save" />
</Button>
<Button
className="edit-button"
variant="danger"
onClick={() => onDelete()}
>
Delete
<FormattedMessage id="actions.delete" />
</Button>
</div>
<Col xs={6} className="text-right">
Expand Down
6 changes: 4 additions & 2 deletions ui/v2.5/src/components/Galleries/GalleryList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from "react";
import { useIntl } from "react-intl";
import _ from "lodash";
import { Table } from "react-bootstrap";
import { Link, useHistory } from "react-router-dom";
Expand Down Expand Up @@ -28,6 +29,7 @@ export const GalleryList: React.FC<IGalleryList> = ({
filterHook,
persistState,
}) => {
const intl = useIntl();
const history = useHistory();
const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);
const [isExportAll, setIsExportAll] = useState(false);
Expand All @@ -38,12 +40,12 @@ export const GalleryList: React.FC<IGalleryList> = ({
onClick: viewRandom,
},
{
text: "Export...",
text: intl.formatMessage({ id: "actions.export" }),
onClick: onExport,
isDisplayed: showWhenSelected,
},
{
text: "Export all...",
text: intl.formatMessage({ id: "actions.export_all" }),
onClick: onExportAll,
},
];
Expand Down
2 changes: 1 addition & 1 deletion ui/v2.5/src/components/Images/DeleteImagesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const DeleteImagesDialog: React.FC<IDeleteImageDialogProps> = (
}}
cancel={{
onClick: () => props.onClose(false),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
isRunning={isDeleting}
Expand Down
9 changes: 7 additions & 2 deletions ui/v2.5/src/components/Images/EditImagesDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import { Form, Col, Row } from "react-bootstrap";
import { useIntl } from "react-intl";
import _ from "lodash";
import { useBulkImageUpdate } from "src/core/StashService";
import * as GQL from "src/core/generated-graphql";
Expand All @@ -17,6 +18,7 @@ interface IListOperationProps {
export const EditImagesDialog: React.FC<IListOperationProps> = (
props: IListOperationProps
) => {
const intl = useIntl();
const Toast = useToast();
const [rating, setRating] = useState<number>();
const [studioId, setStudioId] = useState<string>();
Expand Down Expand Up @@ -345,10 +347,13 @@ export const EditImagesDialog: React.FC<IListOperationProps> = (
show
icon="pencil-alt"
header="Edit Images"
accept={{ onClick: onSave, text: "Apply" }}
accept={{
onClick: onSave,
text: intl.formatMessage({ id: "actions.apply" }),
}}
cancel={{
onClick: () => props.onClose(false),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
isRunning={isUpdating}
Expand Down
5 changes: 3 additions & 2 deletions ui/v2.5/src/components/Images/ImageDetails/ImageEditPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import { Button, Form, Col, Row } from "react-bootstrap";
import { FormattedMessage } from "react-intl";
import Mousetrap from "mousetrap";
import * as GQL from "src/core/generated-graphql";
import { useImageUpdate } from "src/core/StashService";
Expand Down Expand Up @@ -117,14 +118,14 @@ export const ImageEditPanel: React.FC<IProps> = ({
<div className="form-container row px-3 pt-3">
<div className="col edit-buttons mb-3 pl-0">
<Button className="edit-button" variant="primary" onClick={onSave}>
Save
<FormattedMessage id="actions.save" />
</Button>
<Button
className="edit-button"
variant="danger"
onClick={() => onDelete()}
>
Delete
<FormattedMessage id="actions.delete" />
</Button>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions ui/v2.5/src/components/Images/ImageList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useCallback, useState } from "react";
import { useIntl } from "react-intl";
import _ from "lodash";
import { useHistory } from "react-router-dom";
import Mousetrap from "mousetrap";
Expand Down Expand Up @@ -118,6 +119,7 @@ export const ImageList: React.FC<IImageList> = ({
persistanceKey,
extraOperations,
}) => {
const intl = useIntl();
const history = useHistory();
const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);
const [isExportAll, setIsExportAll] = useState(false);
Expand All @@ -128,12 +130,12 @@ export const ImageList: React.FC<IImageList> = ({
onClick: viewRandom,
},
{
text: "Export...",
text: intl.formatMessage({ id: "actions.export" }),
onClick: onExport,
isDisplayed: showWhenSelected,
},
{
text: "Export all...",
text: intl.formatMessage({ id: "actions.export_all" }),
onClick: onExportAll,
},
]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import * as GQL from "src/core/generated-graphql";
import * as yup from "yup";
import Mousetrap from "mousetrap";
Expand Down Expand Up @@ -332,7 +333,7 @@ export const MovieEditPanel: React.FC<IMovieEditPanel> = ({
variant="secondary"
onClick={() => setIsImageAlertOpen(false)}
>
Cancel
<FormattedMessage id="actions.cancel" />
</Button>

<Button
Expand Down
6 changes: 4 additions & 2 deletions ui/v2.5/src/components/Movies/MovieList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from "react";
import { useIntl } from "react-intl";
import _ from "lodash";
import Mousetrap from "mousetrap";
import { useHistory } from "react-router-dom";
Expand All @@ -18,6 +19,7 @@ import { ExportDialog, DeleteEntityDialog } from "src/components/Shared";
import { MovieCard } from "./MovieCard";

export const MovieList: React.FC = () => {
const intl = useIntl();
const history = useHistory();
const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);
const [isExportAll, setIsExportAll] = useState(false);
Expand All @@ -28,12 +30,12 @@ export const MovieList: React.FC = () => {
onClick: viewRandom,
},
{
text: "Export...",
text: intl.formatMessage({ id: "actions.export" }),
onClick: onExport,
isDisplayed: showWhenSelected,
},
{
text: "Export all...",
text: intl.formatMessage({ id: "actions.export_all" }),
onClick: onExportAll,
},
];
Expand Down
9 changes: 7 additions & 2 deletions ui/v2.5/src/components/Performers/EditPerformersDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from "react";
import { Form, Col, Row } from "react-bootstrap";
import { useIntl } from "react-intl";
import _ from "lodash";
import { useBulkPerformerUpdate } from "src/core/StashService";
import * as GQL from "src/core/generated-graphql";
Expand All @@ -17,6 +18,7 @@ interface IListOperationProps {
export const EditPerformersDialog: React.FC<IListOperationProps> = (
props: IListOperationProps
) => {
const intl = useIntl();
const Toast = useToast();
const [rating, setRating] = useState<number>();
const [tagMode, setTagMode] = React.useState<GQL.BulkUpdateIdMode>(
Expand Down Expand Up @@ -232,10 +234,13 @@ export const EditPerformersDialog: React.FC<IListOperationProps> = (
show
icon="pencil-alt"
header="Edit Performers"
accept={{ onClick: onSave, text: "Apply" }}
accept={{
onClick: onSave,
text: intl.formatMessage({ id: "actions.apply" }),
}}
cancel={{
onClick: () => props.onClose(false),
text: "Cancel",
text: intl.formatMessage({ id: "actions.cancel" }),
variant: "secondary",
}}
isRunning={isUpdating}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useRef, useState } from "react";
import { debounce } from "lodash";
import { Button, Form } from "react-bootstrap";
import { useIntl } from "react-intl";

import * as GQL from "src/core/generated-graphql";
import { Modal, LoadingIndicator } from "src/components/Shared";
Expand All @@ -24,6 +25,7 @@ const PerformerScrapeModal: React.FC<IProps> = ({
onHide,
onSelectPerformer,
}) => {
const intl = useIntl();
const inputRef = useRef<HTMLInputElement>(null);
const [query, setQuery] = useState<string>(name ?? "");
const { data, loading } = useScrapePerformerList(scraper.id, query);
Expand All @@ -41,7 +43,11 @@ const PerformerScrapeModal: React.FC<IProps> = ({
show
onHide={onHide}
header={`Scrape performer from ${scraper.name}`}
accept={{ text: "Cancel", onClick: onHide, variant: "secondary" }}
accept={{
text: intl.formatMessage({ id: "actions.cancel" }),
onClick: onHide,
variant: "secondary",
}}
>
<div className={CLASSNAME}>
<Form.Control
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useRef, useState } from "react";
import { debounce } from "lodash";
import { Button, Form } from "react-bootstrap";
import { useIntl } from "react-intl";

import * as GQL from "src/core/generated-graphql";
import { Modal, LoadingIndicator } from "src/components/Shared";
Expand All @@ -24,6 +25,7 @@ const PerformerStashBoxModal: React.FC<IProps> = ({
onHide,
onSelectPerformer,
}) => {
const intl = useIntl();
const inputRef = useRef<HTMLInputElement>(null);
const [query, setQuery] = useState<string>(name ?? "");
const { data, loading } = GQL.useQueryStashBoxPerformerQuery({
Expand All @@ -49,7 +51,11 @@ const PerformerStashBoxModal: React.FC<IProps> = ({
show
onHide={onHide}
header={`Scrape performer from ${instance.name ?? "Stash-Box"}`}
accept={{ text: "Cancel", onClick: onHide, variant: "secondary" }}
accept={{
text: intl.formatMessage({ id: "actions.cancel" }),
onClick: onHide,
variant: "secondary",
}}
>
<div className={CLASSNAME}>
<Form.Control
Expand Down
6 changes: 4 additions & 2 deletions ui/v2.5/src/components/Performers/PerformerList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import _ from "lodash";
import React, { useState } from "react";
import { useIntl } from "react-intl";
import { useHistory } from "react-router-dom";
import Mousetrap from "mousetrap";
import {
Expand Down Expand Up @@ -31,6 +32,7 @@ export const PerformerList: React.FC<IPerformerList> = ({
persistState,
extraCriteria,
}) => {
const intl = useIntl();
const history = useHistory();
const [isExportDialogOpen, setIsExportDialogOpen] = useState(false);
const [isExportAll, setIsExportAll] = useState(false);
Expand All @@ -41,12 +43,12 @@ export const PerformerList: React.FC<IPerformerList> = ({
onClick: getRandom,
},
{
text: "Export...",
text: intl.formatMessage({ id: "actions.export" }),
onClick: onExport,
isDisplayed: showWhenSelected,
},
{
text: "Export all...",
text: intl.formatMessage({ id: "actions.export_all" }),
onClick: onExportAll,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Tooltip,
} from "react-bootstrap";
import { Link, useHistory } from "react-router-dom";
import { FormattedNumber } from "react-intl";
import { FormattedMessage, FormattedNumber } from "react-intl";
import querystring from "query-string";

import * as GQL from "src/core/generated-graphql";
Expand Down Expand Up @@ -494,7 +494,7 @@ export const SceneDuplicateChecker: React.FC = () => {
variant="danger"
onClick={() => handleDeleteScene(scene)}
>
Delete
<FormattedMessage id="actions.delete" />
</Button>
</td>
</tr>
Expand Down
Loading

0 comments on commit a134f09

Please sign in to comment.