app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit a654e1b96ad43e532b5cd920536d82de78c8482f
parent 9e4ca5e5a4076049b24c3c193f9e3c767b7512a5
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Sat,  7 Dec 2024 22:32:02 +0000

Edit crate `core` update model `location_gcs` handlers, `tauri` update `location_gcs` SQL up migration. Edit `/cfg/init` localised strings, styles.

Diffstat:
Mcrates/core/src/models/location_gcs.rs | 15+++++++++++++++
Mcrates/tauri/migrations/0001_location_gcs.sql | 5+++++
Msrc/routes/(cfg)/cfg/init/+page.svelte | 39+++++++++++++++++++++++----------------
3 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/crates/core/src/models/location_gcs.rs b/crates/core/src/models/location_gcs.rs @@ -13,7 +13,12 @@ pub struct LocationGcs { lat: f64, lng: f64, geohash: String, + kind: String, label: Option<String>, + area: Option<f64>, + elevation: Option<i32>, + soil: Option<String>, + climate: Option<String>, gc_id: Option<String>, gc_name: Option<String>, gc_admin1_id: Option<String>, @@ -27,7 +32,12 @@ pub struct ILocationGcsFields { pub lat: String, pub lng: String, pub geohash: String, + pub kind: String, pub label: Option<String>, + pub area: Option<String>, + pub elevation: Option<String>, + pub soil: Option<String>, + pub climate: Option<String>, pub gc_id: Option<String>, pub gc_name: Option<String>, pub gc_admin1_id: Option<String>, @@ -41,7 +51,12 @@ pub struct ILocationGcsFieldsUpdate { pub lat: Option<String>, pub lng: Option<String>, pub geohash: Option<String>, + pub kind: Option<String>, pub label: Option<String>, + pub area: Option<String>, + pub elevation: Option<String>, + pub soil: Option<String>, + pub climate: Option<String>, pub gc_id: Option<String>, pub gc_name: Option<String>, pub gc_admin1_id: Option<String>, diff --git a/crates/tauri/migrations/0001_location_gcs.sql b/crates/tauri/migrations/0001_location_gcs.sql @@ -5,7 +5,12 @@ CREATE TABLE IF NOT EXISTS location_gcs ( lat REAL NOT NULL, lng REAL NOT NULL, geohash CHAR(12) UNIQUE CHECK(length(geohash) = 9), + kind TEXT NOT NULL, label TEXT, + area REAL, + elevation INTEGER, + soil TEXT, + climate TEXT, gc_id TEXT, gc_name TEXT, gc_admin1_id TEXT, diff --git a/src/routes/(cfg)/cfg/init/+page.svelte b/src/routes/(cfg)/cfg/init/+page.svelte @@ -520,7 +520,7 @@ await reset_ks(); await restart({ route: `/`, - notify_message: `${$ls(`app.page.cfg.init.notification.welcome`)}`, + notify_message: `${$ls(`app.cfg.init.notification.welcome`)}`, }); } catch (e) { console.log(`(error) submit `, e); @@ -550,7 +550,7 @@ <LogoCircle /> </div> <div - class={`flex flex-col w-full gap-2 justify-start items-center`} + class={`flex flex-col w-full pt-4 px-12 gap-2 justify-start items-center`} > <div class={`flex flex-row w-full justify-start items-center`} @@ -558,23 +558,30 @@ <p class={`font-sans font-[400] text-sm text-layer-0-glyph-label uppercase`} > - {`${$ls(`common.setup`)}`} + {`${$ls(`common.configure`)}`} </p> </div> <div - class={`grid grid-cols-12 flex flex-col gap-4 w-full justify-start items-center`} + class={`flex flex-col w-full gap-2 justify-start items-center`} > - {#each [`${$ls(`common.configure_your_device`)}`, `${$ls(`common.choose_a_profile_name`)}`, `${$ls(`common.terms_of_use_agreement`)}`] as li, li_i} - <div - class={`col-span-12 flex flex-row justify-start items-center`} + <div + class={`flex flex-row w-full justify-start items-center`} + > + <p + class={`font-mono font-[400] text-[1.1rem] text-layer-0-glyph`} > - <p - class={`font-mono font-[400] text-[1.1rem] text-layer-0-glyph`} - > - {`${li_i + 1}. ${li}`} - </p> - </div> - {/each} + {`${$ls(`app.cfg.init.greeting`)}`} + </p> + </div> + <div + class={`flex flex-row w-full justify-start items-center`} + > + <p + class={`font-mono font-[400] text-[1.1rem] text-layer-0-glyph`} + > + {`${$ls(`app.cfg.init.message`)}`} + </p> + </div> </div> </div> </div> @@ -644,7 +651,7 @@ <p class={`font-mono font-[600] text-layer-0-glyph text-3xl`} > - {`Using Public Key`} + {`${$ls(`common.using_public_key`)}`} </p> <DisplayLine basis={{ @@ -856,7 +863,7 @@ callback: async () => { if ($carousel_index === 0) { const confirm = await dialog.confirm({ - message: `${$ls(`app.page.cfg.init.notification.no_profile_name`)}`, + message: `${$ls(`app.cfg.init.notification.no_profile_name`)}`, cancel_label: `${$ls(`icu.add_*`, { value: `${$ls(`common.profile`)}` })}`, ok_label: `${$ls(`common.continue`)}`, });