From e1a522a6a39a54b938f71d4f0d8e6daaabb4b85a Mon Sep 17 00:00:00 2001 From: Eryk Kulikowski Date: Mon, 17 Apr 2023 11:53:19 +0200 Subject: [PATCH] KU Leuven custom executable build --- Makefile | 9 ++++++++- .../kul_customizations/assets/html/header.html | 18 ++++++++++++++++++ image/app/frontend/config.go | 4 ++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 conf/kul_customizations/assets/html/header.html diff --git a/Makefile b/Makefile index 6048913..53da508 100644 --- a/Makefile +++ b/Makefile @@ -70,4 +70,11 @@ multiplatform_demo: fmt frontend ## build executable for multiple platforms fix_optimization_error: ## angular needs newer version of terser to optimize typescript 4.4 or later (static initiallization blocks) rm -rf ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser - cp -r ../rdm-integration-frontend/node_modules/terser ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser \ No newline at end of file + cp -r ../rdm-integration-frontend/node_modules/terser ../rdm-integration-frontend/node_modules/@angular-devkit/build-angular/node_modules/terser + +multiplatform_kul: fmt frontend ## build KUL executable for multiple platforms + cp -r conf/kul_customizations/* image/app/frontend/dist/datasync/ + cd image && env GOOS=windows GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_windows.exe ./app/local/ + cd image && env GOOS=linux GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_linux.bin ./app/local/ + cd image && env GOOS=darwin GOARCH=amd64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_darwin_amd64.bin ./app/local/ + cd image && env GOOS=darwin GOARCH=arm64 go build -ldflags '-s -w -X main.DataverseServer=https://rdr.kuleuven.be -X "main.DataverseServerName=KU Leuven RDR" -X "main.RootDataverseId=rdr"' -v -o kul_darwin_arm64.bin ./app/local/ \ No newline at end of file diff --git a/conf/kul_customizations/assets/html/header.html b/conf/kul_customizations/assets/html/header.html new file mode 100644 index 0000000..57b7825 --- /dev/null +++ b/conf/kul_customizations/assets/html/header.html @@ -0,0 +1,18 @@ + +
+
+ +
+ +
+
+
\ No newline at end of file diff --git a/image/app/frontend/config.go b/image/app/frontend/config.go index e996b18..46b4c7e 100644 --- a/image/app/frontend/config.go +++ b/image/app/frontend/config.go @@ -11,6 +11,7 @@ import ( "integration/app/logging" "net/http" "os" + "strings" ) //go:embed default_frontend_config.json @@ -40,6 +41,9 @@ func GetConfig(w http.ResponseWriter, r *http.Request) { if Config.ExternalURL == "" { Config.ExternalURL = config.GetExternalDestinationURL() logging.Logger.Println(Config.ExternalURL) + if strings.Contains(Config.ExternalURL, "kuleuven") { + Config.CollectionOptionsHidden = true + } } b, err := json.Marshal(Config) if err != nil {