Skip to content

Commit

Permalink
Merge pull request #216 from alan-wu/pre-1.1.-bug-fixes
Browse files Browse the repository at this point in the history
Pre 1.1.0 bug fixes
  • Loading branch information
alan-wu authored May 29, 2024
2 parents 05b75d6 + 00e5c89 commit 394206b
Show file tree
Hide file tree
Showing 8 changed files with 460 additions and 391 deletions.
761 changes: 406 additions & 355 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion cypress/component/MapContent.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ describe('MapContent', () => {
return false
if (err.message.includes('Source "mapbox-gl-draw-cold" already exists.'))
return false
if (err.message.includes('Source "markers" already exists.'))
return false
if (err.message.includes("Cannot read properties of undefined (reading 'onResize')"))
return false
return true
})

Expand Down Expand Up @@ -139,7 +143,7 @@ describe('MapContent', () => {
cy.wait('@mouseDataset', {timeout: 20000});

//Open the sidebar
cy.get('.open-tab').should('exist').click();
cy.get('.side-bar > .open-tab').should('exist').click();

//Type in 76 generic
cy.get('.search-input > .el-input__wrapper > .el-input__inner').should('exist').type('76 generic');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abi-software/mapintegratedvuer",
"version": "1.0.4",
"version": "1.0.5-beta.1",
"license": "Apache-2.0",
"scripts": {
"serve": "vite --host --force",
Expand Down
1 change: 0 additions & 1 deletion src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ declare module 'vue' {
ElIcon: typeof import('element-plus/es')['ElIcon']
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
ElIconInfoFilled: typeof import('@element-plus/icons-vue')['InfoFilled']
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
Expand Down
4 changes: 3 additions & 1 deletion src/components/MapContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import SplitFlow from './SplitFlow.vue';
import EventBus from './EventBus';
import { mapStores } from 'pinia';
import { useSettingsStore } from '../stores/settings';
import { useSplitFlowStore } from '../stores/splitFlow';
import { findSpeciesKey } from './scripts/utilities.js';
import { MapSvgSpriteColor} from '@abi-software/svg-sprite';
import { initialState } from "./scripts/utilities.js";
Expand Down Expand Up @@ -273,7 +274,7 @@ export default {
},
},
computed: {
...mapStores(useSettingsStore),
...mapStores(useSettingsStore, useSplitFlowStore),
stateToSet() {
return this.state ? this.state : this.initialState;
},
Expand All @@ -298,6 +299,7 @@ export default {
this.options.nlLinkPrefix ? this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix) : null
this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
}
this.splitFlowStore?.reset();
},
mounted: async function() {
EventBus.on("updateShareLinkRequested", () => {
Expand Down
1 change: 1 addition & 0 deletions src/mixins/ContentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function capitalise(text) {

/* eslint-disable no-alert, no-console */
export default {
emits: [ "flatmap-provenance-ready", "resource-selected", "species-changed"],
props: {
/**
* Object containing information for
Expand Down
72 changes: 42 additions & 30 deletions src/stores/splitFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,38 +127,42 @@ const findKeyWithId = (layout, id) => {
return Object.keys(layout).find(key => layout[key]["id"] === id);
}

const getOriginalState = () => {
return {
activeView: "singlepanel",
viewIcons: [
{ icon: "singlepanel", name: "Single view", min: 1 },
{ icon: "2horpanel", name: "Horizontal split", min: 2 },
{ icon: "2vertpanel", name: "Vertical split", min: 2 },
{ icon: "3panel", name: "Three panes", min: 3 },
{ icon: "4panel", name: "Four panes", min: 4 },
{ icon: "5panel", name: "Five panes", min: 5 },
{ icon: "6panel", name: "Six (horizontal)", min: 6 },
{ icon: "6panelVertical", name: "Six (vertical)", min: 6 },
//{ icon: "customise", name: "Customise", min: 2 }
],
customLayout: {
"split-1": {content: false, horizontal: false, children: ["pane-1"]},
"pane-1": {content: true, id: 1},
/*
Example layout
"split-1": {content: false, horizontal: true, children: ["split-2", "pane-1"]},
"split-2": {content: false, horizontal: false, children: ["pane-2", "pane-3"]},
"pane-1": {content: true, id: 1},
"pane-2": {content: true, id: 2},
"pane-3": {content: true, id: 3},
*/
},
splitters: { "first": 50, "second": 50, "third": 50 },
globalCallback: false,
syncMode: false,
};
}

export const useSplitFlowStore = defineStore('splitFlow', {
state: () => {
return {
activeView: "singlepanel",
viewIcons: [
{ icon: "singlepanel", name: "Single view", min: 1 },
{ icon: "2horpanel", name: "Horizontal split", min: 2 },
{ icon: "2vertpanel", name: "Vertical split", min: 2 },
{ icon: "3panel", name: "Three panes", min: 3 },
{ icon: "4panel", name: "Four panes", min: 4 },
{ icon: "5panel", name: "Five panes", min: 5 },
{ icon: "6panel", name: "Six (horizontal)", min: 6 },
{ icon: "6panelVertical", name: "Six (vertical)", min: 6 },
//{ icon: "customise", name: "Customise", min: 2 }
],
customLayout: {
"split-1": {content: false, horizontal: false, children: ["pane-1"]},
"pane-1": {content: true, id: 1},
/*
Example layout
"split-1": {content: false, horizontal: true, children: ["split-2", "pane-1"]},
"split-2": {content: false, horizontal: false, children: ["pane-2", "pane-3"]},
"pane-1": {content: true, id: 1},
"pane-2": {content: true, id: 2},
"pane-3": {content: true, id: 3},
*/
},
splitters: { "first": 50, "second": 50, "third": 50 },
globalCallback: false,
syncMode: false,
}
return getOriginalState();
},
getters: {
getPaneNameById: (state) => (id) => {
Expand Down Expand Up @@ -318,6 +322,14 @@ export const useSplitFlowStore = defineStore('splitFlow', {
}
}
},
reset() {
const original = getOriginalState();
this.activeView = original.activeView;
this.customLayout = original.customLayout;
this.splitters = original.splitters;
this.globalCallback = original.globalCallback;
this.syncMode = original.syncMode;
},
closeSlot(payload) {
if (payload) {
this.syncMode = false;
Expand Down

0 comments on commit 394206b

Please sign in to comment.