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

Hardcoded reporting urls in home page #1140

Closed
Tracked by #1569
vinayvenu opened this issue Feb 28, 2024 · 9 comments
Closed
Tracked by #1569

Hardcoded reporting urls in home page #1140

vinayvenu opened this issue Feb 28, 2024 · 9 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@vinayvenu
Copy link
Member

vinayvenu commented Feb 28, 2024

The reporting urls are right now hardcoded to the Avni cloud website, and this is a problem when Avni is deployed elsewhere.

Acceptance criteria

  • It should be possible to change the reporting urls through a server configuration so that when the webapp is deployed and configured in an environment, then it shows the corresponding reporting urls
  • We now have three reporting urls that can be configured per environment. Some environments only have one reporting environment. Some have none. We should be able to set up the title and url on these reporting urls. Each reporting url that is configured will show up on the login screen

Tech design (avni-server)

  • Sample configuration in application.properties
avni.reporting.url[0]=Metabase,https://reporting.avniproject.org
avni.reporting.url[0]=Jasper Reports,https://reporting-jasper.avniproject.org
  • Url /config that returns
{
  "reportingSystems: [
    {
      "name": "Metabase",
      "url": "https://reporting.avniproject.org"
    },
    {
      "name": "Jasper Reports",
      "url": "https://reporting-jasper.avniproject.org"
    },
  ]
}
@vinayvenu vinayvenu added the good first issue Good for newcomers label Feb 28, 2024
@vedfordev
Copy link
Contributor

vedfordev commented Mar 3, 2024

@vinayvenu Does it require changes in avni-server code? I fixed web code as per requirement and tested with the mock API call.

@vedfordev vedfordev self-assigned this Mar 3, 2024
vedfordev added a commit to vedfordev/avni-webapp that referenced this issue Mar 3, 2024
@vedfordev vedfordev removed their assignment Mar 4, 2024
@vinayvenu
Copy link
Member Author

Yes

@vedfordev
Copy link
Contributor

@vinayvenu Created below pull requests please check it.
avni-server: avniproject/avni-server#698
avni-webapp: #1151

@petmongrels
Copy link
Contributor

Looks good. Couple of points.

Web app
You can use httpClient.getData instead of fetch
Try to keep all the code within useEffect instead of calling a function and passing a function in that function
Server
Explore how the properties will be over-ridden in a different environment using environment variables like it has it for other properties.
@vedfordev

vedfordev added a commit to vedfordev/avni-server that referenced this issue Mar 7, 2024
vedfordev added a commit to vedfordev/avni-webapp that referenced this issue Mar 7, 2024
@vedfordev
Copy link
Contributor

vedfordev commented Mar 7, 2024

@petmongrels made the above changes. please check it.

use below variable to set value

export OPENCHS_REPORT_SYSTEMS='[{"name":"Metabase Reports","url":"https://reporting.avniproject.org"},{"name":"Jasper Reports","url":"https://reporting-jasper.avniproject.org/jasperserver/login.html"},{"name":"Superset Reports","url":"https://reporting-superset.avniproject.org/login/"}]'

vedfordev added a commit to vedfordev/avni-server that referenced this issue Mar 8, 2024
@petmongrels
Copy link
Contributor

one comment on web-app commit @vedfordev

vedfordev added a commit to vedfordev/avni-webapp that referenced this issue Mar 8, 2024
@vedfordev
Copy link
Contributor

@petmongrels removed function.

@petmongrels
Copy link
Contributor

good to merge now to master

vedfordev added a commit to vedfordev/avni-webapp that referenced this issue Mar 12, 2024
vedfordev added a commit to vedfordev/avni-server that referenced this issue Mar 12, 2024
@vedfordev
Copy link
Contributor

@petmongrels changed the code suggested by you. Can u please check it and merge it?

vinayvenu added a commit to avniproject/avni-infra that referenced this issue May 3, 2024
vinayvenu added a commit to avniproject/avni-infra that referenced this issue May 3, 2024
himeshr added a commit to avniproject/avni-infra that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Done
Development

No branches or pull requests

3 participants