Skip to content

Commit

Permalink
feat: sync changes from v2 to v2-develop (#783) [skip ci]
Browse files Browse the repository at this point in the history
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
  • Loading branch information
giscegit and ecarreras authored Dec 19, 2024
1 parent e206bfa commit b761a38
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gisce/react-ooui",
"version": "2.50.0",
"version": "2.51.0",
"engines": {
"node": "20.5.0"
},
Expand Down
5 changes: 3 additions & 2 deletions src/widgets/custom/Indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
} from "@/context/TabManagerContext";
import { GraphCard } from "../views/Graph";
import { useFormContext } from "@/context/FormContext";
import { useLocale } from "@gisce/react-formiga-components";
import styled from "styled-components";
const { useToken } = theme;

Expand Down Expand Up @@ -117,7 +116,8 @@ const GraphIndicatorInput = (props: IndicatorInputProps) => {
return <ErrorAlert error={error} />;
}

const { id, model, limit, domain, context, initialView } = actionData || {};
const { id, model, limit, domain, context, initialView, description } =
actionData || {};

const GraphComponent = readForViewEnabled ? GraphServer : Graph;

Expand All @@ -128,6 +128,7 @@ const GraphIndicatorInput = (props: IndicatorInputProps) => {
title={actionData?.title || ""}
action={treeShortcut}
openAction={openShortcut as any}
tooltip={description}
>
{loading && <CenteredSpinner />}
{!loading && (
Expand Down
4 changes: 3 additions & 1 deletion src/widgets/views/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {
import {
forwardRef,
useContext,
useEffect,
Expand Down Expand Up @@ -256,6 +256,7 @@ function Dashboard(props: DashboardProps, ref: any) {
actionType,
key,
title,
description,
views,
model,
context,
Expand Down Expand Up @@ -394,6 +395,7 @@ function Dashboard(props: DashboardProps, ref: any) {
parms={parmsParsed}
action={action!}
openAction={openAction}
tooltip={description}
>
{childContent}
</GraphCard>
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/views/Dashboard/dashboardHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export async function fetchAction({
name: title,
limit,
view_type,
description,
} = dataForAction;
const treeExpandable = view_type === "tree";

Expand Down Expand Up @@ -71,6 +72,7 @@ export async function fetchAction({

return {
title,
description,
actionId,
actionType,
key: nanoid(),
Expand Down
17 changes: 13 additions & 4 deletions src/widgets/views/Graph/GraphCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ExportOutlined } from "@ant-design/icons";
import { Row, Col, Typography, theme } from "antd";
import { ExportOutlined, InfoCircleOutlined } from "@ant-design/icons";
import { Row, Col, Typography, theme, Tooltip } from "antd";
import ErrorBoundary from "antd/es/alert/ErrorBoundary";
import { GraphCardProps } from "./GraphCard.types";
const { useToken } = theme;

const { Text } = Typography;

export const GraphCard = (props: GraphCardProps) => {
const { title, children, action, openAction, parms } = props;
const { title, children, action, openAction, parms, tooltip } = props;
const { token } = useToken();

const hasDragAndDrop = Object.keys(parms).length > 0;
Expand Down Expand Up @@ -43,7 +43,16 @@ export const GraphCard = (props: GraphCardProps) => {
overflow: "hidden",
}}
>
<Text ellipsis={true}>{title}</Text>
{tooltip ? (
<>
<Tooltip title={tooltip}>
<InfoCircleOutlined className="pr-1 text-xs" />
</Tooltip>
<Text ellipsis={true}>{title}</Text>
</>
) : (
<Text ellipsis={true}>{title}</Text>
)}
</Col>
{action && (
<Col flex="25px" style={{ padding: "0.5rem" }}>
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/views/Graph/GraphCard.types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ShortcutApi } from "@/ui/FavouriteButton";

export type GraphCardProps = {
title: string;
title: any;
id: string;
children?: React.ReactNode;
parms: any;
action?: ShortcutApi;
openAction?: (shortcutApi?: ShortcutApi) => void;
tooltip?: string;
};

0 comments on commit b761a38

Please sign in to comment.