From eb6212941a11392858aa28d16d74ddbceb29800a Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Mon, 11 Dec 2023 14:05:59 +0000 Subject: [PATCH] fix for fblo drag handle bug (#14993) * better wording for different dev versions * drag handle now shown on external mods that can be moved --- src/app/Application.ts | 2 +- src/extensions/about_dialog/views/AboutPage.tsx | 12 +++++++----- .../file_based_loadorder/views/ItemRenderer.tsx | 9 +++++---- .../mod_load_order/views/DefaultItemRenderer.tsx | 4 ++++ src/stylesheets/vortex/page-mod-load-order.scss | 13 +++++++------ src/util/StyleManager.ts | 2 +- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/app/Application.ts b/src/app/Application.ts index 38d87b700..bd3979cab 100644 --- a/src/app/Application.ts +++ b/src/app/Application.ts @@ -565,7 +565,7 @@ class Application { const state: IState = this.mStore.getState(); const lastVersion = state.app.appVersion || '0.0.0'; - if (this.mFirstStart || (currentVersion === '0.0.1')) { + if (this.mFirstStart || (process.env.NODE_ENV === 'development')) { // don't check version change in development builds or on first start return Promise.resolve(); } diff --git a/src/extensions/about_dialog/views/AboutPage.tsx b/src/extensions/about_dialog/views/AboutPage.tsx index 1f55e85c2..e4ee9764c 100644 --- a/src/extensions/about_dialog/views/AboutPage.tsx +++ b/src/extensions/about_dialog/views/AboutPage.tsx @@ -66,11 +66,11 @@ class AboutPage extends ComponentEx { public componentDidMount() { this.mMounted = true; - //this.mVersion = '1.8.5'; // force this to test - - if (this.mVersion === '0.0.1') { - this.nextState.tag = 'Development'; + // removing version check when in dev mode and moved to NODE_ENV instead + if (process.env.NODE_ENV === 'development') { + this.nextState.tag = 'Dev'; } else { + // if not development, lets see what is on github to determine if we are stable, beta or preview github.releases() .then(releases => { if (this.mMounted) { @@ -82,7 +82,9 @@ class AboutPage extends ComponentEx { this.nextState.changelog = thisRelease.body; this.nextState.tag = thisRelease.prerelease ? 'Beta' : undefined; } else { - this.nextState.tag = 'Unknown'; + // no release found on github, so it's packaged but not distributed properly yet + // this could be on the mystery Next repo for testing + this.nextState.tag = 'Preview'; } } catch (err) { log('warn', 'Failed to parse release info', err.message); diff --git a/src/extensions/file_based_loadorder/views/ItemRenderer.tsx b/src/extensions/file_based_loadorder/views/ItemRenderer.tsx index 9c892e1f6..5b1fd7057 100644 --- a/src/extensions/file_based_loadorder/views/ItemRenderer.tsx +++ b/src/extensions/file_based_loadorder/views/ItemRenderer.tsx @@ -94,18 +94,19 @@ class ItemRenderer extends ComponentEx { ) : null; + const dragHandleClasses = this.isLocked(item) + ? 'drag-handle-icon undraggable' : 'drag-handle-icon'; + return ( - +

{position}

{this.renderValidationError()} - -

{key}

- +

{key}

{this.renderExternalBanner(item)} {checkBox()} {lock()} diff --git a/src/extensions/mod_load_order/views/DefaultItemRenderer.tsx b/src/extensions/mod_load_order/views/DefaultItemRenderer.tsx index 95c061497..a2dc8783b 100644 --- a/src/extensions/mod_load_order/views/DefaultItemRenderer.tsx +++ b/src/extensions/mod_load_order/views/DefaultItemRenderer.tsx @@ -128,6 +128,9 @@ class DefaultItemRenderer extends ComponentEx { ) : null; + const dragHandleClasses = item.locked + ? 'drag-handle-icon undraggable' : 'drag-handle-icon'; + return ( { className={classes.join(' ')} onContextMenu={this.props.onContextMenu} > +

{position}

{(!!item?.external) && this.renderExternalBanner()} diff --git a/src/stylesheets/vortex/page-mod-load-order.scss b/src/stylesheets/vortex/page-mod-load-order.scss index 8c39ff8d7..6c5436a42 100644 --- a/src/stylesheets/vortex/page-mod-load-order.scss +++ b/src/stylesheets/vortex/page-mod-load-order.scss @@ -77,7 +77,7 @@ .entry-checkbox { //margin-right: 15px; //margin-left: auto; - + // This shouldn't be necessary. But hey ho lets go. &.disabled { display: none; @@ -106,12 +106,13 @@ background-color: $brand-primary; } - &.external { - - .drag-handle-icon { - visibility: hidden; - } + .drag-handle-icon.undraggable { + visibility: hidden; + //fill: red; + } + &.external { + .load-order-unmanaged-banner { text-align: center; diff --git a/src/util/StyleManager.ts b/src/util/StyleManager.ts index 1df53329d..37396ca2f 100644 --- a/src/util/StyleManager.ts +++ b/src/util/StyleManager.ts @@ -82,7 +82,7 @@ if (ipcMain !== undefined) { sassIndex = `$theme-path: "${pathToFileURL(themePath)}";\n` + sassIndex; // development builds are always versioned as 0.0.1 - const isDevel: boolean = getApplication().version === '0.0.1'; + const isDevel: boolean = (process.env.NODE_ENV === 'development') const assetsPath = path.join(getVortexPath('assets_unpacked'), 'css'); const modulesPath = getVortexPath('modules_unpacked');