Skip to content

Commit da82a57

Browse files
committed
Clean-up and fix web components #106
1 parent d461dc6 commit da82a57

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

components/FederationMissingNotice.vue

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
This data is incomplete as the following service{{services.length > 1 ? 's' : ''}} in the federation {{services.length > 1 ? 'are' : 'is'}} currently unavailable:
77
</p>
88
<ul>
9-
<li v-for="service in services">
9+
<li v-for="service in services" :key="service.url">
1010
<div class="fed-header">
1111
<strong class="fed-title">{{ service }}</strong>
1212
<ul class="badges small inline">
@@ -19,17 +19,13 @@
1919
</template>
2020

2121
<script>
22-
import FederationMixin from './internal/FederationMixin.js';
2322
import Utils from '../utils';
2423
2524
export default {
2625
name: 'FederationMissingNotice',
2726
components: {
2827
AsyncButton: () => import('./internal/AsyncButton.vue')
2928
},
30-
mixins: [
31-
FederationMixin
32-
],
3329
props: {
3430
missing: {
3531
type: Array,
@@ -39,9 +35,13 @@ export default {
3935
type: Function,
4036
default: null
4137
},
42-
// Mixins don't work properly in web components,
43-
// see https://github.com/vuejs/vue-web-component-wrapper/issues/30,
44-
...FederationMixin.props
38+
federation: {
39+
type: Object,
40+
default: () => ({})
41+
}
42+
},
43+
beforeCreate() {
44+
Utils.enableHtmlProps(this);
4545
},
4646
computed: {
4747
services() {

components/internal/FederationNotice.vue

+4-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@
1717
</template>
1818

1919
<script>
20-
import FederationMixin from './FederationMixin.js';
2120
import Utils from '../../utils';
2221
2322
export default {
2423
name: 'FederationNotice',
25-
mixins: [
26-
FederationMixin
27-
],
2824
props: {
2925
entity: {
3026
type: String,
@@ -34,9 +30,10 @@ export default {
3430
type: Array,
3531
default: []
3632
},
37-
// Mixins don't work properly in web components,
38-
// see https://github.com/vuejs/vue-web-component-wrapper/issues/30,
39-
...FederationMixin.props
33+
federation: {
34+
type: Object,
35+
default: () => ({})
36+
}
4037
},
4138
computed: {
4239
unsupported() {

dev/create-wc-examples.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ const examples = require('./examples');
33

44
const FOLDER = './examples';
55

6-
if (!fs.existsSync(FOLDER)){
7-
fs.mkdirSync(FOLDER);
6+
if (fs.existsSync(FOLDER)) {
7+
fs.rmdirSync(FOLDER, { recursive: true });
88
}
9+
fs.mkdirSync(FOLDER);
10+
11+
const ignored = [
12+
'b-button',
13+
'tooltip-icon'
14+
];
915

1016
for(let component in examples) {
17+
if (ignored.includes(component)) {
18+
continue;
19+
}
1120
for(let id in examples[component]) {
1221
createExampleFile(component, id, examples[component][id]);
1322
}
@@ -41,7 +50,7 @@ function createExampleFile(component, id, props) {
4150
<meta charset="utf-8">
4251
<meta name="viewport" content="width=device-width, initial-scale=1">
4352
<title>openEO ${component}</title>
44-
<link href="../dev/examples.css" rel="stylesheet"></script>
53+
<link href="../dev/examples.css" rel="stylesheet" />
4554
<script src="../assets/openeo.js"></script>
4655
<link rel="preload" as="font" type="font/woff2" crossorigin href="https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2" />
4756
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css" type="text/css" media="all" />

dev/examples.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let externalProc = require('./examples/model-builder/external_process.json');
2727
let asyncFn = () => new Promise(resolve => setTimeout(() => {
2828
alert("Async action executed");
2929
resolve();
30-
}, 3000))
30+
}, 3000));
3131

3232
module.exports = {
3333
"b-button": {

0 commit comments

Comments
 (0)