Skip to content

Commit fab7972

Browse files
committed
Revert "XWIKI-23024: Upgrade to Vue 3.x (#4079)"
This reverts commit fdc4d21.
1 parent 57ff96a commit fab7972

File tree

177 files changed

+26747
-14674
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+26747
-14674
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,3 @@ xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/res
7272
.clover
7373
*~
7474
**/overlays/*.info
75-
76-
## Node specific
77-
node_modules/
78-
dist/

pom.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@
123123
<oracle.groupId>com.oracle.database.jdbc</oracle.groupId>
124124
<oracle.artifactId>ojdbc11</oracle.artifactId>
125125
<oracle.version>21.17.0.0</oracle.version>
126-
126+
127127
<!-- Versions of Node related tools -->
128-
<node.version>v22.14.0</node.version>
129-
<npm.version>11.2.0</npm.version>
128+
<node.version>v22.13.1</node.version>
129+
<npm.version>11.1.0</npm.version>
130130
</properties>
131131
<scm>
132132
<tag>HEAD</tag>
@@ -1187,7 +1187,15 @@
11871187
<dependency>
11881188
<groupId>org.webjars.npm</groupId>
11891189
<artifactId>vue</artifactId>
1190-
<version>3.5.13</version>
1190+
<version>2.7.16</version>
1191+
<exclusions>
1192+
<!-- Excluded because this dependency is 1) not used at runtime since all out components are pre-compiled 2)
1193+
not currently deployable on webjars.org (see https://github.com/webjars/webjars/issues/1976) -->
1194+
<exclusion>
1195+
<groupId>org.webjars.npm</groupId>
1196+
<artifactId>vue__compiler-sfc</artifactId>
1197+
</exclusion>
1198+
</exclusions>
11911199
</dependency>
11921200
</dependencies>
11931201
</dependencyManagement>

xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-test/xwiki-platform-flamingo-skin-test-docker/src/test/it/org/xwiki/flamingo/test/docker/AttachmentIT.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ class AttachmentIT
8080
@BeforeAll
8181
public void setup(TestUtils setup)
8282
{
83-
setup.loginAsSuperAdmin();
84-
// Make sure the timezone configuration the default value until XWIKI-21924 is fixed.
85-
setup.setPropertyInXWikiPreferences("timezone", "String", "");
8683
setup.createUser("User2", "pass", "");
8784
setup.createUserAndLogin("User1", "pass");
8885
}
@@ -107,7 +104,7 @@ void uploadAttachments(TestUtils setup, TestReference testReference, TestConfigu
107104
setup.rest().savePage(testReference, "", "");
108105
Page page = setup.rest().get(testReference);
109106
// We make the page hidden as we identified some issues specific to hidden pages (see XWIKI-20093).
110-
// If it happens that some issues are specific to non-hidden pages, the test will need to be improved to
107+
// If it happens that some issues are specific to non-hidden pages, the test will need to be improved to
111108
// cover both cases (which will make the execution time of the test suite larger).
112109
page.setHidden(true);
113110
setup.rest().save(page);

xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-macro/pom.xml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<name>XWiki Platform - Live Data - Macro</name>
3333
<description>Display dynamic lists of data.</description>
3434
<properties>
35-
<xwiki.jacoco.instructionRatio>0.78</xwiki.jacoco.instructionRatio>
35+
<xwiki.jacoco.instructionRatio>0.91</xwiki.jacoco.instructionRatio>
3636
<!-- Name to display by the Extension Manager -->
3737
<xwiki.extension.name>Live Data Macro</xwiki.extension.name>
3838
</properties>
@@ -58,22 +58,6 @@
5858
<artifactId>xwiki-platform-bridge</artifactId>
5959
<version>${project.version}</version>
6060
</dependency>
61-
<dependency>
62-
<groupId>org.xwiki.platform</groupId>
63-
<artifactId>xwiki-platform-template-api</artifactId>
64-
<version>${project.version}</version>
65-
</dependency>
66-
<dependency>
67-
<groupId>org.xwiki.platform</groupId>
68-
<artifactId>xwiki-platform-uiextension-api</artifactId>
69-
<version>${project.version}</version>
70-
</dependency>
71-
<dependency>
72-
<groupId>org.xwiki.platform</groupId>
73-
<artifactId>xwiki-platform-webjars-api</artifactId>
74-
<version>${project.version}</version>
75-
<scope>runtime</scope>
76-
</dependency>
7761
<!-- Test dependencies -->
7862
<dependency>
7963
<groupId>org.xwiki.rendering</groupId>

xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-macro/src/main/java/org/xwiki/livedata/internal/LiveDataImportmapUIExtension.java

Lines changed: 0 additions & 73 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
org.xwiki.livedata.internal.macro.LiveDataMacro
2-
org.xwiki.livedata.internal.LiveDataImportmapUIExtension

xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-macro/src/main/resources/templates/liveData/importmap.vm

Lines changed: 0 additions & 28 deletions
This file was deleted.

xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-war/src/main/webapp/resources/uicomponents/widgets/liveData.js

Lines changed: 65 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
1919
*/
2020
/*!
21+
#set ($liveDataEntry = 'xwiki-livedata.min')
22+
#set ($liveDataPath = $services.webjars.url('org.xwiki.platform:xwiki-platform-livedata-webjar', $liveDataEntry))
2123
#set ($paths = {
2224
'js': {
23-
'vue': $services.webjars.url('org.webjars.npm:vue', 'dist/vue.runtime.esm-browser.prod'),
25+
'xwiki-livedata': $liveDataPath,
26+
'xwiki-livedata-vue': $services.webjars.url('org.xwiki.platform:xwiki-platform-livedata-webjar',
27+
'xwiki-livedata-vue.umd.min'),
28+
'vue': $services.webjars.url('org.webjars.npm:vue', 'dist/vue.min'),
29+
'vue-i18n': $services.webjars.url('org.webjars.npm:vue-i18n', 'dist/vue-i18n.min'),
2430
'daterangepicker': $services.webjars.url('bootstrap-daterangepicker', 'js/bootstrap-daterangepicker.js')
2531
},
26-
'module': {
27-
'xwiki-livedata': $services.webjars.url('org.xwiki.platform:xwiki-platform-livedata-webjar', 'main.es.js')
28-
},
2932
'css': {
3033
'liveData': $services.webjars.url('org.xwiki.platform:xwiki-platform-livedata-webjar',
31-
'xwiki-platform-livedata.css'),
32-
'liveDataLess': $services.webjars.url('org.xwiki.platform:xwiki-platform-livedata-webjar',
33-
'variables.less', {'evaluate': true}),
34+
'xwiki-livedata-vue.umd.min.less', {'evaluate': true}),
3435
'dateRangePicker': $services.webjars.url('bootstrap-daterangepicker', 'css/bootstrap-daterangepicker.css'),
3536
'selectize': [
3637
$services.webjars.url('selectize.js', 'css/selectize.bootstrap3.css'),
@@ -48,67 +49,81 @@
4849
require.config({
4950
paths: paths.js,
5051
map: {
51-
"*": {
52-
"xwiki-livedata": "xwiki-livedata-with-css",
53-
daterangepicker: "daterangepicker-with-css",
54-
"xwiki-selectize": "xwiki-selectize-with-css",
55-
},
56-
"xwiki-livedata-with-css": {
57-
"xwiki-livedata": "xwiki-livedata",
52+
'*': {
53+
'xwiki-livedata-vue': 'xwiki-livedata-vue-with-css',
54+
daterangepicker: 'daterangepicker-with-css',
55+
'xwiki-selectize': 'xwiki-selectize-with-css'
5856
},
59-
"daterangepicker-with-css": {
60-
daterangepicker: "daterangepicker",
57+
'xwiki-livedata-vue-with-css': {
58+
'xwiki-livedata-vue': 'xwiki-livedata-vue'
6159
},
62-
"xwiki-selectize-with-css": {
63-
"xwiki-selectize": "xwiki-selectize",
60+
'daterangepicker-with-css': {
61+
daterangepicker: 'daterangepicker'
6462
},
63+
'xwiki-selectize-with-css': {
64+
'xwiki-selectize': 'xwiki-selectize'
65+
}
6566
},
6667
config: {
67-
"xwiki-livedata-source": {
68-
contextPath: paths.contextPath,
69-
},
70-
},
68+
'xwiki-livedata-source': {
69+
contextPath: paths.contextPath
70+
}
71+
}
7172
});
7273

73-
function loadCSS(url) {
74-
const link = document.createElement("link");
75-
link.type = "text/css";
76-
link.rel = "stylesheet";
77-
link.href = url;
78-
document.getElementsByTagName("head")[0].appendChild(link);
79-
}
80-
81-
function loadModule(url) {
82-
const script = document.createElement("script");
83-
script.type = "module";
84-
script.src = url;
85-
document.getElementsByTagName("head")[0].appendChild(script);
86-
}
87-
88-
define("loadCSS", function() {
74+
define('loadCSS', function() {
75+
var loadCSS = function(url) {
76+
var link = document.createElement("link");
77+
link.type = "text/css";
78+
link.rel = "stylesheet";
79+
link.href = url;
80+
document.getElementsByTagName("head")[0].appendChild(link);
81+
};
82+
8983
return (url) => {
90-
const urls = Array.isArray(url) ? url : [url];
84+
var urls = Array.isArray(url) ? url : [url];
9185
urls.forEach(loadCSS);
9286
};
9387
});
94-
95-
define("daterangepicker-with-css", ["loadCSS", "daterangepicker"], function(loadCSS) {
88+
89+
define('xwiki-livedata-vue-with-css', ['loadCSS', 'xwiki-livedata-vue'], function(loadCSS) {
90+
// Load the CSS for the live data.
91+
loadCSS(paths.css.liveData);
92+
return arguments[1];
93+
});
94+
95+
define('daterangepicker-with-css', ['loadCSS', 'daterangepicker'], function(loadCSS) {
9696
// Load the CSS for the date range picker.
9797
loadCSS(paths.css.dateRangePicker);
9898
return arguments[1];
9999
});
100-
101-
define("xwiki-selectize-with-css", ["loadCSS", "xwiki-selectize"], function(loadCSS) {
100+
101+
define('xwiki-selectize-with-css', ['loadCSS', 'xwiki-selectize'], function(loadCSS) {
102102
// Load the CSS for the suggest picker.
103103
loadCSS(paths.css.selectize);
104104
return arguments[1];
105105
});
106-
107-
loadModule(paths.module["xwiki-livedata"]);
108-
loadCSS(paths.css.liveData);
109-
// Load a small less file with the declarations of a few LESS values that are not exported
110-
// elsewhere
111-
loadCSS(paths.css.liveDataLess);
106+
107+
window.liveDataBaseURL = paths.liveDataBasePath;
108+
109+
require(['jquery', 'xwiki-livedata'], function($, LiveData) {
110+
$.fn.liveData = function(config) {
111+
return this.each(function() {
112+
if (!$(this).data('liveData')) {
113+
var instanceConfig = $.extend($(this).data('config'), config);
114+
$(this).attr('data-config', JSON.stringify(instanceConfig)).data('liveData', LiveData(this));
115+
}
116+
});
117+
};
118+
119+
var init = function(event, data) {
120+
var container = $((data && data.elements) || document);
121+
container.find('.liveData').liveData();
122+
};
123+
124+
$(document).on('xwiki:dom:updated', init);
125+
$(init);
126+
});
112127

113128
// End JavaScript-only code.
114-
}).apply("]]#", $jsontool.serialize([$paths]));
129+
}).apply(']]#', $jsontool.serialize([$paths]));

0 commit comments

Comments
 (0)