Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Vue upgrade #2842

Draft
wants to merge 52 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f5af7cf
Updated all packages
Joossensei Sep 21, 2021
d2f23bc
Fixed most errors
Joossensei Sep 22, 2021
73abaf0
Update index.js
Joossensei Sep 23, 2021
98bc583
Upgrade for vuex required
Joossensei Sep 23, 2021
c22c502
Updated some files and the vuedraggable
Joossensei Sep 28, 2021
36cd716
Fixed the password field on login
Joossensei Sep 28, 2021
b54d121
fixed sidebar and Toolbar
Joossensei Sep 28, 2021
0979e2d
Fixing Popover, Dropdown, Toast, filters and this.$root.$on problems
Joossensei Sep 29, 2021
cbdbfcf
fixed dropdown
Joossensei Oct 1, 2021
aa6fbd4
Fixed some more editor component errors
Joossensei Oct 1, 2021
90aeb25
Bootstrap Update
Joossensei Oct 4, 2021
3f46681
Revert Bootstrap changes
Joossensei Oct 4, 2021
561dcdc
Bootstrap
Joossensei Oct 4, 2021
380b640
Reverted the bootstrap errors
Joossensei Oct 4, 2021
3fe71bf
WIP fix for image and file list components
Joossensei Oct 4, 2021
9213542
Fixed pattern and the lists render
Joossensei Oct 5, 2021
438ada1
Updated packages and fixing bugs in fields
Joossensei Oct 25, 2021
c84c250
Fixing all fields
Joossensei Oct 27, 2021
c25adbe
Fix space between save buttons
Joossensei Oct 27, 2021
8313c7a
Testing
Joossensei Oct 27, 2021
e4028a2
Fixed the missing filters for the select
Joossensei Oct 28, 2021
6b17d34
Fixed the Select field and removed comments
Joossensei Oct 29, 2021
2d0b4d7
Removed empty fields for the Select and update on package-lock
Joossensei Nov 1, 2021
e11176e
Fixed most errors
Joossensei Sep 22, 2021
b3f07ff
Updated some files and the vuedraggable
Joossensei Sep 28, 2021
1b9d97b
Fixed the password field on login
Joossensei Sep 28, 2021
6fadd4a
fixed sidebar and Toolbar
Joossensei Sep 28, 2021
9023a49
Fixing Popover, Dropdown, Toast, filters and this.$root.$on problems
Joossensei Sep 29, 2021
d1d8854
fixed dropdown
Joossensei Oct 1, 2021
bea66bb
Bootstrap Update
Joossensei Oct 4, 2021
3a44a0f
Revert Bootstrap changes
Joossensei Oct 4, 2021
652f18f
Bootstrap
Joossensei Oct 4, 2021
c71dfb9
Reverted the bootstrap errors
Joossensei Oct 4, 2021
c9b395b
Adressed a conflict
Joossensei Oct 5, 2021
726a101
Fix space between save buttons
Joossensei Oct 27, 2021
82194b4
Removed empty fields for the Select and update on package-lock
Joossensei Nov 1, 2021
b2556bc
Updated the markdown field
Joossensei Dec 14, 2021
2470c6c
Update markdown so it uses the textarea component
Joossensei Dec 14, 2021
810ae32
Fixed all editor components
Joossensei Dec 14, 2021
d5515a7
Fix some store issues
Joossensei Dec 14, 2021
c49cda0
We now have a actual markdown field and removed some comments
Joossensei Jan 11, 2022
228716f
Update eslint prettier package
Joossensei Feb 15, 2022
ec0e1d7
Update select.html.twig
Joossensei Feb 15, 2022
503f661
ESLint update
Joossensei Feb 15, 2022
3caccc8
More ESLint fixes
Joossensei Feb 15, 2022
76152e5
Progress for collections
Joossensei Feb 15, 2022
38f12d7
Fix StyleLint
Joossensei Feb 15, 2022
1b6fdb9
Update contenttypes.yaml
Joossensei Feb 21, 2022
7303826
Added buttons to component and removed them from template
Joossensei Feb 21, 2022
a8f41bb
Update package-lock.json
Joossensei Feb 21, 2022
a8e616e
Update package.json
Joossensei Feb 21, 2022
3b49d3a
Update Collection.vue
Joossensei Feb 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module.exports = {
"plugin:vue/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/vue",
],
rules: {
"no-console": ["error", {allow: ["error", "warn"]}],
Expand All @@ -34,4 +33,4 @@ module.exports = {
}
}
}
};
};
55 changes: 22 additions & 33 deletions assets/js/app/common.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import $ from 'jquery';
import { DateTime } from 'luxon';
import { Popover } from 'bootstrap';

import { version } from '../version';
window.assetsVersion = version;

$(document).ready(function() {
$(document).ready(function () {
// add a js class to indicate we have JS enabled. Might need a change to either modernizr or somethng comparable
$('html').addClass('js');

Expand All @@ -16,16 +17,12 @@ $(document).ready(function() {
*/
$('.admin__sidebar').addClass('admin__sidebar--is-collapsed');

$('.admin-sidebar-toggler').on('click', function() {
$('.admin-sidebar-toggler').on('click', function () {
if ($('.admin__sidebar').hasClass('admin__sidebar--is-collapsed')) {
$('.admin__sidebar')
.addClass('admin__sidebar--is-expanded')
.removeClass('admin__sidebar--is-collapsed');
$('.admin__sidebar').addClass('admin__sidebar--is-expanded').removeClass('admin__sidebar--is-collapsed');
$(this).toggleClass('is-active');
} else {
$('.admin__sidebar')
.addClass('admin__sidebar--is-collapsed')
.removeClass('admin__sidebar--is-expanded');
$('.admin__sidebar').addClass('admin__sidebar--is-collapsed').removeClass('admin__sidebar--is-expanded');
$(this).toggleClass('is-active');
}
});
Expand All @@ -45,7 +42,7 @@ $(document).ready(function() {
}, 50);
}

$('a[data-toggle="pill"]').on('click', function() {
$('a[data-toggle="pill"]').on('click', function () {
let newUrl;
const hash = $(this).attr('href');
newUrl = url.split('#')[0] + hash;
Expand All @@ -55,20 +52,23 @@ $(document).ready(function() {
/*
** Convert all ISO dates with class .datetime-relative to relative time
*/
$('.datetime-relative').each(function() {
$('.datetime-relative').each(function () {
$(this).text(DateTime.fromISO($(this).text()).toRelative());
});

/*
** Initialise all popover elements
*/
$('[data-toggle="popover"]').popover();

var popoverEl = document.getElementsByClassName('.fa.fa-info-circle');
if (popoverEl > 0) {
new Popover(popoverEl);
}
/*
** When a field from another group is invalid, show it.
*/
$('#editor button[type="submit"]').click(function() {
$('input:invalid').each(function() {
$('#editor button[type="submit"]').click(function () {
$('input:invalid').each(function () {
// Find the tab-pane that this element is inside, and get the id
var $closest = $(this).closest('.tab-pane');
var id = $closest.attr('id');
Expand All @@ -85,20 +85,15 @@ $(document).ready(function() {
** Simulates disabled behavior for elements with data-readonly attribute.
* This is needed, because a disabled input cannot be required.
*/
$('[data-readonly]').on('keydown paste', function(e) {
$('[data-readonly]').on('keydown paste', function (e) {
e.preventDefault();
});
/* Part of the code above, however make sure flatpickr is not readonly
* and that its validation works.
*/
$('.editor--date')
.siblings()
.prop('readonly', false)
.attr('data-readonly', 'readonly');
$('.editor--date').on('change', e => {
const target = $(e.target)
.parent()
.find('input[data-readonly="readonly"]');
$('.editor--date').siblings().prop('readonly', false).attr('data-readonly', 'readonly');
$('.editor--date').on('change', (e) => {
const target = $(e.target).parent().find('input[data-readonly="readonly"]');
if (target.val()) {
target[0].setCustomValidity('');
} else {
Expand All @@ -124,23 +119,20 @@ $(document).ready(function() {
$('[data-errormessage]').on('input', handleInput);

/* Set the errormessage on the correct editor--date field */
$('.editor--date').each(function() {
$('.editor--date').each(function () {
let siblings = $(this).siblings();
const errormessage = $(this).attr('data-errormessage');

siblings.each(function() {
$(this)
.attr('data-errormessage', errormessage)
.on('invalid', handleInvalid)
.on('input', handleInput);
siblings.each(function () {
$(this).attr('data-errormessage', errormessage).on('invalid', handleInvalid).on('input', handleInput);
});
});
/* End of custom error message */

/*
** Copy text to clipboard. Used in filemanager actions.
*/
$('[data-copy-to-clipboard]').on('click', function(e) {
$('[data-copy-to-clipboard]').on('click', function (e) {
const target = $(e.target);

var input = document.createElement('input');
Expand All @@ -151,10 +143,7 @@ $(document).ready(function() {
input.focus();
input.select();
document.execCommand('copy');
target
.parent()
.find('#copy')
.remove();
target.parent().find('#copy').remove();
});
/* End of copy text to clipboard */
});
4 changes: 2 additions & 2 deletions assets/js/app/confirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ if (locale) {
bootbox.setLocale(locale);
}

$('*[data-confirmation]').on('click', function() {
$('*[data-confirmation]').on('click', function () {
const thisElem = $(this);
const thisHref = $(this).attr('href');
const confirmation = $(this).data('confirmation');

if (!thisElem.data('confirmed')) {
bootbox.confirm(confirmation, function(result) {
bootbox.confirm(confirmation, function (result) {
if (result && thisHref) {
window.location = thisHref;
}
Expand Down
Loading