Skip to content

Commit

Permalink
Merge to preprod (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
slavas490 authored May 4, 2024
1 parent 07ea8aa commit c319235
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 37 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ 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"

ifeq ($(coverage),true)
COVERAGE_OPTS=-coverprofile artifacts/[email protected] -coverpkg="$(coverpkg)"
Expand Down Expand Up @@ -197,6 +198,7 @@ test-ui: server ui
$(call startds,$(testdir))
$(call startnodes,$(testdir))
$(call startproxeus,$(testdir))
$(call waitforproxeus,$(testdir))
$(MAKE) -C test/e2e test; ret=$$?; \
$(stopproxeus); \
[ -e $(testdir)/ds-started ] && docker-compose down; \
Expand Down
45 changes: 25 additions & 20 deletions test/e2e/cypress/integration/1_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ describe(`User signup & login at ${url}`, () => {

context('admin signup page', () => {
before(() => {
cy.visit({ url: `${url}/register`, failOnStatusCode: false })
cy.visit({
url: `${url}/register`,
failOnStatusCode: false
})
})

it('should have a mail input', () => {
Expand All @@ -60,14 +63,13 @@ describe(`User signup & login at ${url}`, () => {
cy.wait(2000)
cy.server()
cy.route({
method: 'POST',
url: '/api/register',
onResponse: (xhr) => {
signupResponse = xhr.response.headers['x-test-token'];
console.log(xhr.response);
},
method: 'POST',
url: '/api/register',
onResponse: (xhr) => {
signupResponse = xhr.response.headers['x-test-token'];
console.log(xhr.response);
},
).as('sign-admin')
}, ).as('sign-admin')

cy.get('#inputEmail').type(`${adminEmailAddress}{enter}`)
cy.get('#frontend-app').should('contain', 'Email sent')
Expand All @@ -86,19 +88,21 @@ describe(`User signup & login at ${url}`, () => {

context('user signup page', () => {
before(() => {
cy.visit({ url: `${url}/register`, failOnStatusCode: false })
cy.visit({
url: `${url}/register`,
failOnStatusCode: false
})
})

it('should sign up user', () => {
cy.server()
cy.route({
method: 'POST',
url: '/api/register',
onResponse: (xhr) => {
signupResponse = xhr.response.headers['x-test-token']
},
method: 'POST',
url: '/api/register',
onResponse: (xhr) => {
signupResponse = xhr.response.headers['x-test-token']
},
)
}, )

cy.get('#inputEmail').type(`${emailAddress}{enter}`)
cy.get('#frontend-app').should('contain', 'Email sent')
Expand All @@ -125,6 +129,7 @@ describe(`User signup & login at ${url}`, () => {
body: {
password: password,
},
timeout: 60000
})
})
})
Expand All @@ -138,8 +143,8 @@ describe(`User signup & login at ${url}`, () => {
login(emailAddress, 'wrong-password')

cy.get('.text-danger').
should('contain',
'You have entered an invalid username or password')
should('contain',
'You have entered an invalid username or password')
})

it('should login successfully', () => {
Expand Down Expand Up @@ -177,16 +182,16 @@ describe(`User signup & login at ${url}`, () => {

it('should remove account and logout when clicking again', () => {
cy.get('.btn-danger').click()
cy.url().should('eq', `${url}/login?redirect=%2Fadmin%2Fworkflow`)
cy.url().should('include', `${url}/login`)
})
})
})

})

function login (email, password) {
function login(email, password) {
cy.get('#inputEmail').clear().type(email)
cy.get('#inputPassword').clear().type(password)

cy.get('.btn-primary').eq(0).click()
}
}
2 changes: 1 addition & 1 deletion ui/core/src/views/Templates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
},
data () {
return {
iconFa: 'mdi mdi-file-xml',
iconFa: 'mdi mdi-code-block-tags',
deleteTarget: null,
deleteFunc: () => {},
deleteDialogShowFunc: () => {}
Expand Down
27 changes: 13 additions & 14 deletions ui/core/src/views/Workflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ export default {
item.icon = 'view_quilt'
}
if (item.type === 'template') {
item.iconFa = 'mdi mdi-file-xml'
item.iconFa = 'mdi mdi-code-block-tags'
}
item.error = response.data[key].Error
elements.push(item)
Expand Down Expand Up @@ -1133,7 +1133,7 @@ function condition(){
// enable inertial throwing
inertia: false,
onstart: function (event) {
if (event.interaction.downEvent.button === 2) {
if (event?.interaction?.downEvent?.button === 2) {
return false
}
_.dragActive = true
Expand Down Expand Up @@ -1181,17 +1181,16 @@ function condition(){
_.dragCompPosition.left = (_.bcr.left) - _.dim.ml
},
onmove: function (event, a, b, c, d) {
if (event.interaction.downEvent.button === 2) {
if (event?.interaction?.downEvent?.button === 2) {
return false
}
_.mousePos.y = event.pageY
_.mousePos.x = event.pageX
_.tl.x += event.dx
_.tl.y += event.dy
_.tl.y = _.mousePos.y - _.dragCompPosition.top - _.dim.handleY
_.tl.x = _.mousePos.x - _.dragCompPosition.left - _.dim.handleX
_.$dragComp[0].style.webkitTransform = _.$dragComp[0].style.transform = 'translate(' + _.tl.x + 'px, ' +
_.tl.y + 'px)'
const translatePos = 'translate(' + _.tl.x + 'px, ' + _.tl.y + 'px)'
_.$dragComp[0].style.webkitTransform = translatePos
_.$dragComp[0].setAttribute('style', 'transform: ' + translatePos)
},
onend: function (e, a, b, c, d) {
_.wasInside = false
Expand Down Expand Up @@ -1292,7 +1291,7 @@ function condition(){
user: 'fcn-usr node-icon mdi mdi-account',
form: 'fcn-form node-icon mdi mdi-view-quilt',
workflow: 'fcn-wflow node-icon mdi mdi-source-branch',
template: 'fcn-tmpl node-icon mdi mdi-file-xml'
template: 'fcn-tmpl node-icon mdi mdi-code-block-tags'
},
// d={name:"name", detail:"detail", kind:"condition|user|form|workflow|template"};
_createFinderItem: function (d) {
Expand Down Expand Up @@ -1569,7 +1568,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf48a',
code: '󰒊',
color: '#5353c0'
},
events: {
Expand Down Expand Up @@ -1622,7 +1621,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf48a',
code: '󰒊',
color: '#5150c0'
},
events: {
Expand Down Expand Up @@ -1675,7 +1674,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf339',
code: '󰌹',
color: '#5150c0'
},
events: {
Expand Down Expand Up @@ -1710,7 +1709,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf70B',
code: '󰜌',
color: '#f0a30a'
},
events: {
Expand Down Expand Up @@ -1771,7 +1770,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf62C',
code: '󰘬',
color: '#e40070'
},
events: {
Expand Down Expand Up @@ -1834,7 +1833,7 @@ function condition(){
},
icon: {
face: 'Material Design Icons',
code: '\uf22E',
code: '󱲆',
color: '#ff30ec'
},
events: {
Expand Down
2 changes: 1 addition & 1 deletion ui/core/src/views/appDependentComponents/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li class="nav-item" v-if="app.userIsCreatorOrHigher()">
<router-link :to="{name:'Templates'}" class="nav-link" data-toggle="tooltip" data-placement="right"
data-boundary="window" :title="$t('Menu Templates','Templates')"><span
class="material-icons mdi mdi-file-xml"></span><span
class="material-icons mdi mdi-code-block-tags"></span><span
class="nav-link-title">{{$t('Menu Templates','Templates')}}</span>
</router-link>
</li>
Expand Down
2 changes: 1 addition & 1 deletion ui/core/src/views/appDependentComponents/SidebarUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<router-link :to="{name:'DocumentVerification'}" class="nav-link" data-toggle="tooltip"
data-placement="right"
data-boundary="window" :title="$t('Menu Verification','Verification')"><span
class="material-icons mdi mdi-verified"></span><span
class="material-icons mdi mdi-shield-check"></span><span
class="nav-link-title">{{$t('Menu Verification','Verification')}}</span>
</router-link>
</li>
Expand Down

0 comments on commit c319235

Please sign in to comment.