Skip to content

Commit

Permalink
Document collapsed logo url env
Browse files Browse the repository at this point in the history
  • Loading branch information
ciremusyoka committed May 27, 2024
1 parent c3a0561 commit b64d76e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/src/containers/ConnectedSidebar/tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,16 @@ describe('components/ConnectedSidebar', () => {
expect(collapseLogo?.querySelector('img')?.getAttribute('src')).toEqual(COLLAPSED_LOGO_SRC)

// collapse menu
const collapseIcon = document.querySelector(".collapse-icon")
fireEvent.click(collapseIcon as Element)
fireEvent.click(document.querySelector(".collapse-icon") as Element)
expect(document.querySelector("#main-logo")).not.toBeVisible()
expect(document.querySelector('#collapsed-logo')).toBeVisible()
expect(document.querySelector(".collapse-icon")).not.toBeInTheDocument()

// uncollapse menu
fireEvent.click(document.querySelector('#collapsed-logo') as Element)
expect(document.querySelector("#main-logo")).toBeVisible()
expect(document.querySelector('#collapsed-logo')).not.toBeVisible()
expect(document.querySelector(".collapse-icon")).toBeInTheDocument()
});


Expand Down
1 change: 1 addition & 0 deletions docker/confd_env.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ keys = [
"/react/app/default/plan/duration/days",
"/react/app/date/format",
"/react/app/main/logo/src",
"/react/app/collapsed/logo/src",
"/react/app/plan/assignment/at/geo/level",
"/react/app/task/generation/status",
"/react/app/default/plan/version",
Expand Down
1 change: 1 addition & 0 deletions docker/config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ window._env_ = {
REACT_APP_LANGUAGE_CODE: "{{ getv "/react/app/language/code" "en" }}",
REACT_APP_DATE_FORMAT: "{{ getv "/react/app/date/format" "yyyy-MM-DD" }}",
REACT_APP_MAIN_LOGO_SRC: "{{ getv "/react/app/main/logo/src" "" }}",
REACT_APP_COLLAPSED_LOGO_SRC: "{{ getv "/react/app/collapsed/logo/src" ""}}",
REACT_APP_OPENSRP_OAUTH_SCOPES: "{{ getv "/react/app/opensrp/oauth/scopes" "profile" }}",
REACT_APP_ENABLE_LOCATIONS: "{{ getv "/react/app/enable/locations" "false" }}",
REACT_APP_ENABLE_TEAMS: "{{ getv "/react/app/enable/teams" "false" }}",
Expand Down
6 changes: 6 additions & 0 deletions docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ Below is a list of currently supported environment variables:
- **Optional**(`string`)
- default: `https://github.com/OpenSRP/web/raw/master/app/src/assets/images/opensrp-logo-color.png`

- **REACT_APP_COLLAPSED_LOGO_SRC**

- Configures the collapsed menu logo src url.
- **Optional**(`string`)
- default: `https://github.com/OpenSRP/web/raw/master/app/src/assets/images/opensrp2-logo-small.png`

- **REACT_APP_SUPPORTED_LANGUAGES**

- Use alongside the language switcher, customize the options available for language switching.
Expand Down

0 comments on commit b64d76e

Please sign in to comment.