Skip to content

Commit

Permalink
fix: solve merge conflicts manually prior to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed May 11, 2023
1 parent c18fb7b commit 4309331
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 88 deletions.
78 changes: 39 additions & 39 deletions src/components/attributeTable/AttributeTableWin.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<wgu-module-card v-bind="$attrs"
<wgu-module-card
v-bind="$attrs"
:moduleName="moduleName"
class="wgu-attributetable-win"
:icon="icon"
>

<template v-slot:wgu-win-toolbar>
<v-select
v-model="selLayer"
Expand All @@ -15,7 +15,7 @@
outlined
class="wgu-vector-layer-select wgu-solo-field"
:items="displayedLayers"
:item-text="item => item.get('name')"
:item-text="(item) => item.get('name')"
:menu-props="{
bottom: true,
'offset-y': true,
Expand All @@ -24,7 +24,7 @@
return-object
hide-details
:label="$t('wgu-attributetable.selectorLabel')"
></v-select>
></v-select>
</template>

<wgu-attributetable
Expand All @@ -37,74 +37,74 @@
</template>

<script>
import ModuleCard from './../modulecore/ModuleCard';
import { Mapable } from '../../mixins/Mapable';
import { ColorTheme } from '../../mixins/ColorTheme';
import VectorLayer from 'ol/layer/Vector'
import AttributeTable from './AttributeTable';
import ModuleCard from "./../modulecore/ModuleCard";
import { Mapable } from "../../mixins/Mapable";
import { ColorTheme } from "../../mixins/ColorTheme";
import VectorLayer from "ol/layer/Vector";
import AttributeTable from "./AttributeTable";
export default {
name: 'wgu-attributetable-win',
name: "wgu-attributetable-win",
inheritAttrs: false,
props: {
icon: { type: String, required: false, default: 'table_chart' },
syncTableMapSelection: { type: Boolean, required: false, default: false }
icon: { type: String, required: false, default: "table_chart" },
syncTableMapSelection: { type: Boolean, required: false, default: false },
},
data () {
data() {
return {
moduleName: 'wgu-attributetable',
moduleName: "wgu-attributetable",
layers: [],
selLayer: null
}
selLayer: null,
};
},
mixins: [Mapable, ColorTheme],
components: {
'wgu-module-card': ModuleCard,
'wgu-attributetable': AttributeTable
"wgu-module-card": ModuleCard,
"wgu-attributetable": AttributeTable,
},
methods: {
/**
* This function is executed, after the map is bound (see mixins/Mapable).
* Bind to the layers from the OpenLayers map.
*/
onMapBound () {
onMapBound() {
this.layers = this.map.getLayers().getArray();
}
},
},
computed: {
/**
* Reactive property to return the OpenLayers vector layers to be shown in the selection menu.
*/
displayedLayers () {
displayedLayers() {
return this.layers
.filter(layer =>
layer instanceof VectorLayer &&
layer.get('lid') !== 'wgu-measure-layer' &&
layer.get('lid') !== 'wgu-geolocator-layer'
.filter(
(layer) =>
layer instanceof VectorLayer &&
layer.get("lid") !== "wgu-measure-layer" &&
layer.get("lid") !== "wgu-geolocator-layer"
)
.reverse();
}
}
},
},
};
</script>

<style scoped>
/* TODO
/* TODO
Generalize the positioning concept for windows,
this interferes with positioning and draggable settings in the app.conf */
.wgu-attributetable-win.wgu-floating {
top: inherit !important;
position: relative;
bottom: 35px;
}
.wgu-attributetable-win.wgu-floating {
top: inherit !important;
position: relative;
bottom: 35px;
}
@media only screen and (max-width: 600px) {
.wgu-attributetable-win.wgu-floating {
bottom: 33px;
height: 100%;
}
@media only screen and (max-width: 600px) {
.wgu-attributetable-win.wgu-floating {
bottom: 33px;
height: 100%;
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Vue from 'vue';
import AttributeTableWin from '@/components/attributeTable/AttributeTableWin'
import { expect } from 'chai';
import { shallowMount } from '@vue/test-utils';
import Vue from "vue";
import AttributeTableWin from "@/components/attributeTable/AttributeTableWin";
import { expect } from "chai";
import { shallowMount } from "@vue/test-utils";

const appConfig = { modules: { 'wgu-attributetable': {} } };
const appConfig = { modules: { "wgu-attributetable": {} } };

describe('attributeTable/AttributeTableWin.vue', () => {
it('is defined', () => {
expect(typeof AttributeTableWin).to.not.equal('undefined');
describe("attributeTable/AttributeTableWin.vue", () => {
it("is defined", () => {
expect(typeof AttributeTableWin).to.not.equal("undefined");
});

describe('props', () => {
describe("props", () => {
let comp;
beforeEach(() => {
Vue.prototype.$appConfig = appConfig;
comp = shallowMount(AttributeTableWin);
});

it('has correct default props', () => {
expect(comp.vm.icon).to.equal('table_chart');
it("has correct default props", () => {
expect(comp.vm.icon).to.equal("table_chart");
});

afterEach(() => {
Expand All @@ -29,17 +29,17 @@ describe('attributeTable/AttributeTableWin.vue', () => {

// Evaluate the results of functions in
// the raw component options
it('sets the correct default data', () => {
expect(AttributeTableWin.data).to.be.a('function');
it("sets the correct default data", () => {
expect(AttributeTableWin.data).to.be.a("function");
const defaultData = AttributeTableWin.data();
expect(defaultData).to.be.an('object');
expect(defaultData).to.be.an("object");

expect(defaultData.layers).to.be.an('array');
expect(defaultData.layers).to.be.an("array");
expect(defaultData.layers.length).to.eql(0);
expect(defaultData.selLayer).to.be.null;
});

describe('methods', () => {
describe("methods", () => {
let comp;
let vm;
beforeEach(() => {
Expand All @@ -48,8 +48,8 @@ describe('attributeTable/AttributeTableWin.vue', () => {
vm = comp.vm;
});

it('are implemented', () => {
expect(vm.onMapBound).to.be.a('function');
it("are implemented", () => {
expect(vm.onMapBound).to.be.a("function");
});
});
});
62 changes: 31 additions & 31 deletions tests/unit/specs/components/modulecore/ModuleCard.spec.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
import ModuleCard from '@/components/modulecore/ModuleCard'
import { shallowMount } from '@vue/test-utils';
import ModuleCard from "@/components/modulecore/ModuleCard";
import { shallowMount } from "@vue/test-utils";

const moduleProps = {
moduleName: 'my-module',
icon: 'my-icon',
win: 'floating'
}
moduleName: "my-module",
icon: "my-icon",
win: "floating",
};

describe('modulecore/ModuleCard.vue', () => {
it('is defined', () => {
expect(ModuleCard).to.not.be.an('undefined');
describe("modulecore/ModuleCard.vue", () => {
it("is defined", () => {
expect(ModuleCard).to.not.be.an("undefined");
});

it('has a created hook', () => {
expect(ModuleCard.created).to.be.a('function');
it("has a created hook", () => {
expect(ModuleCard.created).to.be.a("function");
});

describe('props', () => {
describe("props", () => {
let comp;
beforeEach(() => {
comp = shallowMount(ModuleCard, {
propsData: moduleProps
propsData: moduleProps,
});
});

it('has correct default props', () => {
it("has correct default props", () => {
expect(comp.vm.minimizable).to.equal(false);
expect(comp.vm.closable).to.equal(true);
expect(comp.vm.backgroundImage).to.be.undefined;
expect(comp.vm.draggable).to.equal(true);
expect(comp.vm.visible).to.equal(false);
expect(comp.vm.initPos).to.be.an('undefined');
expect(comp.vm.height).to.be.an('undefined');
expect(comp.vm.width).to.be.an('undefined');
expect(comp.vm.maxHeight).to.be.an('undefined');
expect(comp.vm.maxWidth).to.be.an('undefined');
expect(comp.vm.minHeight).to.be.an('undefined');
expect(comp.vm.minWidth).to.be.an('undefined');
expect(comp.vm.initPos).to.be.an("undefined");
expect(comp.vm.height).to.be.an("undefined");
expect(comp.vm.width).to.be.an("undefined");
expect(comp.vm.maxHeight).to.be.an("undefined");
expect(comp.vm.maxWidth).to.be.an("undefined");
expect(comp.vm.minHeight).to.be.an("undefined");
expect(comp.vm.minWidth).to.be.an("undefined");
});

it('has correct props', () => {
expect(comp.vm.moduleName).to.equal('my-module');
expect(comp.vm.icon).to.equal('my-icon');
expect(comp.vm.win).to.equal('floating');
it("has correct props", () => {
expect(comp.vm.moduleName).to.equal("my-module");
expect(comp.vm.icon).to.equal("my-icon");
expect(comp.vm.win).to.equal("floating");
});

afterEach(() => {
comp.destroy();
});
});

describe('data', () => {
describe("data", () => {
let comp;
beforeEach(() => {
comp = shallowMount(ModuleCard, {
propsData: moduleProps
propsData: moduleProps,
});
});

it('has correct default data', () => {
it("has correct default data", () => {
expect(comp.vm.show).to.equal(false);
expect(comp.vm.minimized).to.equal(false);
});
Expand All @@ -68,15 +68,15 @@ describe('modulecore/ModuleCard.vue', () => {
});
});

describe('methods', () => {
describe("methods", () => {
let comp;
beforeEach(() => {
comp = shallowMount(ModuleCard, {
propsData: moduleProps
propsData: moduleProps,
});
});

it('toggleUi switches show', () => {
it("toggleUi switches show", () => {
comp.vm.show = false;
comp.vm.toggleUi();
expect(comp.vm.show).to.equal(true);
Expand Down

0 comments on commit 4309331

Please sign in to comment.