diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 70f2077f..981c1148 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -55,7 +55,7 @@ jobs: - name: Check front code run: yarn --cwd db-viewer-ui lint - - name: Build docker-compose environment + - name: Build docker compose environment run: docker compose up -d --wait - name: Run db-viewer api @@ -69,7 +69,7 @@ jobs: - name: Stop docker containers if: always() - run: docker rm -f db-viewer-api && docker-compose down + run: docker rm -f db-viewer-api && docker compose down - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/db-viewer-ui/src/Components/FieldSelector/FieldSelector.tsx b/db-viewer-ui/src/Components/FieldSelector/FieldSelector.tsx index 504a54df..f70a2800 100644 --- a/db-viewer-ui/src/Components/FieldSelector/FieldSelector.tsx +++ b/db-viewer-ui/src/Components/FieldSelector/FieldSelector.tsx @@ -21,7 +21,7 @@ interface FieldSelectorProps { showSelectAllButton?: boolean; } -function filterFieldDefintionsByText(fieldDefinitions: FieldDefinition[], text: string): FieldDefinition[] { +function filterFieldDefinitionsByText(fieldDefinitions: FieldDefinition[], text: string): FieldDefinition[] { if (!text) { return fieldDefinitions; } @@ -80,27 +80,29 @@ export function FieldSelector({ ); }; - const fieldDefinitionsFiltered = filterFieldDefintionsByText(fieldDefinitions, searchText); + const fieldDefinitionsFiltered = filterFieldDefinitionsByText(fieldDefinitions, searchText); const nothingToDisplay = Ничего не найдено; const allFieldsSelected = isAllFieldSelected(fieldDefinitionsFiltered); return (
- } - value={searchText} - width={300} - onValueChange={setSearchText} - /> - {showSelectAllButton && ( -
handleSelectAll(fieldDefinitionsFiltered)} - className={jsStyles.selectAll(theme)}> - {allFieldsSelected ? "Снять выбор с найденных" : "Выбрать все найденные"} -
- )} + + } + value={searchText} + width={300} + onValueChange={setSearchText} + /> + {showSelectAllButton && ( + handleSelectAll(fieldDefinitionsFiltered)} + checked={allFieldsSelected}> + Все найденные + + )} + {fieldDefinitionsFiltered.length === 0 ? {nothingToDisplay} : null} diff --git a/db-viewer-ui/stories/Commons/FieldSelector.stories.tsx b/db-viewer-ui/stories/Commons/FieldSelector.stories.tsx index e586a352..b8d6cb94 100644 --- a/db-viewer-ui/stories/Commons/FieldSelector.stories.tsx +++ b/db-viewer-ui/stories/Commons/FieldSelector.stories.tsx @@ -19,6 +19,19 @@ export const Default = (): React.ReactElement => ( /> ); +export const WithSelectAll = (): React.ReactElement => ( + +); + export const LongStrings = (): React.ReactElement => (