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
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "frontend",
"homepage": ".",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down Expand Up @@ -28,6 +29,7 @@
"format": "eslint --fix 'src/**/*.js'"
},
"devDependencies": {
"@ungap/url-search-params": "^0.1.2",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.7.0",
"eslint-config-airbnb-base": "^12.1.0",
Expand Down
13 changes: 8 additions & 5 deletions frontend/src/api.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const envVars = window.gitbasepg || { SERVER_URL: '', SELECT_LIMIT: 100 };

const serverUrl = envVars.SERVER_URL || window.location.origin;
const serverUrl = envVars.SERVER_URL;
const selectLimit = envVars.SELECT_LIMIT;

const apiUrl = url => `${serverUrl}${url}`;
// if serverUrl is unset, this replaces the leading / in order to work behind proxies with a path other than /.
const apiUrl = url => `${serverUrl}${url}`.replace(/^\/+/g, '');

function statusError(resp) {
return new Error(resp.statusText || `${resp.status} Error`);
Expand Down Expand Up @@ -101,9 +102,11 @@ function query(sql, signal) {
}

function queryExport(sql) {
const url = new URL(apiUrl('/export'));
url.searchParams.append('query', sql);
return url.toString();
const rawUrl = apiUrl('/export');
const params = new URLSearchParams();
params.append('query', sql);
const url = `${rawUrl}?${params.toString()}`;
return url;
}

/* Returns an array in the form:
Expand Down
30 changes: 15 additions & 15 deletions frontend/src/fonts.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
* -------------------------- */
@font-face {
font-family: 'Hack';
src: url('/fonts/hack-regular.woff2') format('woff2'),
url('/fonts/hack-regular.woff') format('woff');
src: url('./fonts/hack-regular.woff2') format('woff2'),
url('./fonts/hack-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'Hack';
src: url('/fonts/hack-bold.woff2') format('woff2'),
url('/fonts/hack-bold.woff') format('woff');
src: url('./fonts/hack-bold.woff2') format('woff2'),
url('./fonts/hack-bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'Hack';
src: url('/fonts/hack-italic.woff2') format('woff2'),
url('/fonts/hack-italic.woff') format('woff');
src: url('./fonts/hack-italic.woff2') format('woff2'),
url('./fonts/hack-italic.woff') format('woff');
font-weight: 400;
font-style: italic;
}

@font-face {
font-family: 'Hack';
src: url('/fonts/hack-bolditalic.woff2') format('woff2'),
url('/fonts/hack-bolditalic.woff') format('woff');
src: url('./fonts/hack-bolditalic.woff2') format('woff2'),
url('./fonts/hack-bolditalic.woff') format('woff');
font-weight: 700;
font-style: italic;
}
Expand All @@ -49,7 +49,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2)
format('woff2');
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F,
U+FE2E-FE2F;
Expand All @@ -60,7 +60,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2)
format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
Expand All @@ -70,7 +70,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2)
format('woff2');
unicode-range: U+1F00-1FFF;
}
Expand All @@ -80,7 +80,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2)
format('woff2');
unicode-range: U+0370-03FF;
}
Expand All @@ -90,7 +90,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2)
format('woff2');
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
}
Expand All @@ -100,7 +100,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2)
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2)
format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
Expand All @@ -111,7 +111,7 @@
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'),
url(/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format('woff2');
url(./fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
U+2215, U+FEFF, U+FFFD;
Expand Down
File renamed without changes.
Binary file added frontend/src/fonts/hack-bolditalic.woff2
Binary file not shown.
1 change: 1 addition & 0 deletions frontend/src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ global.localStorage = new LocalStorage(

global.window = document.defaultView;
global.window.localStorage = global.localStorage;
global.window.URLSearchParams = require('@ungap/url-search-params');

initButtonStyles();

Expand Down
5 changes: 5 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.3.tgz#3918b73ceed484e58367be5acb79d1775239e393"
integrity sha512-sfGmOtSMSbQ/AKG8V9xD1gmjquC9awIIZ/Kj309pHb2n3bcRAcGMQv5nJ6gCXZVsneGE4+ve8DXKRCsrg3TFzg==

"@ungap/url-search-params@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@ungap/url-search-params/-/url-search-params-0.1.2.tgz#8ba8c0527543fe675d1c29ae0a2daca842e8ee4f"
integrity sha512-WVk5+lJ+AoNLh2sIDMhnEAgLsVQuI067hWLJCzirErH1GYiy1gs09q4+XZxYWSvdAsslKsaO4q1iXXMx2c72dA==

abab@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"
Expand Down