Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2021-11-11 13:53:05 +0300
committerGitHub <noreply@github.com>2021-11-11 13:53:05 +0300
commit680ac30b2078ce7f0fb587c145161dab0bce2c24 (patch)
tree17aeb01ffa31e59267a6b9859f900c944883c1fd /plugins/CoreHome/angularjs/common
parentac3d508c9ac9700c7d3928bd8014a34205f4c296 (diff)
[Vue] migrate dropdown and related directives (#18214)
* migrating RateFeature and ReviewLinks + adding AjaxHelper.fetch utility method (all untested) * get ratefeature component to work, modify matomodialog component to use v-model, add event parameters to createAngularAdapter, allow translate to use variadic args or one string array + rebuild * remove ratefeature angularjs files * rebuild + make vue mapping property optional in createANgularJsAdapter * migrate enrichedheadline and get to work * fix test * fix translate * fix another translate issue & migrate contentblock directive * fix anchor links, not including the "/" causes angularjs to fail (also on 4.x-dev) * update expected screenshots * fix ui test * fix some test failures * fix nested transclude issue * remove content block files * fix icon spacing that occurs due to angularjs inserting empty comments in between nodes while vue 3 does not * update some screenshots * update screenshot (actually fixes an alignment issue) * update screenshot * first pass at converting comparisons service/component * get new code to build and load without error in the UI * debugging * getting basic functionaltiy to work * Update _dataTable.twig * fix UI test failure + URL encoding/angularjs issue causing back button to not work * fix order of operations issue * built vue files * using ref in setup() is not needed to access this.$refs * Convert comparisons service angularjs tests to comparison store typescript tests. * migrate piwik-date-picker directive * migrate date range picker component (changed invalid date in input handling to just reset back to the previous date since it was easier in vue to do that) * migrate period-date-picker component (using composition api more when easier for migration) * convert piwik-expand-onclick directive to vue directive * migrate expand on hover directive to vue directive * fix variable reference * build * Add materialize-css @types and migrate piwik-dropdown-menu. * migrate focus-anywhere-but-here directive to vue directive * migrate focus-if directive * migrate menudropdown directive * forgot to remove old files * built vue files * rewrite URL handling to use computed properties in a URL store + do the same for other dependent data in the comparison store to allow vues to subscribe to the properties for changes to global state * fix some tests * some more fixes * more fixes + disallow modifications to MatomoUrl state * get angularjs unit tests to pass + fix a couple more issues * another fix * fix bad merge * self review + fixes * remove old fix as it may not be needed anymore * empty string is not a valid date + do not report invalid date exception just rethrow * update screenshots and try to fix random failure * use jquery $destroy event instead of scope one since the scope one is broadcasted * rangeChange event must be triggered once on mount * initialize startDateText/endDateText correctly * use jquery $destroy event instead of angularjs one * built vue files * fix menudropdown.directive.js reference * load vue in installation/updater & correctly make focusanywherebuthere stateful * correctly implement stateful directives for ExpandOnClick/ExpandOnHover * less tweak (angularjs comment removal) * fix submenu check * quick type fix * load vue in installation workflow * add broadcast.js to Installation workflow + do not fail in pk_translate if no translations are loaded * update expected screenshots (spacing of arrow changed because of angularjs comment no longer being there) * fix prop type * built vue files * re add accidentally removed (?) file * remove no longer needed file * Add CoreHome UMD in CoreUpdater/Installation. * self review * remove file from JS list * fix UI tests * apply review fixes Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/CoreHome/angularjs/common')
-rw-r--r--plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js76
-rw-r--r--plugins/CoreHome/angularjs/common/directives/focusif.js33
2 files changed, 0 insertions, 109 deletions
diff --git a/plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js b/plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js
deleted file mode 100644
index 4b210b2974..0000000000
--- a/plugins/CoreHome/angularjs/common/directives/focus-anywhere-but-here.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-/**
- * The given expression will be executed when the user presses either escape or presses something outside
- * of this element
- *
- * Example:
- * <div piwik-focus-anywhere-but-here="closeDialog()">my dialog</div>
- */
-(function () {
- angular.module('piwikApp.directive').directive('piwikFocusAnywhereButHere', piwikFocusAnywhereButHere);
-
- piwikFocusAnywhereButHere.$inject = ['$document'];
-
- function piwikFocusAnywhereButHere($document){
- return {
- restrict: 'A',
- link: function(scope, element, attr, ctrl) {
-
- var isMouseDown = false;
- var hasScrolled = false;
-
- function onClickOutsideElement (event) {
- var hadUsedScrollbar = isMouseDown && hasScrolled;
- isMouseDown = false;
- hasScrolled = false;
-
- if (hadUsedScrollbar) {
- return;
- }
-
- if (element.has(event.target).length === 0) {
- setTimeout(function () {
- scope.$apply(attr.piwikFocusAnywhereButHere);
- }, 0);
- }
- }
-
- function onScroll (event) {
- hasScrolled = true;
- }
-
- function onMouseDown (event) {
- isMouseDown = true;
- hasScrolled = false;
- }
-
- function onEscapeHandler (event) {
- if (event.which === 27) {
- setTimeout(function () {
- isMouseDown = false;
- hasScrolled = false;
- scope.$apply(attr.piwikFocusAnywhereButHere);
- }, 0);
- }
- }
-
- $document.on('keyup', onEscapeHandler);
- $document.on('mousedown', onMouseDown);
- $document.on('mouseup', onClickOutsideElement);
- $document.on('scroll', onScroll);
- scope.$on('$destroy', function() {
- $document.off('keyup', onEscapeHandler);
- $document.off('mousedown', onMouseDown);
- $document.off('mouseup', onClickOutsideElement);
- $document.off('scroll', onScroll);
- });
- }
- };
- }
-})();
diff --git a/plugins/CoreHome/angularjs/common/directives/focusif.js b/plugins/CoreHome/angularjs/common/directives/focusif.js
deleted file mode 100644
index 8db12603b6..0000000000
--- a/plugins/CoreHome/angularjs/common/directives/focusif.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-/**
- * If the given expression evaluates to true the element will be focused
- *
- * Example:
- * <input type="text" piwik-focus-if="view.editName">
- */
-(function () {
- angular.module('piwikApp.directive').directive('piwikFocusIf', piwikFocusIf);
-
- piwikFocusIf.$inject = ['$timeout'];
-
- function piwikFocusIf($timeout) {
- return {
- restrict: 'A',
- link: function(scope, element, attrs) {
- scope.$watch(attrs.piwikFocusIf, function(newValue, oldValue) {
- if (newValue) {
- $timeout(function () {
- element[0].focus();
- }, 5);
- }
- });
- }
- };
- }
-})();