From 294a197d19c893f878029b836b6ddf2bc0e0e974 Mon Sep 17 00:00:00 2001 From: johnSamilin Date: Tue, 16 May 2023 09:36:25 +0300 Subject: [PATCH 1/5] Adds demo login fixes #61 --- _index.html | 5 +- src/constants/routes.mjs | 2 +- src/core/AuthManager.mjs | 9 + src/core/SettingsManager.mjs | 2 +- src/layouts/Login/LoginLayout.css | 7 + src/layouts/Main/MainLayout.mjs | 9 + translations/ar.json | 5 + translations/bn.json | 5 + translations/en.json | 358 +++++++++++++++++++++++++++++- translations/generated/ar.html | 5 +- translations/generated/bn.html | 5 +- translations/generated/en.html | 5 +- translations/generated/he.html | 5 +- translations/generated/hi.html | 5 +- translations/generated/ko.html | 5 +- translations/generated/ru.html | 5 +- translations/generated/zh.html | 5 +- translations/he.json | 5 + translations/hi.json | 5 + translations/ko.json | 5 + translations/ru.json | 5 + translations/zh.json | 5 + 22 files changed, 455 insertions(+), 12 deletions(-) diff --git a/_index.html b/_index.html index a556982..93a288d 100644 --- a/_index.html +++ b/_index.html @@ -268,7 +268,10 @@

Enter Rosplata

Sign in with your google account to start using shared budgets

- +
+ + +
What is Rosplata? diff --git a/src/constants/routes.mjs b/src/constants/routes.mjs index cf902b0..1cc78d1 100644 --- a/src/constants/routes.mjs +++ b/src/constants/routes.mjs @@ -1,7 +1,7 @@ export const BASE_URL = '' export const ROUTES = [ - { pattern: BASE_URL + '/', layout: 'main' }, + { pattern: BASE_URL + '/(demo)?', layout: 'main' }, { pattern: BASE_URL + '/create', layout: 'main', params: { create: true } }, { pattern: BASE_URL + '/budgets/:id', layout: 'main' }, { pattern: BASE_URL + '/settings/:section?', layout: 'settings' }, diff --git a/src/core/AuthManager.mjs b/src/core/AuthManager.mjs index 274a868..5d5ac51 100644 --- a/src/core/AuthManager.mjs +++ b/src/core/AuthManager.mjs @@ -79,6 +79,15 @@ class CAuthManager { }) } + requestDemoAccess() { + this.isLoggedIn = true + this.#data = { + id: 'rosplataapp', + name: 'Demo Account', + token: 'demoaccount', + } + } + login = async () => { try { this.#gProvider = new GoogleAuthProvider() diff --git a/src/core/SettingsManager.mjs b/src/core/SettingsManager.mjs index 58f0af1..9abac22 100644 --- a/src/core/SettingsManager.mjs +++ b/src/core/SettingsManager.mjs @@ -5,7 +5,7 @@ import { getFromLs, updateFormatters } from "../utils/utils.mjs" const darkThemeMedia = matchMedia('(prefers-color-scheme: dark)') class CSettingsManager { - #appVersion = '0.2.4' + #appVersion = '0.2.5' #animationsEnabled = true #autoLoginEnabled = getFromLs('autoLoginEnabled', 'true') === 'true' #theme = getFromLs('theme', 'system') diff --git a/src/layouts/Login/LoginLayout.css b/src/layouts/Login/LoginLayout.css index d6ecc64..a7f4028 100644 --- a/src/layouts/Login/LoginLayout.css +++ b/src/layouts/Login/LoginLayout.css @@ -26,6 +26,13 @@ color: darkslategray; font-size: 1.75vh; } +.layout-login__variants { + display: flex; + flex-direction: column; +} +.layout-login__variant--demo { + margin: 1rem; +} @media screen and (max-width: 425px) { #layout-login { diff --git a/src/layouts/Main/MainLayout.mjs b/src/layouts/Main/MainLayout.mjs index a6990a0..ef7a8a6 100644 --- a/src/layouts/Main/MainLayout.mjs +++ b/src/layouts/Main/MainLayout.mjs @@ -8,6 +8,7 @@ import { Router } from '../../core/Router.mjs' import { importStyle } from '../../utils/imports.js' import { FeatureDetector } from '../../core/FeatureDetector.mjs' import { NewBudget } from '../../containers/NewBudget/NewBudget.mjs' +import { AuthManager } from '../../core/AuthManager.mjs' importStyle('/src/layouts/Main/MainLayout.css') @@ -20,6 +21,14 @@ const template = document.querySelector('template#layout-main-template') export class MainLayout extends AnimatedComponent { containerId = 'layout-main' + constructor() { + const params = Router.routeParams + if (params[0] === 'demo') { + AuthManager.requestDemoAccess() + } + super() + } + renderTo(parent) { budgetListController = new BudgetList() budgetDetailsController = new BudgetDetails() diff --git a/translations/ar.json b/translations/ar.json index b1e963e..799d1d7 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -249,6 +249,11 @@ "prop": "text", "defaultValue": "Enter" }, + "demo-login": { + "value": "تسجيل الدخول التجريبي", + "prop": "text", + "defaultValue": "Demo login" + }, "landing-page": { "value": "ما هو روزبلاتا?", "prop": "text", diff --git a/translations/bn.json b/translations/bn.json index a95b4a2..79e1c36 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -249,6 +249,11 @@ "prop": "text", "defaultValue": "Enter" }, + "demo-login": { + "value": "ডেমো লগইন", + "prop": "text", + "defaultValue": "Demo login" + }, "landing-page": { "value": "রোসপ্লাটা কী?", "prop": "text", diff --git a/translations/en.json b/translations/en.json index 1188f92..584853c 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1 +1,357 @@ -{"page-title":{"value":"Rosplata","prop":"text","defaultValue":"Rosplata"},"description":{"value":"Rosplata הוא מנהל כספים שיתופי המארח במקור פתוח. צור תקציבים, שתף אותם עם חברים ופצל בקלות את החשבונות","prop":"content","defaultValue":"Rosplata is an opensource self hosted collaborative finance manager. Create budgets, share them with friends and easily split the bills"},"keywords":{"value":"מקור פתוח, שיתופי, מימון, תקציב, פיצול, הצעת חוק","prop":"content","defaultValue":"opensource, collaborative, finance, budget, split, bill"},"feature-checkup-title":{"value":"הדפדפן שלך חייב לתמוך בתכונות אלו","prop":"text","defaultValue":"Your browser must support these features"},"feature-checkup-description":{"value":"מצטער על אי הנוחות. נסה לפתוח את האפליקציה הזו בכרום או ב-Edge.","prop":"text","defaultValue":"Sorry for inconvenience. Try opening this app in Chrome or Edge."},"settings-item-app-version":{"value":"גרסת האפליקציה","prop":"text","defaultValue":"App version"},"settings-item-autologin":{"value":"כניסה אוטומטית","prop":"text","defaultValue":"Autologin"},"settings-item-theme":{"value":"נושא צבע","prop":"text","defaultValue":"Theme"},"settings-item-theme-system":{"value":"נושא המערכת","prop":"text","defaultValue":"System"},"settings-item-theme-light":{"value":"נושא קליל","prop":"text","defaultValue":"Light"},"settings-item-theme-dark":{"value":"ערכת נושא כהה","prop":"text","defaultValue":"Dark"},"settings-item-language":{"value":"שפה","prop":"text","defaultValue":"Language"},"settings-item-language-system":{"value":"תן לדפדפן להחליט","prop":"text","defaultValue":"Let browser decide"},"settings-item-language-ru":{"value":"Русский","prop":"text","defaultValue":"Russian"},"settings-item-language-en":{"value":"English","prop":"text","defaultValue":"English"},"settings-item-language-hi":{"value":"हिन्दी","prop":"text","defaultValue":"Hindi"},"settings-item-language-bn":{"value":"বাংলা","prop":"text","defaultValue":"Bengali"},"settings-item-language-zn":{"value":"中文","prop":"text","defaultValue":"Chinese"},"settings-item-language-ar":{"value":"العربية","prop":"text","defaultValue":"Arabic"},"settings-item-language-ko":{"value":"한국어","prop":"text","defaultValue":"Korean"},"settings-item-language-he":{"value":"עברית","prop":"text","defaultValue":"Hebrew"},"budgets-list-new":{"value":"צור תקציב חדש","prop":"text","defaultValue":"Create new"},"back":{"value":"תחזור","prop":"text","defaultValue":"Back"},"settings-button":{"value":"","prop":"text","defaultValue":"Settings"},"budget-details-my-balance":{"value":"האיזון שלי","prop":"text","defaultValue":"My balance"},"budget-details-total-sum":{"value":"סכום כולל","prop":"text","defaultValue":"Total sum"},"budget-details-actions-invite":{"value":"אתם מוזמנים להשתתף","prop":"text","defaultValue":"You are invited to participate"},"budget-details-actions-accept":{"value":"לְקַבֵּל","prop":"text","defaultValue":"Accept"},"budget-details-actions-decline":{"value":"יְרִידָה","prop":"text","defaultValue":"Decline"},"budget-details-actions-open-notification":{"value":"","prop":"text","defaultValue":"This budget is open. Your request will be automatically approved."},"budget-details-actions-ask":{"value":"אתה יכול לבקש הזמנה","prop":"text","defaultValue":"You can ask for invite"},"budget-details-actions-send-request":{"value":"שלח בקשה","prop":"text","defaultValue":"Send request"},"budget-details-actions-wait":{"value":"בעל התקציב צריך לאשר את בקשתך","prop":"text","defaultValue":"Budget owner have to approve your request"},"close":{"value":"לִסְגוֹר","prop":"text","defaultValue":"Close"},"participants-list-button":{"value":"משתתפים","prop":"text","defaultValue":"Participants"},"settings-btn":{"value":"","prop":"text","defaultValue":"Settings"},"budget-details-add-people":{"value":"הוסף אנשים","prop":"text","defaultValue":"Add people"},"budget-details-settings-open":{"value":"","prop":"text","defaultValue":"Open"},"budget-settings-isOpen":{"value":"","prop":"text","defaultValue":"In open budgets participation requests are being approved automatically."},"budget-settings-save-btn":{"value":"","prop":"text","defaultValue":"Save"},"transactions-list-ok":{"value":"בסדר","prop":"text","defaultValue":"mkay"},"transactions-list-comment":{"value":"הוסף הערה אופציונלית","prop":"placeholder","defaultValue":"Add optional comment"},"feature-detector-title":{"value":"מאפיינים","prop":"text","defaultValue":"Features"},"feature-detector-description":{"value":"תכונות שצריך לתמוך כדי שהאפליקציה הזו תעבוד","prop":"text","defaultValue":"That need to be supported for this app to work"},"menu-budgets":{"value":"תקציבים","prop":"text","defaultValue":"Budgets"},"menu-settings":{"value":"הגדרות","prop":"text","defaultValue":"Settings"},"menu-logout":{"value":"התנתק","prop":"text","defaultValue":"Log out"},"layout-login-title":{"value":"היכנס לרוספלטה","prop":"text","defaultValue":"Enter Rosplata"},"layout-login-description":{"value":"היכנס עם חשבון Google שלך כדי להתחיל להשתמש בתקציבים משותפים","prop":"text","defaultValue":"Sign in with your google account to start using shared budgets"},"layout-login-enter":{"value":"להיכנס","prop":"text","defaultValue":"Enter"},"landing-page":{"value":"","prop":"text","defaultValue":"What is Rosplata?"},"new-budget-title":{"value":"כותרת תקציב חדשה","prop":"text","defaultValue":""},"new-budget-currency":{"value":"תבחר מדינה","prop":"text","defaultValue":"Select currency"},"currency-rub":{"value":"רובל רוסי","prop":"text","defaultValue":"Russian Rouble"},"currency-inr":{"value":"רופי הודי","prop":"text","defaultValue":"Indian Rupee"},"currency-usd":{"value":"דולר אמריקאי","prop":"text","defaultValue":"US Dollar"},"currency-eur":{"value":"יוֹרוֹ","prop":"text","defaultValue":"Euro"},"currency-cny":{"value":"יואן סיני","prop":"text","defaultValue":"Chinese Yuan"},"currency-jrd":{"value":"דינר ירדני","prop":"text","defaultValue":"Jordanian Dinar"},"new-budget-suggested-participants":{"value":"","prop":"text","defaultValue":"Suggested participants"},"new-budget-type":{"value":"","prop":"text","defaultValue":"Budget type"},"new-budget-is-open-notice":{"value":"","prop":"text","defaultValue":"If you turn this setting on, any participation requests will be automatically approved."},"new-budget-is-open":{"value":"","prop":"text","defaultValue":"Make this budget open"},"new-budget-go":{"value":"ללכת","prop":"text","defaultValue":"Go"},"new-budget-reset":{"value":"אִתחוּל","prop":"text","defaultValue":"Reset"},"participants-list-ban":{"value":"לֶאֱסוֹר","prop":"text","defaultValue":"Ban"},"participants-list-revert":{"value":"לַחֲזוֹר","prop":"text","defaultValue":"Revert"},"participants-list-approve":{"value":"לְאַשֵׁר","prop":"text","defaultValue":"Approve"},"invite-dialog-description":{"value":"סרוק את קוד ה-QR הזה כדי לפתוח את התקציב הזה במכשיר שלך.","prop":"text","defaultValue":"Scan this QR code to open this budget on your device."},"invite-dialog-share-link":{"value":"שתף קישור במקום זאת","prop":"text","defaultValue":"Share link instead"}} \ No newline at end of file +{ + "page-title": { + "value": "Rosplata", + "prop": "text", + "defaultValue": "Rosplata" + }, + "description": { + "value": "Rosplata הוא מנהל כספים שיתופי המארח במקור פתוח. צור תקציבים, שתף אותם עם חברים ופצל בקלות את החשבונות", + "prop": "content", + "defaultValue": "Rosplata is an opensource self hosted collaborative finance manager. Create budgets, share them with friends and easily split the bills" + }, + "keywords": { + "value": "מקור פתוח, שיתופי, מימון, תקציב, פיצול, הצעת חוק", + "prop": "content", + "defaultValue": "opensource, collaborative, finance, budget, split, bill" + }, + "feature-checkup-title": { + "value": "הדפדפן שלך חייב לתמוך בתכונות אלו", + "prop": "text", + "defaultValue": "Your browser must support these features" + }, + "feature-checkup-description": { + "value": "מצטער על אי הנוחות. נסה לפתוח את האפליקציה הזו בכרום או ב-Edge.", + "prop": "text", + "defaultValue": "Sorry for inconvenience. Try opening this app in Chrome or Edge." + }, + "settings-item-app-version": { + "value": "גרסת האפליקציה", + "prop": "text", + "defaultValue": "App version" + }, + "settings-item-autologin": { + "value": "כניסה אוטומטית", + "prop": "text", + "defaultValue": "Autologin" + }, + "settings-item-theme": { + "value": "נושא צבע", + "prop": "text", + "defaultValue": "Theme" + }, + "settings-item-theme-system": { + "value": "נושא המערכת", + "prop": "text", + "defaultValue": "System" + }, + "settings-item-theme-light": { + "value": "נושא קליל", + "prop": "text", + "defaultValue": "Light" + }, + "settings-item-theme-dark": { + "value": "ערכת נושא כהה", + "prop": "text", + "defaultValue": "Dark" + }, + "settings-item-language": { + "value": "שפה", + "prop": "text", + "defaultValue": "Language" + }, + "settings-item-language-system": { + "value": "תן לדפדפן להחליט", + "prop": "text", + "defaultValue": "Let browser decide" + }, + "settings-item-language-ru": { + "value": "Русский", + "prop": "text", + "defaultValue": "Russian" + }, + "settings-item-language-en": { + "value": "English", + "prop": "text", + "defaultValue": "English" + }, + "settings-item-language-hi": { + "value": "हिन्दी", + "prop": "text", + "defaultValue": "Hindi" + }, + "settings-item-language-bn": { + "value": "বাংলা", + "prop": "text", + "defaultValue": "Bengali" + }, + "settings-item-language-zn": { + "value": "中文", + "prop": "text", + "defaultValue": "Chinese" + }, + "settings-item-language-ar": { + "value": "العربية", + "prop": "text", + "defaultValue": "Arabic" + }, + "settings-item-language-ko": { + "value": "한국어", + "prop": "text", + "defaultValue": "Korean" + }, + "settings-item-language-he": { + "value": "עברית", + "prop": "text", + "defaultValue": "Hebrew" + }, + "budgets-list-new": { + "value": "צור תקציב חדש", + "prop": "text", + "defaultValue": "Create new" + }, + "back": { + "value": "תחזור", + "prop": "text", + "defaultValue": "Back" + }, + "settings-button": { + "value": "", + "prop": "text", + "defaultValue": "Settings" + }, + "budget-details-my-balance": { + "value": "האיזון שלי", + "prop": "text", + "defaultValue": "My balance" + }, + "budget-details-total-sum": { + "value": "סכום כולל", + "prop": "text", + "defaultValue": "Total sum" + }, + "budget-details-actions-invite": { + "value": "אתם מוזמנים להשתתף", + "prop": "text", + "defaultValue": "You are invited to participate" + }, + "budget-details-actions-accept": { + "value": "לְקַבֵּל", + "prop": "text", + "defaultValue": "Accept" + }, + "budget-details-actions-decline": { + "value": "יְרִידָה", + "prop": "text", + "defaultValue": "Decline" + }, + "budget-details-actions-open-notification": { + "value": "", + "prop": "text", + "defaultValue": "This budget is open. Your request will be automatically approved." + }, + "budget-details-actions-ask": { + "value": "אתה יכול לבקש הזמנה", + "prop": "text", + "defaultValue": "You can ask for invite" + }, + "budget-details-actions-send-request": { + "value": "שלח בקשה", + "prop": "text", + "defaultValue": "Send request" + }, + "budget-details-actions-wait": { + "value": "בעל התקציב צריך לאשר את בקשתך", + "prop": "text", + "defaultValue": "Budget owner have to approve your request" + }, + "close": { + "value": "לִסְגוֹר", + "prop": "text", + "defaultValue": "Close" + }, + "participants-list-button": { + "value": "משתתפים", + "prop": "text", + "defaultValue": "Participants" + }, + "settings-btn": { + "value": "", + "prop": "text", + "defaultValue": "Settings" + }, + "budget-details-add-people": { + "value": "הוסף אנשים", + "prop": "text", + "defaultValue": "Add people" + }, + "budget-details-settings-open": { + "value": "", + "prop": "text", + "defaultValue": "Open" + }, + "budget-settings-isOpen": { + "value": "", + "prop": "text", + "defaultValue": "In open budgets participation requests are being approved automatically." + }, + "budget-settings-save-btn": { + "value": "", + "prop": "text", + "defaultValue": "Save" + }, + "transactions-list-ok": { + "value": "בסדר", + "prop": "text", + "defaultValue": "mkay" + }, + "transactions-list-comment": { + "value": "הוסף הערה אופציונלית", + "prop": "placeholder", + "defaultValue": "Add optional comment" + }, + "feature-detector-title": { + "value": "מאפיינים", + "prop": "text", + "defaultValue": "Features" + }, + "feature-detector-description": { + "value": "תכונות שצריך לתמוך כדי שהאפליקציה הזו תעבוד", + "prop": "text", + "defaultValue": "That need to be supported for this app to work" + }, + "menu-budgets": { + "value": "תקציבים", + "prop": "text", + "defaultValue": "Budgets" + }, + "menu-settings": { + "value": "הגדרות", + "prop": "text", + "defaultValue": "Settings" + }, + "menu-logout": { + "value": "התנתק", + "prop": "text", + "defaultValue": "Log out" + }, + "layout-login-title": { + "value": "היכנס לרוספלטה", + "prop": "text", + "defaultValue": "Enter Rosplata" + }, + "layout-login-description": { + "value": "היכנס עם חשבון Google שלך כדי להתחיל להשתמש בתקציבים משותפים", + "prop": "text", + "defaultValue": "Sign in with your google account to start using shared budgets" + }, + "layout-login-enter": { + "value": "להיכנס", + "prop": "text", + "defaultValue": "Enter" + }, + "demo-login": { + "value": "", + "prop": "text", + "defaultValue": "Demo login" + }, + "landing-page": { + "value": "", + "prop": "text", + "defaultValue": "What is Rosplata?" + }, + "new-budget-title": { + "value": "כותרת תקציב חדשה", + "prop": "text", + "defaultValue": "" + }, + "new-budget-currency": { + "value": "תבחר מדינה", + "prop": "text", + "defaultValue": "Select currency" + }, + "currency-rub": { + "value": "רובל רוסי", + "prop": "text", + "defaultValue": "Russian Rouble" + }, + "currency-inr": { + "value": "רופי הודי", + "prop": "text", + "defaultValue": "Indian Rupee" + }, + "currency-usd": { + "value": "דולר אמריקאי", + "prop": "text", + "defaultValue": "US Dollar" + }, + "currency-eur": { + "value": "יוֹרוֹ", + "prop": "text", + "defaultValue": "Euro" + }, + "currency-cny": { + "value": "יואן סיני", + "prop": "text", + "defaultValue": "Chinese Yuan" + }, + "currency-jrd": { + "value": "דינר ירדני", + "prop": "text", + "defaultValue": "Jordanian Dinar" + }, + "new-budget-suggested-participants": { + "value": "", + "prop": "text", + "defaultValue": "Suggested participants" + }, + "new-budget-type": { + "value": "", + "prop": "text", + "defaultValue": "Budget type" + }, + "new-budget-is-open-notice": { + "value": "", + "prop": "text", + "defaultValue": "If you turn this setting on, any participation requests will be automatically approved." + }, + "new-budget-is-open": { + "value": "", + "prop": "text", + "defaultValue": "Make this budget open" + }, + "new-budget-go": { + "value": "ללכת", + "prop": "text", + "defaultValue": "Go" + }, + "new-budget-reset": { + "value": "אִתחוּל", + "prop": "text", + "defaultValue": "Reset" + }, + "participants-list-ban": { + "value": "לֶאֱסוֹר", + "prop": "text", + "defaultValue": "Ban" + }, + "participants-list-revert": { + "value": "לַחֲזוֹר", + "prop": "text", + "defaultValue": "Revert" + }, + "participants-list-approve": { + "value": "לְאַשֵׁר", + "prop": "text", + "defaultValue": "Approve" + }, + "invite-dialog-description": { + "value": "סרוק את קוד ה-QR הזה כדי לפתוח את התקציב הזה במכשיר שלך.", + "prop": "text", + "defaultValue": "Scan this QR code to open this budget on your device." + }, + "invite-dialog-share-link": { + "value": "שתף קישור במקום זאת", + "prop": "text", + "defaultValue": "Share link instead" + } +} \ No newline at end of file diff --git a/translations/generated/ar.html b/translations/generated/ar.html index 8bb0bf1..d333bcf 100644 --- a/translations/generated/ar.html +++ b/translations/generated/ar.html @@ -222,7 +222,10 @@
في المي