Skip to content

Commit

Permalink
fix: patch d2-analysis so elements have relevant class-names for push…
Browse files Browse the repository at this point in the history
…-analytics (#1032)

* fix: patch d2-analysis to provide class-names for push-analytics

* chore: use node v14 instead of v12 in github-actions

patch-package only works on node v14 and up

* chore: restore devHref to original value
  • Loading branch information
HendrikThePendric authored Jan 29, 2024
1 parent c87bcea commit a844a6b
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 73 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand All @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/cache@v2
id: yarn-cache
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- uses: actions/download-artifact@v2
with:
Expand All @@ -94,7 +94,7 @@ jobs:

- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Publish release to GitHub
run: npx @dhis2/cli-utils release
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Event charts app",
"main": "index.html",
"scripts": {
"postinstall": "patch-package",
"lint": "./node_modules/eslint/bin/eslint.js src `git diff --cached --name-only | grep \\.js$`",
"validate": "npm ls --depth 0",
"prestart": "d2-manifest package.json manifest.webapp",
Expand Down Expand Up @@ -45,6 +46,8 @@
"eslint-plugin-react": "3.3.1",
"img-loader": "^1.2.2",
"json-loader": "^0.5.7",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"sass-loader": "7",
"style-loader": "0.12.3",
"url-loader": "^0.5.7",
Expand Down
44 changes: 44 additions & 0 deletions patches/d2-analysis+33.1.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/node_modules/d2-analysis/lib/ui/ChartDownloadButtonItems.js b/node_modules/d2-analysis/lib/ui/ChartDownloadButtonItems.js
index 54ec8c6..2100864 100644
--- a/node_modules/d2-analysis/lib/ui/ChartDownloadButtonItems.js
+++ b/node_modules/d2-analysis/lib/ui/ChartDownloadButtonItems.js
@@ -20,6 +20,7 @@ exports.ChartDownloadButtonItems = ChartDownloadButtonItems = function ChartDown
style: 'padding:7px 5px 5px 7px; font-weight:bold'
}, {
text: i18n.image_png + ' (.png)',
+ cls: 'push-analytics-download-as-png-menu-item',
iconCls: 'ns-menu-item-image',
handler: function handler() {
uiManager.submitSvgForm('png', getFilename());
diff --git a/node_modules/d2-analysis/lib/ui/FavoriteButton.js b/node_modules/d2-analysis/lib/ui/FavoriteButton.js
index c08b594..0848e28 100644
--- a/node_modules/d2-analysis/lib/ui/FavoriteButton.js
+++ b/node_modules/d2-analysis/lib/ui/FavoriteButton.js
@@ -27,6 +27,7 @@ exports.FavoriteButton = FavoriteButton = function FavoriteButton(c) {

return Ext.create('Ext.button.Button', {
text: i18n.favorites,
+ cls: 'push-analytics-favorites-dropdown-menu-button',
menu: {},
handler: function handler(b) {
b.menu = Ext.create('Ext.menu.Menu', {
@@ -40,6 +41,7 @@ exports.FavoriteButton = FavoriteButton = function FavoriteButton(c) {

var newItem = Ext.create('Ext.menu.Item', {
text: getTitle(i18n.new_),
+ cls: 'push-analytics-new-events-chart-menu-item',
iconCls: 'ns-menu-item-favorite-new',
disabled: !instanceManager.isStateCurrent(),
handler: function handler() {
diff --git a/node_modules/d2-analysis/lib/ui/Viewport.js b/node_modules/d2-analysis/lib/ui/Viewport.js
index 4381d4c..0647b19 100644
--- a/node_modules/d2-analysis/lib/ui/Viewport.js
+++ b/node_modules/d2-analysis/lib/ui/Viewport.js
@@ -264,6 +264,7 @@ exports.Viewport = Viewport = function Viewport(refs, cmp, config) {

var downloadButton = Ext.create('Ext.button.Button', {
text: i18n.download,
+ cls: 'push-analytics-download-dropdown-menu-button',
disabled: true,
menu: {},
handler: function handler(b) {
Loading

0 comments on commit a844a6b

Please sign in to comment.