diff --git a/app/panels/query_editor/components/inspector_query_ents/attrs_list.js b/app/panels/query_editor/components/inspector_query_ents/attrs_list.js
index 08eda21..72ddbfd 100644
--- a/app/panels/query_editor/components/inspector_query_ents/attrs_list.js
+++ b/app/panels/query_editor/components/inspector_query_ents/attrs_list.js
@@ -22,7 +22,7 @@ const STYLES = {
SMALL_TOOL_ICON: {
fontSize: 20
},
- LIST: { height: "500px", width: "360px", bgcolor: "background.paper", overflowY: "auto", ...APP_STYLES.SCROLL }
+ LIST: { height: "100%", width: "100%", bgcolor: "background.paper", overflowY: "auto", ...APP_STYLES.SCROLL }
};
//-----------
@@ -30,54 +30,49 @@ const STYLES = {
//-----------
//Список атрибутов сущности
-const AttrsList = ({ attrs = [], filter, onSelect = null, onShow = null } = {}) => {
+const AttrsList = ({ attrs = [], onSelect = null, onShow = null } = {}) => {
//При выборе элемента списка
const handleSelectClick = attr => {
onSelect && onSelect(attr);
};
- //При нажатии на исправлении
+ //При нажатии на кнопку изменения видимости атрибута
const handleShowClick = (e, attr) => {
e.stopPropagation();
onShow && onShow(attr);
};
- //Рег. выражение для фильтра
- const filterRegExp = filter ? new RegExp(filter, "i") : null;
-
//Формирование представления
return (
{attrs &&
- attrs
- .filter(attr => (filterRegExp ? filterRegExp.test(attr.name) || filterRegExp.test(attr.title) : true))
- .map((attr, i) => {
- const [selected, selectedTitle] = attrGetUse(attr, true);
- const [showTitle, showIcon] = attrGetShow(attr, true);
- return (
-
- handleSelectClick(attr)} selected={selected} dense>
-
-
-
-
- {`${attr.alias || attr.name}`}
-
- }
- />
-
- handleShowClick(e, attr)} title={showTitle}>
- {showIcon}
-
-
-
-
- );
- })}
+ attrs.map((attr, i) => {
+ const [selected, selectedTitle] = attrGetUse(attr, true);
+ const [showTitle, showIcon] = attrGetShow(attr, true);
+ return (
+
+ handleSelectClick(attr)} selected={selected} dense>
+
+
+
+
+ {`${attr.alias || attr.name}`}
+
+ }
+ />
+
+ handleShowClick(e, attr)} title={showTitle}>
+ {showIcon}
+
+
+
+
+ );
+ })}
);
};
@@ -85,7 +80,6 @@ const AttrsList = ({ attrs = [], filter, onSelect = null, onShow = null } = {})
//Контроль свойств компонента - Список атрибутов сущности
AttrsList.propTypes = {
attrs: PropTypes.arrayOf(ATTRIBUTE_SHAPE),
- filter: PropTypes.string,
onSelect: PropTypes.func,
onShow: PropTypes.func
};
diff --git a/app/panels/query_editor/components/inspector_query_ents/entity_attrs_dialog.js b/app/panels/query_editor/components/inspector_query_ents/entity_attrs_dialog.js
index d588f5b..11c0d14 100644
--- a/app/panels/query_editor/components/inspector_query_ents/entity_attrs_dialog.js
+++ b/app/panels/query_editor/components/inspector_query_ents/entity_attrs_dialog.js
@@ -9,11 +9,21 @@
import React, { useState, useEffect } from "react"; //Классы React
import PropTypes from "prop-types"; //Контроль свойств компонента
-import { TextField, InputAdornment, Icon, IconButton } from "@mui/material"; //Интерфейсные элементы MUI
-import { P8PDialog } from "../../../../components/p8p_dialog"; //Типовой диалог
+import { Box, TextField, InputAdornment, Icon, IconButton } from "@mui/material"; //Интерфейсные элементы MUI
+import { P8PDialog, P8P_DIALOG_WIDTH } from "../../../../components/p8p_dialog"; //Типовой диалог
+import { P8PComponentInlineMessage } from "../../../../components/editors/p8p_component_inline_message"; //Типовое встраиваемое сообщение
import { AttrsList } from "./attrs_list"; //Список атрибутов сущности
import { useEntityAttrs } from "./hooks"; //Хуки диалога настройки атрибутов сущности
+//---------
+//Константы
+//---------
+
+//Стили
+const STYLES = {
+ LIST_CONTAINER: { width: "100%", height: "500px" }
+};
+
//-----------
//Тело модуля
//-----------
@@ -65,9 +75,18 @@ const EntityAttrsDialog = ({ query, id, title, onOk, onCancel }) => {
if (srvAttrs) setAttrs(srvAttrs.map(srvAttr => ({ ...srvAttr })));
}, [srvAttrs]);
+ //Рег. выражение для фильтра
+ const filterRegExp = filter ? new RegExp(filter, "i") : null;
+
+ //Отфильтрованные для отображения атрибуты
+ const filteredAttrs = attrs.filter(attr => (filterRegExp ? filterRegExp.test(attr.name) || filterRegExp.test(attr.title) : true));
+
+ //Флаг отображения списка атрибутов
+ const displayAttrsList = attrs.length == 0 ? null : filteredAttrs.length > 0 ? true : false;
+
//Генерация содержимого
return (
-
+
{
)
}}
/>
-
+
+ {displayAttrsList === true && }
+ {displayAttrsList === false && (
+
+ )}
+
);
};