Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formbuilder drag&drop #610

Merged
merged 66 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9bfb0ac
Merge pull request #12 from ProxeusApp/preprod
tafonina Jun 9, 2023
9d3d6a2
fix web3.fromAscii to web3.utils.asciiToHex method in document floe
Jun 13, 2023
029ab3e
Merge pull request #14 from sprotest/feature/fix-web3-method-fromAscii
tafonina Jun 13, 2023
028563a
replace web3 to this.wallet.proxeusFS.web3 as metamask no longer inje…
Jun 13, 2023
b069463
Merge pull request #15 from sprotest/feature/fix-web3-method-fromAscii
tafonina Jun 13, 2023
a5e9d02
Merge pull request #16 from ProxeusApp/preprod
tafonina Oct 19, 2023
26ef319
remove outdated methods of old smart contract
slavas490 Oct 24, 2023
6b2c7fc
add public urls in case user doesnt have metamask
Oct 24, 2023
7bff03b
Merge pull request #18 from sprotest/feature/remove-old-smartcontract…
slavas490 Oct 24, 2023
614e5a9
Merge branch 'develop' into feature/verify-doc
tafonina Oct 27, 2023
3710bb3
Merge pull request #19 from sprotest/feature/verify-doc
tafonina Oct 27, 2023
18b6f1c
fix js frontend typos
slavas490 Nov 1, 2023
29e1324
use public url only if user doesnt have metamask installed
Nov 2, 2023
be08fea
Merge branch 'feature/verify-doc' of github.com:sprotest/proxeus-core…
Nov 2, 2023
e164676
use public url only if user doesnt have metamask installed
Nov 2, 2023
d700aa2
Merge branch 'develop' into feature/verify-doc
tafonina Nov 2, 2023
88dd2fd
Merge pull request #20 from sprotest/feature/verify-doc
tafonina Nov 2, 2023
f3ecefe
add wrong metamask network selected issue handler
slavas490 Nov 2, 2023
4a98f86
fix user validation network screen
slavas490 Nov 2, 2023
1d8af13
remove unnecessary html code from VerificationFileEntry component
slavas490 Nov 2, 2023
e11d139
fix invalid character, updates in BN lib
Nov 3, 2023
b8056f0
fix invalid character, updates in BN lib
Nov 3, 2023
e1ac271
fix invalid character, updates in BN lib, revert to string and number…
Nov 3, 2023
11f7378
Merge pull request #21 from sprotest/feature/fix-invalid-charachter
tafonina Nov 3, 2023
458c0c1
remove delete buttons for form inputs
slavas490 Nov 13, 2023
cc08ea4
remove skipValidateFor date entry
slavas490 Nov 14, 2023
6065564
Merge pull request #22 from sprotest/feature/delete_property
slavas490 Nov 14, 2023
0a4489f
fix frontend error message for file not found
slavas490 Nov 16, 2023
968c255
Merge pull request #23 from sprotest/fix/file-validation
tafonina Nov 17, 2023
a2db174
update digitalocean deployment script
slavas490 Nov 22, 2023
c8fec16
Merge pull request #24 from sprotest/feature/droplet-support
tafonina Nov 23, 2023
4fafb6f
Merge branch 'preprod' into develop
tafonina Nov 30, 2023
ad9ed28
fix document name max length at 80 symbols
slavas490 Dec 7, 2023
e8dcae7
fix signup with metamask
slavas490 Dec 11, 2023
54631b7
fix restore-demo.sh file
slavas490 Dec 11, 2023
f9dac47
WIP: initial commit
slavas490 Jan 16, 2024
c2744dd
update baseApp.js
slavas490 Jan 17, 2024
9e8a9e1
Merge pull request #25 from sprotest/feature/dynamic-config
slavas490 Jan 17, 2024
45aac19
Revert "fix restore-demo.sh file"
slavas490 Jan 31, 2024
d36bc1b
revert dynamic-config
slavas490 Jan 31, 2024
02e2562
fix e2e test cases
slavas490 Jan 31, 2024
b7eaeca
remove waitforproxeus Makefile commang
slavas490 Feb 2, 2024
d23f44b
Merge pull request #26 from sprotest/fix/e2e
slavas490 Feb 2, 2024
763c2ae
update i18n link to handbook
slavas490 Feb 26, 2024
14dc9d2
add redirect for bookmarked links
slavas490 Feb 26, 2024
08e7325
fix redirect for bookmarked links
slavas490 Feb 26, 2024
9da3df6
fix redirect for bookmarked links
slavas490 Feb 26, 2024
5893ef1
add code formatting
slavas490 Mar 7, 2024
f9bc230
add placeholder node
slavas490 Mar 19, 2024
eff6928
change placeholder node color
slavas490 Mar 29, 2024
12d61f0
Merge pull request #28 from sprotest/feature/placeholder-node
slavas490 Mar 29, 2024
99d20ad
Merge branch 'preprod' into develop
loleg Apr 4, 2024
2a8c7ff
fix document issuing flow handler
slavas490 Apr 18, 2024
11c3933
add auto select default values
slavas490 Apr 18, 2024
afc15b0
fix code formatting
slavas490 Apr 24, 2024
318a189
fix e2e tests
slavas490 Apr 29, 2024
7640bd9
add missing icons
slavas490 Apr 29, 2024
0796772
add missing icons
slavas490 Apr 29, 2024
3a53ed6
Merge branch 'preprod' into develop
slavas490 May 3, 2024
527f36b
fix Makefirle waitforproxeus command
slavas490 May 21, 2024
83229ac
fix Makefirle waitforproxeus command
slavas490 May 21, 2024
f078022
add custom css style configuration
slavas490 May 30, 2024
4adaec6
Merge branch 'preprod' into develop
slavas490 Jun 7, 2024
6862593
fix code formatting
slavas490 Jun 7, 2024
abf6630
move appearance-css link out from head section
slavas490 Jun 7, 2024
b42c869
fix formbuilder selector
slavas490 Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ comma:=,
space:= $() $()
coverpkg=$(subst $(space),$(comma), $(filter-out %/mock %/assets, $(shell go list ./main/... ./sys/... ./storage/... ./service/...)))

startproxeus=PROXEUS_DATA_DIR=$(1)/data PROXEUS_SETTINGS_FILE=$(1)/settings/main.json PROXEUS_TEST_MODE=true artifacts/proxeus &
startproxeus=PROXEUS_DATA_DIR=$(1)/data PROXEUS_SETTINGS_FILE=$(1)/settings/main.json PROXEUS_TEST_MODE=true artifacts/proxeus -ServiceAddress 0.0.0.0:1323 &
stopproxeus=pkill proxeus
startds=curl -s http://localhost:2115 > /dev/null || ( PROXEUS_DATA_DIR=$(1) docker-compose up -d document-service && touch $(1)/ds-started )
startnodes=curl -s http://localhost:8011 > /dev/null || (PROXEUS_PLATFORM_DOMAIN=http://$(DOCKER_GATEWAY):1323 NODE_CRYPTO_RATES_URL=http://localhost:8011 REGISTER_RETRY_INTERVAL=1 docker-compose -f docker-compose.yml -f docker-compose-extra.override.yml up -d node-crypto-forex-rates && touch $(1)/nodes-started )
startmongo=nc -z localhost 27017 2> /dev/null || (docker run -d -p 27017:27017 -p 27018:27018 -p 27019:27019 proxeus/mongo-dev-cluster && sleep 10 && touch $(1)/mongo-started)
waitforproxeus=echo "Waiting for Proxeus to start" ; curl --head -X GET --retry 120 --retry-connrefused --retry-delay 1 --silent -o /dev/null http://localhost:1323 && echo "Proxeus started" || echo "Unable to start Proxeus"
waitforproxeus=echo "Waiting for Proxeus to start" ; curl --head -X GET --retry 120 --retry-connrefused --retry-delay 1 --silent -o /dev/null http://0.0.0.0:1323 && echo "Proxeus started" || echo "Unable to start Proxeus"

ifeq ($(coverage),true)
COVERAGE_OPTS=-coverprofile artifacts/[email protected] -coverpkg="$(coverpkg)"
Expand Down
18 changes: 18 additions & 0 deletions main/handlers/api/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,24 @@ func LoginHandler(e echo.Context) (err error) {
})
}

// Returns custom css style if exists
//
// @returns
//
// 200 => string
// 500 => Server error
func GetCustomAppearanceStyle(e echo.Context) error {
c := e.(*www.Context)

settings := c.System().GetSettings()
if len(settings.PlatformDomain) == 0 {
settings.PlatformDomain = e.Request().Host
}

c.Response().Header().Set(echo.HeaderContentType, "text/css")
return c.String(http.StatusOK, settings.CustomStyleCSS)
}

// Validates user session cookie
func ValidateUserSession(e echo.Context) (err error) {
c := e.(*www.Context)
Expand Down
1 change: 1 addition & 0 deletions main/handlers/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func MainHostedAPI(e *echo.Echo, s *www.Security, version string) {
routesNoCache := []r{
// config
{GET, PUBLIC, "/api/config", api.ConfigHandler(version)},
{GET, PUBLIC, "/api/appearance-css", api.GetCustomAppearanceStyle},

// authentication
{GET, PUBLIC, "/api/session/validate", api.ValidateUserSession},
Expand Down
1 change: 1 addition & 0 deletions sys/model/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Settings struct {
DefaultRole string `json:"defaultRole" default:"creator" usage:"Default role that is going to be used for new registrations. Value is case insensitive."`
SessionExpiry string `json:"sessionExpiry" validate:"required=true" default:"1h" usage:"Session expiry like 1h as one hour, 1m as one minute or 1s as one second."`
CacheExpiry string `json:"cacheExpiry" validate:"required=true" default:"24h" usage:"Common cache expiry which will be used for email tokens or similar."`
CustomStyleCSS string `json:"customStyleCSS" default:"" usage:"Set custom css styles"`
BlockchainNet string `json:"blockchainNet" validate:"required=true" default:"sepolia" usage:"Ethereum blockchain net like mainnet or goerli, sepolia, polygon, polygon-mumbai."`
InfuraApiKey string `json:"infuraApiKey" validate:"required=true" usage:"API Key to access Infura node."`
BlockchainContractAddress string `json:"blockchainContractAddress" validate:"required=true" default:"" usage:"Ethereum contract address which will be used to register files and verify them."`
Expand Down
39 changes: 22 additions & 17 deletions ui/core/public/app.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>
<body>
<noscript>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>

<body>
<noscript>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<link href="/api/appearance-css" rel=stylesheet id="customstylelink">
</body>

</html>
39 changes: 22 additions & 17 deletions ui/core/public/frontend.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>
<body>
<noscript>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="frontend-app"></div>
<!-- built files will be auto injected -->
</body>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>

<body>
<noscript>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="frontend-app"></div>
<!-- built files will be auto injected -->
<link href="/api/appearance-css" rel=stylesheet id="customstylelink">
</body>

</html>
37 changes: 21 additions & 16 deletions ui/core/public/user.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>
<body>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700" rel=stylesheet>
<link href=https://use.fontawesome.com/releases/v5.0.8/css/all.css rel=stylesheet>
<link rel="icon" href="/static/favicon.ico">
<title>proxeus</title>
</head>

<body>
<noscript>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="document-app"></div>
<!-- built files will be auto injected -->
</body>
<strong>We're sorry but proxeus doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="document-app"></div>
<!-- built files will be auto injected -->
<link href="/api/appearance-css" rel=stylesheet id="customstylelink">
</body>

</html>
4 changes: 4 additions & 0 deletions ui/core/src/components/nav-tabs/NavTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default {
selectTab (selectedTab) {
this.tabs.forEach(tab => {
tab.isActive = (tab.title === selectedTab.title)

if (tab.isActive && tab.onSelect) {
tab.onSelect(tab)
}
})
}
}
Expand Down
7 changes: 5 additions & 2 deletions ui/core/src/components/nav-tabs/Tab.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="mod-tab" v-if="this.isActive">
<div class="mod-tab" v-show="this.isActive">
<slot></slot>
</div>
</template>
Expand All @@ -9,13 +9,16 @@ export default {
name: 'tab',
props: {
title: { required: true },
selected: { default: false }
selected: { default: false },
onSelect: { type: Function }
},
computed: {
href () {
return '#' + this.name.toLowerCase().replace(/ /g, '-')
}
},
updated () {
},
data () {
return {
isActive: false
Expand Down
4 changes: 2 additions & 2 deletions ui/core/src/libs/legacy/formbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ var FT_Workspace = function (fb, jqEl, comps) {
inertia: false,
autoScroll: autoScroll,
onstart: function (e) {
if (e.interaction.downEvent.button === 2) {
if (e.button === 2) {
return false
}

Expand Down Expand Up @@ -807,7 +807,7 @@ var FT_Workspace = function (fb, jqEl, comps) {
return true
},
onmove: function (e, a, b, c, d) {
if (e.interaction.downEvent.button === 2) {
if (e.button === 2) {
return false
}
_.mousePos.y = e.clientY
Expand Down
38 changes: 38 additions & 0 deletions ui/core/src/views/appDependentComponents/SettingsInner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
<span class="text-muted">{{$t('Sparkpost API Key explanation','Set the Sparkpost API key which will be used to send out emails.')}}</span>
</animated-input>
</tab>
<tab title="Appearance customization" :onSelect="onSelectAppearenceTab">
<div id="customStyle_cssCode"></div>
</tab>
</nav-tabs>
</div>
<div v-else>
Expand Down Expand Up @@ -234,6 +237,39 @@ export default {
redirectToHome () {
window.location.href = '/'
},
onSelectAppearenceTab () {
if (this.customStyleEditor) {
return
}

const customStyleEditorElement = document.getElementById('customStyle_cssCode')
const customStyleEditor = ace.edit(customStyleEditorElement)

customStyleEditor.session.setMode('ace/mode/css')
customStyleEditor.setOptions({
minLines: 50,
maxLines: 100,
enableLiveAutocompletion: true
})

if (this.settings?.customStyleCSS) {
customStyleEditor.getSession().setValue(this.settings.customStyleCSS)
}

customStyleEditor.getSession().on('change', () => {
const cssCode = customStyleEditor.getSession().getValue()

if (this.settings) {
this.settings.customStyleCSS = cssCode
}
})

this.customStyleEditor = customStyleEditor
},
reloadCustomStyle () {
const linkElement = document.getElementById('customstylelink')
linkElement.setAttribute('href', `/api/appearance-css?t=${Date.now()}`)
},
newFormReady () {
return this.app.roles && this.app.roles.length > 0 && this.settings !== null
},
Expand All @@ -242,6 +278,8 @@ export default {
},
powerUp () {
axios.post('/api/init', { settings: this.settings, user: this.user }).then(res => {
this.reloadCustomStyle()

this.cleanErr()
this.user = res.data
this.$notify({
Expand Down