GithubHelp home page GithubHelp logo

avniproject / avni-media Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 853 KB

Next.js application to view Media files for an organization

License: GNU General Public License v3.0

JavaScript 2.36% Shell 5.59% Makefile 1.46% TypeScript 86.96% CSS 3.64%
js nextjs npm webapp

avni-media's People

Contributors

1t5j0y avatar balamuruganjeevi avatar brajesh-lab avatar himeshr avatar petmongrels avatar rudresh avatar vinayvenu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

avni-media's Issues

Location filters that are empty can be hidden

On the Image Viewer listing page user should be able to filter image. Image can be filtered on the following parameters:

  • Imagine a location filter on an organisation that has State, District and Taluka. District and Taluka filters are shown by default without any value in the dropdown. It will be better to not show these as the number of levels can be quite high.
  • Address is not getting filtered
    If I select panjab as state them in district only punjab district should be shown

Setup separate config file to be used by PM2 for running node apps

Apps that need pm2 config file

  • avni-media client
  • avni-media server
  • rules-server

Tech tasks

  • For rules-server, ensure that required properties that are given as CLI args are setup in a cong file and used while initializing pm2 env.

  • Configure avni-media-user to be able to have commands executed without this hack in .bashrc files of avni-media-user and ubuntu.

Setup separate config file to be used by PM2 for running avni-media client, server and rules-server apps

  • Configure properties in /etc/media.conf and use that in PM2 using ansible playbook role
  • Use Media-service config.yml to setup PM2 which uses /etc/media.conf to load env variables
  • Setup and deploy media server and client apps to be run using previously setup PM2

Approach

It can be achieving by creating ecosystem.config.js as Jinja 2 template file and adding necessary envs and startup script(app.js) in it, and using the ecosystem.config.js to start the node process

On the Image Viewer page add filtering option

On the Image Viewer listing page user should be able to filter image. Image can be filtered on the following parameters:

  • location hierarchy
  • date range
  • encounter type
  • subject type
  • Program

Dev Notes:
List of action includes -

  • Fetching and listing of available filters
  • Updates to the UI to show the filtered listing

Note: We are filtering based on DB variable, not tags on the images.

prerelease-generate-thumbnails-bulk Lambda doesnot run correctly in prerelease

Describe the bug
prerelease-generate-thumbnails-bulk Lambda doesnot run correctly.

To Reproduce
Steps to reproduce the behavior:
https://ap-south-1.console.aws.amazon.com/lambda/home?region=ap-south-1#/functions/prerelease-generate-thumbnails-bulk?tab=code

  1. Go to 'AWS Lambda console' in browser
  2. Navigate to 'prerelease-generate-thumbnails-bulk' function
  3. Click on 'Test' tab
  4. Invoke Test by clicking on top-right corner

Expected behavior
prerelease-generate-thumbnails-bulk Lambda should run successfully.

Search by media concept

As a media viewer used, I would like to be able to filter images by the image concept name so that I can narrow down the list of images to what I want.

eg: In RWB, I would like to get all the pre and post perspective images alone so that I can use them in a report. Currently, it shows everything for a subject, so I get all daily images when I filter by subject. This is about 60 times the number of images that I would want to see. Filtering by concepts helps me narrow it down significantly.

Tech notes

  • API already has the concept name based search available
  • Existing app shows all concepts. Filtering these by concept datatype will help narrow down to our purpose
  • Visualisation already available for concepts (search based dropdown). This can be used

Ability to select all media

The way Media Viewer is implemented, it is very hard to choose multiple images to download. Here are a few usecases that require bulk download that are missing

  • There are about 30 images to be downloaded, which spans across 2 pages
  • I need to provide a specific image for an entire district for a report

To handle the above scenarios, the following are required

Acceptance criteria

  • Selections should persist across screens when moving previous/next.
  • A "Select All" option should be provided for selecting items within the page.
  • Select All should uncover an option to "Select all pages" (similar to experience in Task Assignment) where the user can choose to download all items upto 1000. Ensure that the number of images from all pages should still be < 1000.
  • Download should download all selected items.
  • Selection of a image with a name say 'abc', selects all the images with the same name 'abc'. This bug needs to be fixed.

Correct logic to apply choices in filters

Typically, every subject is linked to some encounter types, and some programs. Some encounter types are directly related only to the program.

  1. Show programs only when a subject type is chosen. Show only programs associated to that subject type
  2. Show encounter types not related to a program always
  3. Show encounter types related to a program only when that program is selected

Currently everything is shown always, which does not make sense, and can lead to incorrect choices

Concept list incorrect

How to reproduce

  1. Use gpart testing organisation
  2. Select subject type activity
  3. Notice nothing on Concepts

Create documentation and API Contract info

As we have converted ETL to a service and introduced API to be consumed by Media-services, it would be useful in future to have

  • documentation about ETL service changes done as required by Avni-media
  • documentation about media services (HLL along with services used S3, Lambda, ETL, Avni, etc..)
  • API contract of ETL APIs
  • documentation on setup and deployment of ETL service and
  • documentation on setup and deployment of Media services (Media-server and Media-client)

Navigate from image to form where it was filled

Story

It will be useful to get the details of when an image was created so that more details of the image can be figured out

Acceptance criteria

  • A link with "More Info" is provided when opening the image
  • This link takes the user to the Subject Dashboard on the Data Entry Application

Images are incorrect

To reproduce

  1. Use gpart organisation
  2. Select Activity.
  3. Notice that images for Distribution are showing up

Unable to no filter on Subject and its "Registration" form

Describe the bug
In Media-viewer application, RWB org user is reporting that he is not able to see all the images in the rwbngos2023 organization.
Specifically, they want to see images in Subject("work order") "Registration" form.

To Reproduce
Steps to reproduce the behavior:

  1. Login as an RWB org admin user
  2. Go to 'Media Viewer' app in Avni-webapp
  3. There is no option to filter on Subject("work order") and its "Registration" form.

Expected behavior
User has the ability to apply "SubjectType" and "Registration" form filters.

Screenshots
Screenshot 2023-07-14 at 9 35 02 AM

Additional context
This feature is applicable only for organisations which have "HasAnalyticsDB" enabled for them after which ETL has been run atleast once.

Media Viewer app is showing for every orgnisation.

Media Viewer app is showing for every organisation .. It should be show where we want.
for this we need to create flag type thing.
which we can on or off

Only the users authenticated on avni-webapp should be able to access the media viewer application.

Integrate media-viewer application with avni-webapp

Media viewer application will be an independent application. We need to provide the access point of this application from the avni-webapp.

Tasks

  1. Deciding appropriate place on avni-webapp where link to open the media view application will be shown.
  2. Only the users authenticated on avni-webapp should be able to access the media viewer application.
  3. If the user is not logged in or the session has expired, the user would be redirected to the avni-webapp login page.
    3.1. Upon successful login user should be redirected to the media viewer application.

Naming/description of zip files

Add an option to the media viewer page to put description when the user selects and downloads images. Use these description to name the zip file.

Cannot see photos upload using the application

Describe the bug
While testing the Avni digitialization application I uploaded 2 photos today (28th july). I logged on to media viewer using the web portal:-
https://app.avniproject.org/avni-media?orgID=356&username=shivangi@gvamp_uat
but was unable to see these photos

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://app.avniproject.org/avni-media?orgID=356&username=shivangi@gvamp_uat
  2. The photo link which was sent to salesforce were:-
    https://app.avniproject.org/web/media?url=https://s3.ap-south-1.amazonaws.com/prod-user-media/gvamp_uat/9e0ca391-f457-46f0-97d7-187733b8fadb.jpg ; https://app.avniproject.org/web/media?url=https://s3.ap-south-1.amazonaws.com/prod-user-media/gvamp_uat/5a893fed-052b-40b5-9283-b998b99dbccc.jpg

These were viewable when clicked but could not see them on media viewer.

Filtering of Fields is not working properly

Filtering by field (after choosing a subject) is not working

  1. selected subject as "Activity"
  2. Selected field as "Activity Category"
  3. Selected value as "Cleaning" and applied filter. But the photographs did not refresh according to this filter

Tried also with field as "Tola/Mohalla" and gave a text field for it. For that too nothing changed when "Apply Filter" was pressed.

Videos are showing up as broken links

For organisations with videos and other file types, the browser as well as the carousel breaks.

Acceptance criteria

  • For video files, a corresponding icon shows up on the browser
  • For other file types, a File thumbnail shows up
  • These files are downloaded when selected

Show image in new tab

While png images are directly downloadable, others are shown directly on the app. This is inconvenient.

Add the ability to download consistently.
If the above is not possible, then open in a new tab

Filter by media concept

I am not able to see all the images in the rwbngos2023 organization.
Also filtering is not open for all subjects/encounters?
I want to see images in work order registration but I am not able to.
Thank you

Analysis

Workorder registration images are available, but filtering by the image type is missing. Because of this, you are not able to see them in the list.

Story

As a media viewer used, I would like to be able to filter images by the image concept name so that I can narrow down the list of images to what I want.

eg: In RWB, I would like to get all the pre and post perspective images alone so that I can use them in a report. Currently, it shows everything for a subject, so I get all daily images when I filter by subject. This is about 60 times the number of images that I would want to see. Filtering by concepts helps me narrow it down significantly.

Tech notes

  • API already has the concept name based search available
  • Existing app shows all concepts. Filtering these by concept datatype will help narrow down to our purpose
  • Visualisation already available for concepts (search based dropdown). This can be used
  • Add concept name to the name of the image

Alignment of Fields

  1. Use im organisation
  2. Choose Pregnancy
  3. Look at alignment of the Fields dropdown

Feedback

  • Address- Should be able to do multiselect on top level address
  • When a filter has no values, it should not be visible

Add resilience to the bulk thumbnail generation script

Bulk thumbnail creation process fails when an error occurs while creating thumbnail for image.

Task

  • Add necessary checks for making the script fault tolerant. If a thumbnail creation fails then the script should move and try for the next image.

Instant thumbnail lambda runs when thumbnail is created

When any file is added to *-user-media bucket, the lambda to generate a thumbnail instantly is triggered as expected. This includes the adding of the thumbnail file as well. However, the lambda processes the thumbnail file as well and creates a 'thumbnails' file within the thumbnails sub directory.

Expected behaviour:
Lambda should stop executing immediately if it is processing a file within the thumbnails folder.

No way to deselect Field Filter

When a field of a subject is selected for filtering and then when one decides not to use that filter, there is no way to deselect the field filter.
The subject and value filters one can deselect but field filter is not showing that option

  1. Chose Activity Subject
  2. Chose TypeOfImplementation
  3. Chose CFW and it returned nothing.
  4. So wanted to unselect TypeOfImplementation and see all of the Activity photos. But could not do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.