Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
node-version: '22'
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: '144'
chrome-version: '146'
install-chromedriver: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
node-version: '22'
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: '143'
chrome-version: '146'
install-chromedriver: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
node-version: '22'
- uses: browser-actions/setup-chrome@v2
with:
chrome-version: '144'
chrome-version: '146'
install-chromedriver: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ How to develop

1. Run `npm install` to install all dependencies.
2. Change the target database URL in `tanin.backdoor.BackdoorServier.main(..)`
2. Run `./gradlew run` in order to run the web server.
2. Run `./gradlew web:run` in order to run the web server.
3. On a separate terminal, run `npm run hmr` in order to hot-reload the frontend code changes.
4. Visit http://localhost:9090 and login with `masked_test` and `1234`

How to run tests
-----------------
Expand All @@ -256,9 +257,10 @@ How to run tests
- The username is `backdoor_test`.
- The password is `test_ch`

1. Run `npm install` to install all dependencies.
3. On a separate terminal, run `npm run hmr`.
2. Run `./gradlew test` in order to run all the tests.
3. Run `npm install` to install all dependencies.
4. On a separate terminal, run `npm run hmr`.
5. Start the ClickHouse server by running `clickhouse server`.
6. Run `./gradlew test` in order to run all the tests.

Publish JAR
------------
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/tanin/backdoor/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void retryInteraction(VoidFn fn) throws InterruptedException {
try {
fn.invoke();
return;
} catch (ElementNotInteractableException ex) {
} catch (ElementNotInteractableException | StaleElementReferenceException ex) {
Thread.sleep(1000);
}
}
Expand Down
39 changes: 38 additions & 1 deletion core/src/test/java/tanin/backdoor/postgres/TableTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void deleteRow() throws InterruptedException {
}

@Test
void filterRowSpecificValue() throws InterruptedException {
void filterRowSpecificValueAndClearFilter() throws InterruptedException {
go("/");
click(tid("database-item"));
waitUntil(() -> assertEquals("loaded", elem(tid("database-item")).getDomAttribute("data-database-status")));
Expand All @@ -321,6 +321,43 @@ void filterRowSpecificValue() throws InterruptedException {
click(tid("submit-button"));

waitUntil(() -> assertColumnValues("username", "test_user_2"));

click(tid("clear-all-filters-button"));
waitUntil(() -> assertColumnValues("username", "test_user_1", "test_user_2", "test_user_3", "test_user_4"));
}

@Test
void theCurrentFilterValueDoesNotSpillOver() throws InterruptedException {
go("/");
click(tid("database-item"));
waitUntil(() -> assertEquals("loaded", elem(tid("database-item")).getDomAttribute("data-database-status")));


click(tid("menu-items", "postgres", null, "menu-item-table", "user"));

waitUntil(() -> assertTrue(hasElem(tid("sheet-tab", "user"))));
click(tid("sheet-view-column-header", "username", null, "filter-button"));

click(tid("specified-value-checkbox"));
fill(tid("specified-value-input"), "test_user_2");
click(tid("submit-button"));

waitUntil(() -> assertColumnValues("username", "test_user_2"));

click(tid("sheet-view-column-header", "password", null, "filter-button"));

click(tid("specified-value-checkbox"));
fill(tid("specified-value-input"), "password2");
click(tid("submit-button"));

waitUntil(() -> assertColumnValues("username", "test_user_2"));

click(tid("sheet-view-column-header", "username", null, "filter-button"));
waitUntil(() -> assertEquals("test_user_2", elem(tid("specified-value-input")).getDomProperty("value")));
click(tid("cancel-button"));

click(tid("sheet-view-column-header", "password", null, "filter-button"));
waitUntil(() -> assertEquals("password2", elem(tid("specified-value-input")).getDomProperty("value")));
}

@Test
Expand Down
5 changes: 4 additions & 1 deletion frontend/svelte/_filter_modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function open(column: Column): void {
mode = 'not_null'
} else if (filter.operator === 'EQUAL') {
mode = 'specified_value'
specifiedValue = filter.value
} else {
throw new Error(`Unrecognized column '${filter.operator}'`)
}
Expand Down Expand Up @@ -218,7 +219,9 @@ async function submit() {
<Button {isLoading} class="btn btn-secondary" onClick={async () => {submit()}} dataTestId="submit-button">
Update Filter
</Button>
<button type="button" class="btn btn-neutral" disabled={isLoading} onclick={close}>Cancel</button>
<button type="button" class="btn btn-neutral" disabled={isLoading} onclick={close} data-test-id="cancel-button">
Cancel
</button>
</div>
</div>
<div class="modal-backdrop" onclick={close}>
Expand Down
12 changes: 12 additions & 0 deletions frontend/svelte/_sheet_view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,18 @@ function handleResize(event: MouseEvent) {
}}
dataTestId="refresh-button"
>Refresh</Button>
{#if sheet.filters.length > 0}
<Button
class="btn btn-xs btn-ghost text-warning p-0"
onClick={async () => {
if (sheet) {
sheet.filters = []
void loadDataWithNewSorts(sheet.sorts)
}
}}
dataTestId="clear-all-filters-button"
>Clear All Filters</Button>
{/if}
{#if PARADIGM === 'DESKTOP'}
<Button
class="btn btn-xs btn-ghost text-primary p-0"
Expand Down
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.11.4
Loading