From 52e7b072e622788bc55681c03c31833e3ba61e18 Mon Sep 17 00:00:00 2001 From: Gabriel Herbert Date: Sun, 17 Oct 2021 15:35:49 +0200 Subject: [PATCH 01/32] Added change logs to modules Change log summaries are now downloaded from repositories and displayed in admin UI. --- db/upgrade/upgrade.go | 6 +++++ repo/repo_get.go | 10 ++++---- repo/repo_update.go | 42 +++++++++++++++++--------------- repo/repo_update_modules.go | 18 +++++++++++++- types/types_repo.go | 2 ++ var/texts/de_de | 1 + var/texts/en_us | 1 + www/comps/admin/adminModules.js | 43 ++++++++++++++++++++++++++------- 8 files changed, 89 insertions(+), 34 deletions(-) diff --git a/db/upgrade/upgrade.go b/db/upgrade/upgrade.go index 4f71ed20..569c274f 100644 --- a/db/upgrade/upgrade.go +++ b/db/upgrade/upgrade.go @@ -94,6 +94,12 @@ func oneIteration(tx pgx.Tx, dbVersionCut string) error { // mapped by current database version string, returns new database version string var upgradeFunctions = map[string]func(tx pgx.Tx) (string, error){ + "2.4": func(tx pgx.Tx) (string, error) { + _, err := tx.Exec(db.Ctx, ` + ALTER TABLE instance.repo_module ADD COLUMN change_log TEXT; + `) + return "2.5", err + }, "2.3": func(tx pgx.Tx) (string, error) { _, err := tx.Exec(db.Ctx, ` CREATE TABLE IF NOT EXISTS app.field_chart ( diff --git a/repo/repo_get.go b/repo/repo_get.go index 1938d546..fac1da11 100644 --- a/repo/repo_get.go +++ b/repo/repo_get.go @@ -17,9 +17,9 @@ func GetModule(byString string, languageCode string, limit int, var qb tools.QueryBuilder qb.UseDollarSigns() - qb.AddList("SELECT", []string{"rm.module_id_wofk", "rm.name", "rm.author", - "rm.in_store", "rm.release_build", "rm.release_build_app", - "rm.release_date", "rm.file"}) + qb.AddList("SELECT", []string{"rm.module_id_wofk", "rm.name", + "rm.change_log", "rm.author", "rm.in_store", "rm.release_build", + "rm.release_build_app", "rm.release_date", "rm.file"}) qb.Set("FROM", "instance.repo_module AS rm") @@ -95,8 +95,8 @@ func GetModule(byString string, languageCode string, limit int, for rows.Next() { var rm types.RepoModule - if err := rows.Scan(&rm.ModuleId, &rm.Name, &rm.Author, &rm.InStore, - &rm.ReleaseBuild, &rm.ReleaseBuildApp, &rm.ReleaseDate, + if err := rows.Scan(&rm.ModuleId, &rm.Name, &rm.ChangeLog, &rm.Author, + &rm.InStore, &rm.ReleaseBuild, &rm.ReleaseBuildApp, &rm.ReleaseDate, &rm.FileId); err != nil { return repoModules, 0, err diff --git a/repo/repo_update.go b/repo/repo_update.go index 3199cbff..d4e402a6 100644 --- a/repo/repo_update.go +++ b/repo/repo_update.go @@ -15,7 +15,7 @@ import ( author 49c10371-c3ee-4d42-8961-d6d8ccda7bc7 author.name 295f5bd9-772a-41f0-aa81-530a0678e441 -language 820de67e-ee99-44f9-a37a-4a7d3ac7301c +language 820de67e-ee99-44f9-a37a-4a7d3ac7301c language.code 19bd7a3b-9b3d-45da-9c07-4d8f62874b35 module 08dfb28b-dbb4-4b70-8231-142235516385 @@ -23,12 +23,13 @@ module.name fbab278a-4898-4f46-a1d7-35d1a80ee3dc module.uuid 98bc635b-097e-4cf0-92c9-2bb97a7c2a5e module.in_store 0ba7005c-834b-4d2b-a967-d748f91c2bed module.author a72f2de6-e1ee-4432-804b-b57f44013f4c +module.log_summary f36130a9-bfed-42dc-920f-036ffd0d35b0 module_release a300afae-a8c5-4cfc-9375-d85f45c6347c module_release.file b28e8f5c-ebeb-4565-941b-4d942eedc588 module_release.module 922dc949-873f-4a21-9699-8740c0491b3a -module_release.release_build d0766fcc-7a68-490c-9c81-f542ad37109b -module_release.release_build_app ce998cfd-a66f-423c-b82b-d2b48a21c288 +module_release.release_build d0766fcc-7a68-490c-9c81-f542ad37109b +module_release.release_build_app ce998cfd-a66f-423c-b82b-d2b48a21c288 module_release.release_date 9f9b6cda-069d-405b-bbb8-c0d12bbce910 module_transl_meta 12ae386b-d1d2-48b2-a60b-2d5a11c42826 @@ -36,7 +37,7 @@ module_transl_meta.description 3cd8b8b1-3d3f-41b0-ba6c-d7ef567a686f module_transl_meta.language 8aa84747-8224-4f8d-baf1-2d87df374fe6 module_transl_meta.module 1091d013-988c-442b-beff-c853e8df20a8 module_transl_meta.support_page 4793cd87-0bc9-4797-9538-ca733007a1d1 -module_transl_meta.title 6f66272a-7713-45a8-9565-b0157939399b +module_transl_meta.title 6f66272a-7713-45a8-9565-b0157939399b */ // update internal module repository from external data API @@ -109,12 +110,13 @@ func addModules_tx(tx pgx.Tx, repoModuleMap map[uuid.UUID]types.RepoModule) erro if !exists { if _, err := tx.Exec(db.Ctx, ` INSERT INTO instance.repo_module ( - module_id_wofk, name, author, in_store, release_build, - release_build_app, release_date, file + module_id_wofk, name, change_log, author, in_store, + release_build, release_build_app, release_date, file ) - VALUES ($1,$2,$3,$4,$5,$6,$7,$8) - `, sm.ModuleId, sm.Name, sm.Author, sm.InStore, sm.ReleaseBuild, - sm.ReleaseBuildApp, sm.ReleaseDate, sm.FileId); err != nil { + VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9) + `, sm.ModuleId, sm.Name, sm.ChangeLog, sm.Author, sm.InStore, + sm.ReleaseBuild, sm.ReleaseBuildApp, sm.ReleaseDate, + sm.FileId); err != nil { return err } @@ -123,21 +125,23 @@ func addModules_tx(tx pgx.Tx, repoModuleMap map[uuid.UUID]types.RepoModule) erro if sm.ReleaseBuild == 0 { if _, err := tx.Exec(db.Ctx, ` UPDATE instance.repo_module - SET name = $1, author = $2, in_store = $3 - WHERE module_id_wofk = $4 - `, sm.Name, sm.Author, sm.InStore, sm.ModuleId); err != nil { + SET name = $1, change_log = $2, author = $3, in_store = $4 + WHERE module_id_wofk = $5 + `, sm.Name, sm.ChangeLog, sm.Author, sm.InStore, + sm.ModuleId); err != nil { + return err } } else { if _, err := tx.Exec(db.Ctx, ` UPDATE instance.repo_module - SET name = $1, author = $2, in_store = $3, - release_build = $4, release_build_app = $5, - release_date = $6, file = $7 - WHERE module_id_wofk = $8 - `, sm.Name, sm.Author, sm.InStore, sm.ReleaseBuild, - sm.ReleaseBuildApp, sm.ReleaseDate, sm.FileId, - sm.ModuleId); err != nil { + SET name = $1, change_log = $2, author = $3, in_store = $4, + release_build = $5, release_build_app = $6, + release_date = $7, file = $8 + WHERE module_id_wofk = $9 + `, sm.Name, sm.ChangeLog, sm.Author, sm.InStore, + sm.ReleaseBuild, sm.ReleaseBuildApp, sm.ReleaseDate, + sm.FileId, sm.ModuleId); err != nil { return err } diff --git a/repo/repo_update_modules.go b/repo/repo_update_modules.go index a73e8465..f607d2b3 100644 --- a/repo/repo_update_modules.go +++ b/repo/repo_update_modules.go @@ -41,6 +41,12 @@ func getModules(token string, url string, skipVerify bool, Aggregator: pgtype.Varchar{Status: pgtype.Null}, Index: 0, }, + types.DataGetExpression{ // module change log + AttributeId: tools.UuidStringToNullUuid("f36130a9-bfed-42dc-920f-036ffd0d35b0"), + AttributeIdNm: pgtype.UUID{Status: pgtype.Null}, + Aggregator: pgtype.Varchar{Status: pgtype.Null}, + Index: 0, + }, types.DataGetExpression{ // author name AttributeId: tools.UuidStringToNullUuid("295f5bd9-772a-41f0-aa81-530a0678e441"), AttributeIdNm: pgtype.UUID{Status: pgtype.Null}, @@ -68,7 +74,7 @@ func getModules(token string, url string, skipVerify bool, } for _, row := range res.Rows { - if len(row.Values) != 4 { + if len(row.Values) != 5 { return errors.New("invalid value count for store module") } @@ -83,6 +89,16 @@ func getModules(token string, url string, skipVerify bool, case 2: repo.InStore = value.(bool) case 3: + repo.ChangeLog = pgtype.Varchar{ + Status: pgtype.Null, + } + if value != nil { + repo.ChangeLog = pgtype.Varchar{ + Status: pgtype.Present, + String: value.(string), + } + } + case 4: repo.Author = value.(string) } } diff --git a/types/types_repo.go b/types/types_repo.go index 1ee6f40b..3ba40eb2 100644 --- a/types/types_repo.go +++ b/types/types_repo.go @@ -2,12 +2,14 @@ package types import ( "github.com/gofrs/uuid" + "github.com/jackc/pgtype" ) type RepoModule struct { ModuleId uuid.UUID `json:"moduleId"` FileId uuid.UUID `json:"fileId"` Name string `json:"name"` + ChangeLog pgtype.Varchar `json:"changeLog"` Author string `json:"author"` InStore bool `json:"inStore"` ReleaseBuild int `json:"releaseBuild"` diff --git a/var/texts/de_de b/var/texts/de_de index 53871445..e743c2a4 100644 --- a/var/texts/de_de +++ b/var/texts/de_de @@ -315,6 +315,7 @@ "installFailed":"Aktualisierung der Anwendung ist fehlgeschlagen. Bei Aktualisierung einer einzelnen Anwendung können fehlende Abhängigkeiten zu Problemen führen - bitte versuchen, alle Anwendungen gemeinsam zu aktualisieren, um diese zu lösen.

Fehlermeldung: {ERROR}", "uploadFailed":"Anwendung konnte nicht von der hochgeladenen Datei installiert werden. Bitte das Loglevel für Transfere auf \"Alles\" erhöhen und erneut versuchen - Details werden dann im Systemlog aufgeführt." }, + "changeLog":"Änderungshistorie", "dependOnUs":"Folgende Anwendungen sind hiervon abhängig: {NAMES}", "hidden":"Versteckt", "import":"Von Datei hinzufügen", diff --git a/var/texts/en_us b/var/texts/en_us index 56fe983c..7579eaf5 100644 --- a/var/texts/en_us +++ b/var/texts/en_us @@ -315,6 +315,7 @@ "installFailed":"Update of application has failed. When updating a single application, missing dependencies can causes issues - please try updating all applications together to resolve these.

Error message: {ERROR}", "uploadFailed":"Failed to add application from the uploaded file. Please increase the log level for transfers to 'Everything' and try again - details will then be visible in the system logs." }, + "changeLog":"Change log", "dependOnUs":"Following Applications depend on this: {NAMES}", "hidden":"Hidden", "import":"Add from file", diff --git a/www/comps/admin/adminModules.js b/www/comps/admin/adminModules.js index 48df097f..09d40b89 100644 --- a/www/comps/admin/adminModules.js +++ b/www/comps/admin/adminModules.js @@ -19,9 +19,6 @@ let MyAdminModulesItem = { - - '{{ module.name }}' v{{ module.releaseBuild }} - {{ module.releaseDate === 0 ? '-' : getUnixFormat(module.releaseDate,'Y-m-d') }} @@ -46,6 +43,14 @@ let MyAdminModulesItem = { :image="!installStarted ? 'download.png' : 'load.gif'" /> + + + {{ capGen.application }} - -
- - {{ capGen.version }} -
-
@@ -315,6 +334,12 @@ let MyAdminModules = { {{ capApp.update }}
+ +
+ + {{ capApp.changeLog }} +
+
From 496e6f017a41ec50930984ed3e24c4510af8bd01 Mon Sep 17 00:00:00 2001 From: Gabriel Herbert Date: Mon, 18 Oct 2021 12:43:55 +0200 Subject: [PATCH 02/32] Reworked Gantt field * Dynamic step count depending on field width. * Style updates. * Group label display option. --- var/texts/de_de | 2 + var/texts/en_us | 2 + www/comps/builder/builderFieldOptions.js | 24 ++--- www/comps/gantt.css | 16 ++- www/comps/gantt.js | 121 ++++++++++++++++++----- www/docs/en_us_builder.html | 8 +- 6 files changed, 126 insertions(+), 47 deletions(-) diff --git a/var/texts/de_de b/var/texts/de_de index e743c2a4..20735189 100644 --- a/var/texts/de_de +++ b/var/texts/de_de @@ -817,6 +817,8 @@ "icsHint":"Auf Kalender von Extern zugreifen", "icsPublish":"Für persönliche Nutzung veröffentlichen", "ganttToggleHint":"Zwischen Stunden- & Tagmodus wechseln", + "ganttShowLabels":"Gruppen", + "ganttShowLabelsHint":"Gruppen anzeigen/verstecken", "zoomResetHint":"Zoom-Level zurücksetzen" }, "icsDesc":"Diese URL verwenden, um Kalender zu abonnieren (iCalendar, ICS).", diff --git a/var/texts/en_us b/var/texts/en_us index 7579eaf5..e8a0d16d 100644 --- a/var/texts/en_us +++ b/var/texts/en_us @@ -817,6 +817,8 @@ "icsHint":"Access calendar from external application", "icsPublish":"Publish for personal use", "ganttToggleHint":"Toggle between day & hour mode", + "ganttShowLabels":"Groups", + "ganttShowLabelsHint":"Show/hide groups", "zoomResetHint":"Reset zoom level" }, "icsDesc":"Use this URL to subscribe to this calendar (iCalendar, ICS).", diff --git a/www/comps/builder/builderFieldOptions.js b/www/comps/builder/builderFieldOptions.js index 980f8483..9bc999c9 100644 --- a/www/comps/builder/builderFieldOptions.js +++ b/www/comps/builder/builderFieldOptions.js @@ -510,21 +510,13 @@ let MyBuilderFieldOptions = { - + {{ capApp.gantt }} - - - - {{ capApp.ics }} - - @@ -555,7 +547,17 @@ let MyBuilderFieldOptions = { -