Skip to content

Commit d899820

Browse files
feat(ui): owner setting for tables created during CSV import (#413)
* feat(ui): owner setting for tables created during CSV import * update submodule * OSS test * OSS test * ent tests * sync with questdb master * update submodule --------- Co-authored-by: Vlad Ilyushchenko <bluestreak@gmail.com>
1 parent 4130281 commit d899820

11 files changed

Lines changed: 373 additions & 218 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
date,underlying,name,exchange,symbol,fut_expiration_date,bid,ask,open,high,low,close,volume,open_interest,strike_multiplier,option_price_multiplier
2+
2005-12-01T00:00:00.000000Z,AC,Denatured Fuel Ethanol Futures,CBOT,AC/05Z.CB,1134518400000,0.000000,0.000000,1.900000,1.900000,1.900000,1.900000,2,64,1.000000,1.000000
3+
2005-12-01T00:00:00.000000Z,AC,Denatured Fuel Ethanol Futures,CBOT,AC/06F.CB,1137110400000,0.000000,0.000000,0.000000,1.865000,1.865000,1.865000,0,83,1.000000,1.000000

packages/browser-tests/cypress/integration/console/import.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ describe("questdb import", () => {
88
it("display import panel", () => {
99
cy.getByDataHook("import-panel-button").click();
1010
cy.getByDataHook("import-dropbox").should("be.visible");
11+
cy.getByDataHook("import-browse-from-disk").should("be.visible");
12+
13+
cy.get('input[type="file"]').selectFile("cypress/fixtures/test.csv", { force: true });
14+
cy.getByDataHook("import-table-column-schema").should("be.visible");
15+
cy.getByDataHook("import-table-column-owner").should("not.exist");
1116
});
1217
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference types="cypress" />
2+
3+
describe("CSV import in enterprise", () => {
4+
before(() => {
5+
cy.loadConsoleWithAuth();
6+
});
7+
8+
it("display import panel", () => {
9+
cy.getByDataHook("import-panel-button").click();
10+
cy.getByDataHook("import-dropbox").should("be.visible");
11+
cy.getByDataHook("import-browse-from-disk").should("be.visible");
12+
13+
cy.get('input[type="file"]').selectFile("cypress/fixtures/test.csv", { force: true });
14+
cy.getByDataHook("import-table-column-schema").should("be.visible");
15+
cy.getByDataHook("import-table-column-owner").should("be.visible");
16+
cy.contains("option", "admin").should("exist");
17+
});
18+
});

packages/browser-tests/cypress/integration/enterprise/oidc.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,32 @@ describe("OIDC authentication", () => {
9696
cy.getByDataHook("button-log-in").click()
9797
cy.getEditor().should("be.visible");
9898
});
99+
100+
it("display import panel", () => {
101+
interceptAuthorizationCodeRequest(`${baseUrl}?code=abcdefgh`);
102+
cy.getByDataHook("button-sso-login").click();
103+
cy.wait("@authorizationCode");
104+
105+
interceptTokenRequest({
106+
"access_token": "gslpJtzmmi6RwaPSx0dYGD4tEkom",
107+
"refresh_token": "FUuAAqMp6LSTKmkUd5uZuodhiE4Kr6M7Eyv",
108+
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6I",
109+
"token_type": "Bearer",
110+
"expires_in": 300
111+
});
112+
cy.wait("@tokens");
113+
cy.getEditor().should("be.visible");
114+
115+
cy.getByDataHook("import-panel-button").click();
116+
cy.getByDataHook("import-dropbox").should("be.visible");
117+
cy.getByDataHook("import-browse-from-disk").should("be.visible");
118+
119+
cy.get('input[type="file"]').selectFile("cypress/fixtures/test.csv", { force: true });
120+
cy.getByDataHook("import-table-column-schema").should("be.visible");
121+
cy.getByDataHook("import-table-column-owner").should("be.visible");
122+
cy.contains("option", "user1").should("not.exist");
123+
cy.contains("option", "group1").should("exist");
124+
125+
cy.logout();
126+
});
99127
});

packages/web-console/serve-dist.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const server = http.createServer((req, res) => {
1010
res.statusCode = 403;
1111
res.end();
1212
return;
13-
}
13+
}
1414
const { method } = req
1515
const baseUrl = "http://" + req.headers.host + contextPath;
1616
const reqUrl = new url.URL(req.url, baseUrl);
@@ -20,7 +20,8 @@ const server = http.createServer((req, res) => {
2020
if (
2121
reqPathName.startsWith("/exec") ||
2222
reqPathName.startsWith("/settings") ||
23-
reqPathName.startsWith("/warnings")
23+
reqPathName.startsWith("/warnings") ||
24+
reqPathName.startsWith("/chk")
2425
) {
2526
// proxy /exec requests to localhost:9000
2627
const options = {

0 commit comments

Comments
 (0)