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

feat: improve support for right-to-left languages in Dashboard app #2985

Merged
merged 21 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
016586f
chore(deps): bump express from 4.18.1 to 4.19.2
dependabot[bot] Apr 25, 2024
bb6ee4d
feat(DHIS2-16777): support right-to-left languages
kabaros Feb 9, 2024
d74ab34
chore: update d2 config to allow right-to-left support
kabaros May 30, 2024
fd2e0b7
fix: keep the grid in ltr since the underlying library used fixed pos…
kabaros May 30, 2024
61f1856
chore: bump dhis/ui library
kabaros May 30, 2024
1083b47
chore: add stylelint config
kabaros May 30, 2024
d0c6bab
Merge branch 'dev' into dependabot/npm_and_yarn/express-4.19.2
jenniferarnesen Jun 21, 2024
09fb87b
Merge pull request #2944 from dhis2/dependabot/npm_and_yarn/express-4…
jenniferarnesen Jun 21, 2024
99fc310
Merge branch 'dev' into DHIS2-16777/rtl-support
jenniferarnesen Jun 21, 2024
ff10c0c
chore: merge conflict fail
jenniferarnesen Jun 21, 2024
eb54922
Merge branch 'master' into DHIS2-16777/rtl-support
janhenrikoverland Jun 25, 2024
8f7760e
Merge branch 'master' into DHIS2-16777/rtl-support
jenniferarnesen Aug 26, 2024
586eb18
chore: yarn deduplicate
jenniferarnesen Aug 26, 2024
0511971
chore: dhis2 dependency upgrades
jenniferarnesen Aug 26, 2024
784d941
chore: update test and make it resistant to further dhis2/ui changes
jenniferarnesen Aug 27, 2024
1bc2e57
chore: fix tests and css and dedupe again
jenniferarnesen Aug 27, 2024
3275053
chore: bump cli-app-scripts
kabaros Aug 27, 2024
23ac30a
Merge branch 'master' of github.com:dhis2/dashboard-app into DHIS2-16…
kabaros Aug 27, 2024
db371f8
fix: test cleanup and remove unused css file
jenniferarnesen Sep 26, 2024
16105c2
fix: remove unused component
jenniferarnesen Sep 26, 2024
00c7101
fix: move doc.dir to plugin and remove the extra div that was affecti…
jenniferarnesen Sep 26, 2024
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
14 changes: 14 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { config } = require('@dhis2/cli-style')

module.exports = {
extends: [config.stylelint],
rules: {
'csstools/use-logical': [
true,
{
// overriding the default config to error since this should be all fixed in this repo
severity: 'error',
},
],
},
}
2 changes: 2 additions & 0 deletions d2.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const config = {

minDHIS2Version: '2.40',

direction: 'auto',

pwa: {
enabled: true,
caching: {
Expand Down
7 changes: 5 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-03-19T12:31:03.302Z\n"
"PO-Revision-Date: 2024-03-19T12:31:03.302Z\n"
"POT-Creation-Date: 2024-08-27T07:26:05.058Z\n"
"PO-Revision-Date: 2024-08-27T07:26:05.060Z\n"

msgid "Untitled dashboard"
msgstr "Untitled dashboard"
Expand Down Expand Up @@ -322,6 +322,9 @@ msgstr "Show fewer"
msgid "Show more"
msgstr "Show more"

msgid "Open visualization in new tab"
msgstr "Open visualization in new tab"

msgid "Insert"
msgstr "Insert"

Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"license": "BSD-3-Clause",
"dependencies": {
"@dhis2/analytics": "^26.8.2",
"@dhis2/app-runtime": "^3.10.2",
"@dhis2/app-runtime": "^3.10.6",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/ui": "^9.2.0",
"@dhis2/ui": "^9.11.3",
"@krakenjs/post-robot": "^11.0.0",
"classnames": "^2.3.2",
"d2": "^31.10.0",
Expand Down Expand Up @@ -46,8 +46,8 @@
"@badeball/cypress-cucumber-preprocessor": "^20.1.0",
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.1",
"@cypress/webpack-preprocessor": "^6.0.2",
"@dhis2/cli-app-scripts": "^10.3.10",
"@dhis2/cli-style": "^10.5.1",
"@dhis2/cli-app-scripts": "^11.7.1",
"@dhis2/cli-style": "^10.7.3",
"@dhis2/cypress-commands": "^10.0.6",
"@dhis2/cypress-plugins": "^10.0.6",
"@semantic-release/changelog": "^6",
Expand All @@ -70,8 +70,5 @@
"moduleNameMapper": {
"^.+\\.(css|sass|scss)$": "identity-obj-proxy"
}
},
"resolutions": {
"@dhis2/ui": "^9.2.0"
}
}
18 changes: 12 additions & 6 deletions src/components/DashboardsBar/styles/Chip.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

.labelWithAdornment {
position: relative;
top: -2px;
inset-block-start: -2px;
}

.adornment {
margin-left: var(--spacers-dp4);
margin-inline-start: var(--spacers-dp4);
fill: var(--colors-grey600);
}

Expand All @@ -19,9 +19,12 @@
}

.progressIndicator {
margin: 0 0 0 4px !important;
width: 16px !important;
height: 16px !important;
margin-block-start: 0 !important;
margin-block-end: 0 !important;
margin-inline-start: 4px !important;
margin-inline-end: 0 !important;
inline-size: 16px !important;
block-size: 16px !important;
}

.progressIndicator.selected {
Expand All @@ -30,6 +33,9 @@

@media only screen and (max-width: 480px) {
.link {
margin: 0 -2px;
margin-block-start: 0;
margin-block-end: 0;
margin-inline-start: -2px;
margin-inline-end: -2px;
}
}
12 changes: 6 additions & 6 deletions src/components/DashboardsBar/styles/ClearButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
border: none;
border-radius: 50%;
cursor: pointer;
width: 24px;
height: 24px;
inline-size: 24px;
block-size: 24px;
}

.button > span {
Expand All @@ -17,13 +17,13 @@
}

.icon {
width: 16px;
height: 16px;
inline-size: 16px;
block-size: 16px;
}

@media only screen and (max-width: 480px) {
.button {
margin-bottom: var(--spacers-dp4);
margin-right: 1px;
margin-block-end: var(--spacers-dp4);
margin-inline-end: 1px;
}
}
34 changes: 20 additions & 14 deletions src/components/DashboardsBar/styles/Content.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
.controlsLarge {
display: inline-flex;
position: relative;
top: 5px;
inset-block-start: 5px;
}

.buttonPadding {
padding: 2px var(--spacers-dp8) 0 var(--spacers-dp8);
padding-block-start: 2px;
padding-block-end: 0;
padding-inline-start: var(--spacers-dp8);
padding-inline-end: var(--spacers-dp8);
display: inline-flex;
}

Expand All @@ -23,7 +26,7 @@
}

.chipsContainer {
min-height: 40px;
min-block-size: 40px;
}

@media only screen and (max-width: 480px) {
Expand All @@ -33,7 +36,7 @@

.controlsSmall {
display: block;
margin-bottom: var(--spacers-dp4);
margin-block-end: var(--spacers-dp4);
}

.controlsLarge {
Expand All @@ -44,33 +47,36 @@
display: flex;
overflow-x: auto;
overflow-y: hidden;
padding: var(--spacers-dp4) 0 var(--spacers-dp4) var(--spacers-dp4);
padding-block-start: var(--spacers-dp4);
padding-block-end: var(--spacers-dp4);
padding-inline-start: var(--spacers-dp4);
padding-inline-end: 0;
}

.container.expanded {
display: flex;
flex-direction: column;
overflow: hidden;
padding-top: var(--spacers-dp12);
padding-left: var(--spacers-dp8);
padding-block-start: var(--spacers-dp12);
padding-inline-start: var(--spacers-dp8);
}

.expanded .chipsContainer .controls {
margin-left: var(--spacers-dp4);
margin-right: var(--spacers-dp8);
width: 100%;
margin-inline-start: var(--spacers-dp4);
margin-inline-end: var(--spacers-dp8);
inline-size: 100%;
}

.chipsContainer {
margin-bottom: -4px;
padding-right: 2px;
min-height: 0;
margin-block-end: -4px;
padding-inline-end: 2px;
min-block-size: 0;
}

.expanded .chipsContainer {
overflow-x: hidden;
overflow-y: auto;
padding-right: 6px;
padding-inline-end: 6px;
flex: 1;
}

Expand Down
21 changes: 12 additions & 9 deletions src/components/DashboardsBar/styles/DashboardsBar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,34 @@
flex: none;
display: flex;
flex-direction: column;
height: var(--user-rows-height);
width: 100%;
block-size: var(--user-rows-height);
inline-size: 100%;
z-index: 1;
}

.content {
padding: 10px 6px 0 6px;
padding-block-start: 10px;
padding-block-end: 0;
padding-inline-start: 6px;
padding-inline-end: 6px;
overflow: hidden;
margin-bottom: 21px; /* to make space for the show more button */
margin-block-end: 21px; /* to make space for the show more button */
}

.expanded .content {
overflow-y: auto;
}

.expanded .container {
height: var(--max-rows-height);
block-size: var(--max-rows-height);
z-index: 1999;
}

.spacer {
display: none;
box-sizing: border-box;
flex: none;
height: var(--user-rows-height);
block-size: var(--user-rows-height);
}

@media only screen and (min-width: 481px) {
Expand Down Expand Up @@ -66,21 +69,21 @@

.expanded .spacer {
display: block;
height: var(--min-rows-height);
block-size: var(--min-rows-height);
}
}

/* phone LANDSCAPE MODE or small screen */
@media only screen and (max-height: 480px), only screen and (max-width: 480px) {
.collapsed .container {
height: var(--min-rows-height);
block-size: var(--min-rows-height);
}

.expanded .container {
position: absolute;
display: flex;
flex-direction: column;
height: var(--sm-expanded-controlbar-height);
block-size: var(--sm-expanded-controlbar-height);
}

.expanded .content {
Expand Down
14 changes: 7 additions & 7 deletions src/components/DashboardsBar/styles/DragHandle.module.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.draghandle {
position: absolute;
bottom: 0;
left: 0;
right: 0;
inset-block-end: 0;
inset-inline-start: 0;
inset-inline-end: 0;
cursor: ns-resize;
transition: all ease-out 75ms;
height: 7px;
block-size: 7px;
}

.draghandle:after {
content: '';
position: absolute;
bottom: 0;
height: 3px;
width: 100%;
inset-block-end: 0;
block-size: 3px;
inline-size: 100%;
background: var(--colors-white);
}

Expand Down
Loading
Loading