diff --git a/gymboard-app/.env.development b/gymboard-app/.env.development
new file mode 100644
index 0000000..e7db5ec
--- /dev/null
+++ b/gymboard-app/.env.development
@@ -0,0 +1,3 @@
+API_URL=http://localhost:8080
+CDN_URL=http://localhost:8082
+SEARCH_URL=http://localhost:8081
diff --git a/gymboard-app/.env.production b/gymboard-app/.env.production
new file mode 100644
index 0000000..b0f9279
--- /dev/null
+++ b/gymboard-app/.env.production
@@ -0,0 +1,3 @@
+API_URL=https://api.gymboard.com
+CDN_URL=https://cdn.gymboard.com
+SEARCH_URL=https://search.gymboard.com
diff --git a/gymboard-app/package-lock.json b/gymboard-app/package-lock.json
index a2f394c..d0da756 100644
--- a/gymboard-app/package-lock.json
+++ b/gymboard-app/package-lock.json
@@ -11,6 +11,7 @@
"@quasar/cli": "^2.0.0",
"@quasar/extras": "^1.0.0",
"axios": "^0.21.1",
+ "dotenv": "^16.0.3",
"luxon": "^3.2.1",
"moment": "^2.29.4",
"pinia": "^2.0.11",
@@ -2166,6 +2167,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/dotenv": {
+ "version": "16.0.3",
+ "resolved": "http://192.168.88.248:8081/repository/npm-public/dotenv/-/dotenv-16.0.3.tgz",
+ "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ }
+ },
"node_modules/eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -7937,6 +7947,11 @@
"is-obj": "^2.0.0"
}
},
+ "dotenv": {
+ "version": "16.0.3",
+ "resolved": "http://192.168.88.248:8081/repository/npm-public/dotenv/-/dotenv-16.0.3.tgz",
+ "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
+ },
"eastasianwidth": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
diff --git a/gymboard-app/package.json b/gymboard-app/package.json
index f714341..9571ee6 100644
--- a/gymboard-app/package.json
+++ b/gymboard-app/package.json
@@ -14,6 +14,7 @@
"@quasar/cli": "^2.0.0",
"@quasar/extras": "^1.0.0",
"axios": "^0.21.1",
+ "dotenv": "^16.0.3",
"luxon": "^3.2.1",
"moment": "^2.29.4",
"pinia": "^2.0.11",
diff --git a/gymboard-app/quasar.config.js b/gymboard-app/quasar.config.js
index 4b15218..70c8a04 100644
--- a/gymboard-app/quasar.config.js
+++ b/gymboard-app/quasar.config.js
@@ -12,6 +12,8 @@ const { configure } = require('quasar/wrappers');
const path = require('path');
const { withCtx } = require('vue');
+require('dotenv').config();
+
module.exports = configure(function (ctx) {
return {
eslint: {
@@ -65,7 +67,9 @@ module.exports = configure(function (ctx) {
// publicPath: '/',
// analyze: true,
env: {
- API: ctx.dev ? 'http://localhost:8080' : 'https://api.gymboard.com',
+ API_URL: process.env.API_URL,
+ CDN_URL: process.env.CDN_URL,
+ SEARCH_URL: process.env.SEARCH_URL,
},
// rawDefine: {}
// ignorePublicFolder: true,
diff --git a/gymboard-app/src/api/main/auth.ts b/gymboard-app/src/api/main/auth.ts
index 1e7ff48..575d258 100644
--- a/gymboard-app/src/api/main/auth.ts
+++ b/gymboard-app/src/api/main/auth.ts
@@ -1,6 +1,7 @@
import {api} from 'src/api/main/index';
import {AuthStoreType} from 'stores/auth-store';
import Timeout = NodeJS.Timeout;
+import {WeightUnit} from 'src/api/main/submission';
export interface User {
id: string;
@@ -21,7 +22,7 @@ export interface UserPersonalDetails {
userId: string;
birthDate?: string;
currentWeight?: number;
- currentWeightUnit?: number;
+ currentWeightUnit?: WeightUnit;
currentMetricWeight?: number;
sex: PersonSex;
}
diff --git a/gymboard-app/src/api/main/index.ts b/gymboard-app/src/api/main/index.ts
index 2255b8d..de65c54 100644
--- a/gymboard-app/src/api/main/index.ts
+++ b/gymboard-app/src/api/main/index.ts
@@ -3,12 +3,9 @@ import GymsModule from 'src/api/main/gyms';
import ExercisesModule from 'src/api/main/exercises';
import LeaderboardsModule from 'src/api/main/leaderboards';
import AuthModule from 'src/api/main/auth';
-
-export const BASE_URL = 'http://localhost:8080';
-
-// TODO: Figure out how to get the base URL from environment.
+console.log(process.env);
export const api = axios.create({
- baseURL: BASE_URL,
+ baseURL: process.env.API_URL,
});
class GymboardApi {
diff --git a/gymboard-app/src/boot/i18n.ts b/gymboard-app/src/boot/i18n.ts
index 5b86bf2..b7fb451 100644
--- a/gymboard-app/src/boot/i18n.ts
+++ b/gymboard-app/src/boot/i18n.ts
@@ -37,7 +37,7 @@ export default boot(({ app }) => {
}
// Temporary override if you want to test a particular locale.
- i18n.global.locale.value = 'nl-NL';
+ // i18n.global.locale.value = 'nl-NL';
// Set i18n instance on app
app.use(i18n);
diff --git a/gymboard-app/src/components/EditablePropertyRow.vue b/gymboard-app/src/components/EditablePropertyRow.vue
index 4d3ea99..29d75a6 100644
--- a/gymboard-app/src/components/EditablePropertyRow.vue
+++ b/gymboard-app/src/components/EditablePropertyRow.vue
@@ -2,11 +2,12 @@
{{ label }}
-
+
@@ -14,6 +15,16 @@
+
+
+
+
@@ -24,6 +35,8 @@ interface Props {
label: string;
inputType?: any;
modelValue: string | number | boolean | DateTime;
+ selectOptions?: Array