mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Place popover to right on edit pages (#3939)
This commit is contained in:
@@ -502,6 +502,7 @@ export const GalleryEditPanel: React.FC<IProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
ids={formik.values.tag_ids}
|
ids={formik.values.tag_ids}
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
@@ -279,6 +279,7 @@ export const ImageEditPanel: React.FC<IProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
ids={formik.values.tag_ids}
|
ids={formik.values.tag_ids}
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
@@ -899,6 +899,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
ids={formik.values.tag_ids}
|
ids={formik.values.tag_ids}
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
|
|||||||
}
|
}
|
||||||
ids={fieldProps.field.value ? [fieldProps.field.value] : []}
|
ids={fieldProps.field.value ? [fieldProps.field.value] : []}
|
||||||
noSelectionString="Select/create tag..."
|
noSelectionString="Select/create tag..."
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ export const SceneMarkerForm: React.FC<ISceneMarkerForm> = ({
|
|||||||
}
|
}
|
||||||
ids={fieldProps.field.value}
|
ids={fieldProps.field.value}
|
||||||
noSelectionString="Select/create tags..."
|
noSelectionString="Select/create tags..."
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { galleryTitle } from "src/core/galleries";
|
|||||||
import { TagPopover } from "../Tags/TagPopover";
|
import { TagPopover } from "../Tags/TagPopover";
|
||||||
import { defaultMaxOptionsShown, IUIConfig } from "src/core/config";
|
import { defaultMaxOptionsShown, IUIConfig } from "src/core/config";
|
||||||
import { useDebouncedSetState } from "src/hooks/debounce";
|
import { useDebouncedSetState } from "src/hooks/debounce";
|
||||||
|
import { Placement } from "react-bootstrap/esm/Overlay";
|
||||||
|
|
||||||
export type SelectObject = {
|
export type SelectObject = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -832,9 +833,9 @@ export const MovieSelect: React.FC<IFilterProps> = (props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TagSelect: React.FC<IFilterProps & { excludeIds?: string[] }> = (
|
export const TagSelect: React.FC<
|
||||||
props
|
IFilterProps & { excludeIds?: string[]; hoverPlacement?: Placement }
|
||||||
) => {
|
> = (props) => {
|
||||||
const [tagAliases, setTagAliases] = useState<Record<string, string[]>>({});
|
const [tagAliases, setTagAliases] = useState<Record<string, string[]>>({});
|
||||||
const [allAliases, setAllAliases] = useState<string[]>([]);
|
const [allAliases, setAllAliases] = useState<string[]>([]);
|
||||||
const { data, loading } = useAllTagsForFilter();
|
const { data, loading } = useAllTagsForFilter();
|
||||||
@@ -890,7 +891,7 @@ export const TagSelect: React.FC<IFilterProps & { excludeIds?: string[] }> = (
|
|||||||
: optionProps.data.value;
|
: optionProps.data.value;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TagPopover id={id}>
|
<TagPopover id={id} placement={props.hoverPlacement}>
|
||||||
<reactSelectComponents.Option {...thisOptionProps} />
|
<reactSelectComponents.Option {...thisOptionProps} />
|
||||||
</TagPopover>
|
</TagPopover>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { galleryTitle } from "src/core/galleries";
|
|||||||
import * as GQL from "src/core/generated-graphql";
|
import * as GQL from "src/core/generated-graphql";
|
||||||
import { TagPopover } from "../Tags/TagPopover";
|
import { TagPopover } from "../Tags/TagPopover";
|
||||||
import { markerTitle } from "src/core/markers";
|
import { markerTitle } from "src/core/markers";
|
||||||
|
import { Placement } from "react-bootstrap/esm/Overlay";
|
||||||
|
|
||||||
interface IFile {
|
interface IFile {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -40,6 +41,7 @@ interface IProps {
|
|||||||
scene?: Partial<Pick<SceneDataFragment, "id" | "title" | "files">>;
|
scene?: Partial<Pick<SceneDataFragment, "id" | "title" | "files">>;
|
||||||
gallery?: Partial<IGallery>;
|
gallery?: Partial<IGallery>;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
hoverPlacement?: Placement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TagLink: React.FC<IProps> = (props: IProps) => {
|
export const TagLink: React.FC<IProps> = (props: IProps) => {
|
||||||
@@ -84,7 +86,7 @@ export const TagLink: React.FC<IProps> = (props: IProps) => {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Badge className={cx("tag-item", props.className)} variant="secondary">
|
<Badge className={cx("tag-item", props.className)} variant="secondary">
|
||||||
<TagPopover id={id}>
|
<TagPopover id={id} placement={props.hoverPlacement}>
|
||||||
<Link to={link}>{title}</Link>
|
<Link to={link}>{title}</Link>
|
||||||
</TagPopover>
|
</TagPopover>
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ export const TagEditPanel: React.FC<ITagEditPanel> = ({
|
|||||||
...formik.values.child_ids,
|
...formik.values.child_ids,
|
||||||
]}
|
]}
|
||||||
creatable={false}
|
creatable={false}
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
@@ -269,6 +270,7 @@ export const TagEditPanel: React.FC<ITagEditPanel> = ({
|
|||||||
...formik.values.parent_ids,
|
...formik.values.parent_ids,
|
||||||
]}
|
]}
|
||||||
creatable={false}
|
creatable={false}
|
||||||
|
hoverPlacement="right"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Form.Group>
|
</Form.Group>
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import { useFindTag } from "../../core/StashService";
|
|||||||
import { TagCard } from "./TagCard";
|
import { TagCard } from "./TagCard";
|
||||||
import { ConfigurationContext } from "../../hooks/Config";
|
import { ConfigurationContext } from "../../hooks/Config";
|
||||||
import { IUIConfig } from "src/core/config";
|
import { IUIConfig } from "src/core/config";
|
||||||
|
import { Placement } from "react-bootstrap/esm/Overlay";
|
||||||
|
|
||||||
interface ITagPopoverProps {
|
interface ITagPopoverProps {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
placement?: Placement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TagPopoverCard: React.FC<ITagPopoverCardProps> = ({ id }) => {
|
export const TagPopoverCard: React.FC<ITagPopoverCardProps> = ({ id }) => {
|
||||||
@@ -33,7 +35,11 @@ export const TagPopoverCard: React.FC<ITagPopoverCardProps> = ({ id }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TagPopover: React.FC<ITagPopoverProps> = ({ id, children }) => {
|
export const TagPopover: React.FC<ITagPopoverProps> = ({
|
||||||
|
id,
|
||||||
|
children,
|
||||||
|
placement = "top",
|
||||||
|
}) => {
|
||||||
const { configuration: config } = React.useContext(ConfigurationContext);
|
const { configuration: config } = React.useContext(ConfigurationContext);
|
||||||
|
|
||||||
const showTagCardOnHover =
|
const showTagCardOnHover =
|
||||||
@@ -45,7 +51,7 @@ export const TagPopover: React.FC<ITagPopoverProps> = ({ id, children }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover
|
<HoverPopover
|
||||||
placement={"top"}
|
placement={placement}
|
||||||
enterDelay={500}
|
enterDelay={500}
|
||||||
leaveDelay={100}
|
leaveDelay={100}
|
||||||
content={<TagPopoverCard id={id} />}
|
content={<TagPopoverCard id={id} />}
|
||||||
|
|||||||
Reference in New Issue
Block a user