refactor(CommunitiesManager): enhance button actions and layout for improved user interaction and functionality
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m57s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m57s
This commit is contained in:
@@ -14,10 +14,13 @@ import {
|
|||||||
IconLink,
|
IconLink,
|
||||||
IconRefresh,
|
IconRefresh,
|
||||||
IconSortAscending,
|
IconSortAscending,
|
||||||
IconSortDescending
|
IconSortDescending,
|
||||||
|
IconUpload,
|
||||||
|
IconDownload,
|
||||||
|
IconDeviceFloppy
|
||||||
} from '@tabler/icons-react';
|
} from '@tabler/icons-react';
|
||||||
import PageHeader from './components/PageHeader.jsx';
|
import PageHeader from './components/PageHeader.jsx';
|
||||||
import PageHeaderActions from './components/PageHeaderActions.jsx';
|
import PortalDropdown from './components/PortalDropdown.jsx';
|
||||||
import EmptyState from './components/EmptyState.jsx';
|
import EmptyState from './components/EmptyState.jsx';
|
||||||
import CommunityStats from './components/CommunityStats.jsx';
|
import CommunityStats from './components/CommunityStats.jsx';
|
||||||
import SavedFilters from './components/SavedFilters.jsx';
|
import SavedFilters from './components/SavedFilters.jsx';
|
||||||
@@ -354,18 +357,6 @@ function CommunitiesManager() {
|
|||||||
<PageHeader
|
<PageHeader
|
||||||
title="Справочник Community"
|
title="Справочник Community"
|
||||||
icon={<IconFilter size={24} />}
|
icon={<IconFilter size={24} />}
|
||||||
actions={
|
|
||||||
<PageHeaderActions
|
|
||||||
loading={loading}
|
|
||||||
onRefresh={fetchItems}
|
|
||||||
disableRefresh={loading}
|
|
||||||
onImport={handleImport}
|
|
||||||
onExport={handleExport}
|
|
||||||
disableExport={items.length === 0}
|
|
||||||
onSave={handleSave}
|
|
||||||
disableSave={loading}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Уведомления */}
|
{/* Уведомления */}
|
||||||
@@ -386,8 +377,8 @@ function CommunitiesManager() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Табы в стиле NetworkConfigManager (как на скрине) */}
|
{/* Табы и кнопки в одной строке, единый стиль btn-primary */}
|
||||||
<div className="mb-3">
|
<div className="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
|
||||||
<div className="btn-group" role="tablist" aria-label="Переключение режимов страницы">
|
<div className="btn-group" role="tablist" aria-label="Переключение режимов страницы">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -428,6 +419,50 @@ function CommunitiesManager() {
|
|||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="btn-group">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-primary"
|
||||||
|
onClick={fetchItems}
|
||||||
|
disabled={loading}
|
||||||
|
title="Обновить данные"
|
||||||
|
>
|
||||||
|
<IconRefresh size={16} className={loading ? 'spin me-1' : 'me-1'} />
|
||||||
|
Обновить
|
||||||
|
</button>
|
||||||
|
<PortalDropdown
|
||||||
|
buttonClassName="btn btn-primary dropdown-toggle"
|
||||||
|
buttonProps={{ title: 'Импорт/Экспорт' }}
|
||||||
|
align="left"
|
||||||
|
buttonContent={<><IconDownload className="me-1" /> Импорт/Экспорт</>}
|
||||||
|
>
|
||||||
|
<button type="button" className="dropdown-item" onClick={handleImport}>
|
||||||
|
<IconUpload className="me-1" /> Импорт
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="dropdown-item"
|
||||||
|
onClick={handleExport}
|
||||||
|
disabled={items.length === 0}
|
||||||
|
>
|
||||||
|
<IconDownload className="me-1" /> Экспорт
|
||||||
|
</button>
|
||||||
|
</PortalDropdown>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-primary"
|
||||||
|
onClick={handleSave}
|
||||||
|
disabled={loading}
|
||||||
|
title="Сохранить"
|
||||||
|
>
|
||||||
|
{loading ? (
|
||||||
|
<span className="spinner-border spinner-border-sm me-1" role="status" aria-hidden="true" />
|
||||||
|
) : (
|
||||||
|
<IconDeviceFloppy className="me-1" />
|
||||||
|
)}
|
||||||
|
Сохранить
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Отображение списка communities */}
|
{/* Отображение списка communities */}
|
||||||
|
|||||||
Reference in New Issue
Block a user