Skip to content

Commit

Permalink
Merge pull request #97 from builderz-io/hot-fixes
Browse files Browse the repository at this point in the history
Hot fixes
  • Loading branch information
philipeachille authored Nov 26, 2024
2 parents 8b8a26f + 26a01a3 commit f21ac9b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web-interface/app/plugins/builds/vplugins.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web-interface/app/plugins/src/farm/farm.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const Farm = ( function() { // eslint-disable-line no-unused-vars
role: 'Plot',
join: 4,
privacy: 1,
noKeyDwnl: true,
},
draw: function( path ) {
Farm.draw( path );
Expand Down
4 changes: 2 additions & 2 deletions web-interface/app/plugins/src/group/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ const GroupComponents = ( function() {

if ( entity.role !== 'Plot' ) {return ''}

const groupsOfUser = V.aE().holderOf
const groupsOfUser = V.aE() ? V.aE().holderOf
.filter( item => item.c === 'Group' )
.map( item => item.a );
.map( item => item.a ) : [];

const addNewGroupButton = V.cN(
{
Expand Down
15 changes: 15 additions & 0 deletions web-interface/app/plugins/src/marketplace/marketplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ const Marketplace = ( function() { // eslint-disable-line no-unused-vars
}
return res;
} );

if( V.aE() ) {
let heldUuidEs = V.aE().holderOf.map( item => item.a );

heldUuidEs = heldUuidEs.length > 15 ? heldUuidEs.slice( 0, 15 ) : heldUuidEs;

for ( let i = 0; i < heldUuidEs.length; i++ ) {
await V.getEntity( heldUuidEs[i] ).then( res => {
if ( res.success ) {
V.setCache( 'highlights', res.data );
}
return res;
} );
}
}
}

if ( query.success ) {
Expand Down
2 changes: 1 addition & 1 deletion web-interface/app/theme/builds/vtheme.min.js

Large diffs are not rendered by default.

33 changes: 28 additions & 5 deletions web-interface/app/theme/src/join/routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const JoinRoutine = ( function() { // eslint-disable-line no-unused-vars

let entityData = {};

let cardSet, cardIndex = 0, fourDigitString, keyFileText;
let cardSet, cardIndex = 0, fourDigitString, keyFileText, noKeyDwnl;

/* ============== user interface strings ============== */

Expand Down Expand Up @@ -242,12 +242,27 @@ const JoinRoutine = ( function() { // eslint-disable-line no-unused-vars
V.gN( '.join-download__btn' ).innerText = V.getString( ui.downloadAgain );
V.gN( '.join-submit__btn' ).classList.remove( 'hidden' );
V.gN( '.join-submit__btn' ).addEventListener( 'click', reloadOnCallToActionBtn.bind( { fullId: this.fullId } ) );
rearrangeButtons();
}

function reloadOnCallToActionBtn() {
// location = window.location.origin + V.castPathOrId( this.fullId );
}

function rearrangeButtons() {
// Select the elements
const joinDownload = document.querySelector( '.join-download' );
const joinSubmitWrapper = document.querySelector( '.join-submit-wrapper' );

if ( joinDownload && joinSubmitWrapper ) {
// Move the join-submit-wrapper to the position of join-download
joinDownload.parentNode.insertBefore( joinSubmitWrapper, joinDownload );

// Remove the join-download button
joinDownload.remove();
}
}

/* ================== private methods ================= */

function advanceCard() {
Expand All @@ -268,7 +283,7 @@ const JoinRoutine = ( function() { // eslint-disable-line no-unused-vars
/* name */
if ( cardIndex == 0 ) {
const input = V.getNode( '.join-form__input' ).value;
const title = V.castEntityTitle( input, 'Person' ); // validation of the title
const title = V.castEntityTitle( input, entityData.role ); // validation of the title

if ( title.success ) {
entityData.title = title.data[0];
Expand Down Expand Up @@ -586,15 +601,21 @@ Initialized by: ${ window.location.host }

document.dispatchEvent(
new CustomEvent( 'ENTITY_CREATED', {
detail: { entity: E }
} )
detail: { entity: E },
} ),
);

if ( E.role != 'Person' ) {
V.setState( 'tmpEditable', [ E.fullId ] );
drawSuccess();
notifySuccess( E.fullId, E.role );
setDownloadKeyBtn();
if ( noKeyDwnl ) {
setTimeout( delayCallToActionBtn.bind( { fullId: E.fullId } ), 1200 );
V.setNode( '.join-header__bottom', 'clear' );
}
else {
setDownloadKeyBtn();
}
return;
}

Expand Down Expand Up @@ -714,6 +735,8 @@ Initialized by: ${ window.location.host }
cardSet = 'set' + ( use.join || settings.defaultSet );
cardIndex = 0;

noKeyDwnl = use.noKeyDwnl;

entityData.role = use.role;
entityData.privacy = ( use.privacy == 0 ? undefined : use.privacy )
|| ( settings.defaultPrivacy == 0 ? undefined : settings.defaultPrivacy );
Expand Down

0 comments on commit f21ac9b

Please sign in to comment.