Skip to content

Commit 1e61f66

Browse files
authored
Merge pull request #755 from wmde/replace-wikit-dialog
Replace wikit dialog with codex dialog
2 parents 12493bd + 94eea39 commit 1e61f66

File tree

7 files changed

+370
-598
lines changed

7 files changed

+370
-598
lines changed

.eslintrc.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ module.exports = {
1212
rules: {
1313
'max-len': [ 'error', 120 ],
1414
'no-multiple-empty-lines' : ['error', { 'max': 1 }],
15-
'vue/multi-word-component-names' : [ 'off' ]
16-
},
15+
'vue/multi-word-component-names' : [ 'off' ],
16+
// Migration changes
17+
'vue/no-deprecated-v-bind-sync': 'off',
18+
'vue/no-deprecated-slot-attribute': 'off',
19+
'vue/require-explicit-emits': 'off',
20+
'vue/no-deprecated-v-on-native-modifier': 'off',
21+
'vue/no-deprecated-slot-scope-attribute': 'off',
22+
'vue/no-v-for-template-key-on-child': 'off',
23+
'vue/no-deprecated-destroyed-lifecycle': 'off',
24+
'vue/no-v-model-argument': 'off'
25+
},
1726
};

package-lock.json

Lines changed: 278 additions & 240 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
"@types/lodash": "^4.14.199",
2020
"@typescript-eslint/eslint-plugin": "^6.7.5",
2121
"@typescript-eslint/parser": "^6.7.5",
22-
"@vue/compiler-sfc": "3.2.0",
22+
"@vue/compiler-sfc": "^3.3.8",
2323
"@vue/eslint-config-typescript": "^12.0.0",
2424
"@vue/test-utils": "^2.0.0",
2525
"@vue/vue3-jest": "^29.2.4",
26-
"@vue/runtime-dom": "3.2.0",
26+
"@vue/runtime-dom": "^3.3.8",
2727
"@wikimedia/codex": "^0.20.0",
2828
"@wikimedia/codex-design-tokens": "^0.20.0",
2929
"@wikimedia/codex-icons": "^0.20.0",
@@ -49,25 +49,14 @@
4949
"dependencies": {
5050
"@inertiajs/inertia": "^0.11.0",
5151
"@inertiajs/inertia-vue3": "^0.6.0",
52-
"@vue/compat": "3.2.0",
52+
"@vue/compat": "^3.3.8",
5353
"@wmde/wikit-tokens": "^2.1.0-alpha.15",
5454
"@wmde/wikit-vue-components": "^2.1.0-alpha.16",
5555
"date-fns": "^2.30.0",
5656
"lodash": "^4.17.21",
5757
"pinia": "2.0.36",
5858
"ress": "^5.0.2",
59-
"vue": "3.2.0",
59+
"vue": "^3.3.8",
6060
"vue-banana-i18n": "2.3.0"
61-
},
62-
"overrides": {
63-
"pinia": {
64-
"vue": "3.2.0"
65-
},
66-
"@wikimedia/codex": {
67-
"vue": "3.2.0"
68-
},
69-
"vue-banana-i18n": {
70-
"banana-i18n": "2.2.0"
71-
}
7261
}
7362
}

resources/js/Components/MismatchRow.vue

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
</span>
4747
</td>
4848
<td :data-header="$i18n('column-review-status')">
49-
<dropdown
50-
:menuItems="Object.values(statusOptions)"
49+
<cdx-select
50+
:menu-items="Object.values(statusOptions)"
5151
:disabled="disabled"
52-
v-model="decision"
53-
@input="$bubble('decision', {
52+
v-model:selected="reviewStatus"
53+
@update:selected="$bubble('decision', {
5454
id: mismatch.id,
5555
item_id: mismatch.item_id,
56-
review_status: $event.value
56+
review_status: $event
5757
})"
5858
/>
5959
</td>
@@ -79,15 +79,16 @@
7979
</wikit-button>
8080
</div>
8181
</div>
82-
<wikit-dialog class="full-description-dialog"
82+
<cdx-dialog class="full-description-dialog"
8383
:title="$i18n('column-upload-info')"
84-
ref="fullDescriptionDialog"
85-
:actions="[{
84+
:open="fullDescriptionDialog"
85+
:primary-action="{
8686
label: $i18n('confirm-dialog-button'),
87-
namespace: 'next-steps-confirm'
88-
}]"
89-
@action="(_, dialog) => dialog.hide()"
90-
dismiss-button
87+
namespace: 'next-steps-confirm',
88+
actionType: 'progressive'
89+
}"
90+
@primary="() => fullDescriptionDialog = false"
91+
close-button-label="X"
9192
>
9293
<wikit-link class="uploader"
9394
:href="`https://www.wikidata.org/wiki/User:${mismatch.import_meta.user.username}`"
@@ -99,7 +100,7 @@
99100
<div class="description">
100101
{{this.mismatch.import_meta.description}}
101102
</div>
102-
</wikit-dialog>
103+
</cdx-dialog>
103104
</td>
104105
</tr>
105106
</template>
@@ -111,10 +112,9 @@ import type { PropType } from 'vue';
111112
import { defineComponent } from 'vue';
112113
import {
113114
Button as WikitButton,
114-
Dialog as WikitDialog,
115-
Dropdown,
116115
Link as WikitLink
117116
} from '@wmde/wikit-vue-components';
117+
import { CdxDialog, CdxSelect } from "@wikimedia/codex";
118118
import { MenuItem } from '@wmde/wikit-vue-components/dist/components/MenuItem';
119119
120120
import { LabelledMismatch, ReviewDecision } from "../types/Mismatch";
@@ -132,14 +132,16 @@ type ReviewOptionMap = {
132132
interface MismatchRowState {
133133
statusOptions: ReviewOptionMap;
134134
decision: ReviewMenuItem;
135+
reviewStatus: string;
136+
fullDescriptionDialog: boolean;
135137
}
136138
137139
export default defineComponent({
138140
components: {
139141
WikitButton,
140142
WikitLink,
141-
WikitDialog,
142-
Dropdown,
143+
CdxDialog,
144+
CdxSelect
143145
},
144146
props: {
145147
mismatch: Object as PropType<LabelledMismatch>,
@@ -183,14 +185,14 @@ export default defineComponent({
183185
return {
184186
statusOptions,
185187
decision: statusOptions[this.mismatch.review_status],
188+
reviewStatus: String(this.mismatch.review_status),
189+
fullDescriptionDialog: false
186190
};
187191
},
188192
methods: {
189193
showDialog(e: Event) {
190194
e.preventDefault();
191-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
192-
const descriptionDialog = this.$refs.fullDescriptionDialog! as any;
193-
descriptionDialog.show();
195+
this.fullDescriptionDialog = true;
194196
}
195197
}
196198
});

resources/js/Pages/Home.vue

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
id="faq-button"
99
variant="quiet"
1010
type="progressive"
11-
@click.native="$refs.faq.show()"
11+
@click.native="faqDialog = true"
1212
>
1313
<template #prefix>
1414
<icon type="info-outlined" size="medium" color="inherit"/>
1515
</template>
1616
{{ $i18n('faq-button') }}
1717
</wikit-button>
1818
</header>
19-
20-
<wikit-dialog id="faq-dialog"
21-
:title="$i18n('faq-dialog-title')"
22-
ref="faq"
23-
:actions="[{
24-
label: $i18n('confirm-dialog-button'),
25-
namespace: 'faq-confirm'
26-
}]"
27-
@action="(_, dialog) => dialog.hide()"
28-
dismiss-button
19+
<cdx-dialog id="faq-dialog"
20+
v-model:open="faqDialog"
21+
:title="$i18n('faq-dialog-title')"
22+
:primary-action="{
23+
label: $i18n('confirm-dialog-button'),
24+
namespace: 'faq-confirm',
25+
actionType: 'progressive'
26+
}"
27+
@primary="() => faqDialog = false"
28+
close-button-label="X"
2929
>
3030
<section>
3131
<h3 class="h5">{{ $i18n('faq-dialog-question-finding-mismatches' )}}</h3>
@@ -54,7 +54,7 @@
5454
'https://www.wikidata.org/wiki/Wikidata_talk:Mismatch_Finder'
5555
]"></p>
5656
</section>
57-
</wikit-dialog>
57+
</cdx-dialog>
5858
<p id="about-description" >
5959
{{ $i18n('about-mismatch-finder-description') }}
6060
</p>
@@ -112,11 +112,11 @@
112112
import { useStore } from '../store';
113113
import {
114114
Button as WikitButton,
115-
Dialog as WikitDialog,
116115
Icon,
117116
Message,
118117
TextArea
119118
} from '@wmde/wikit-vue-components';
119+
import { CdxDialog } from "@wikimedia/codex";
120120
import { defineComponent } from 'vue';
121121
122122
interface HomeState {
@@ -126,7 +126,8 @@
126126
validationError: null|{
127127
type: string,
128128
message: string
129-
}
129+
},
130+
faqDialog: boolean
130131
}
131132
132133
interface ErrorMessages {
@@ -141,12 +142,12 @@
141142
142143
export default defineComponent({
143144
components: {
144-
InertiaHead,
145-
Icon,
146-
Message,
147-
TextArea,
148-
WikitButton,
149-
WikitDialog
145+
CdxDialog,
146+
InertiaHead,
147+
Icon,
148+
Message,
149+
TextArea,
150+
WikitButton
150151
},
151152
methods: {
152153
splitInput: function(): Array<string> {
@@ -222,7 +223,8 @@
222223
form: {
223224
itemsInput: store.lastSearchedIds
224225
},
225-
validationError: null
226+
validationError: null,
227+
faqDialog: false
226228
}
227229
}
228230
});

0 commit comments

Comments
 (0)