Git Product home page Git Product logo

moja-global / flint-ui Goto Github PK

View Code? Open in Web Editor NEW
50.0 11.0 89.0 6.72 MB

A experimental FLINT client, written in Vue, to provide an awesome user interface for configuring simulations using the FLINT.Cloud APIs.

Home Page: flint-ui.vercel.app

License: Mozilla Public License 2.0

Dockerfile 0.44% JavaScript 28.84% HTML 0.49% Vue 69.16% CSS 0.32% Shell 0.75%
flint-ui flint-cloud vuejs docker flint moja-global experimental

flint-ui's People

Contributors

abhilipsasahoo03 avatar akshit42-hue avatar aornugent avatar crystalsage avatar dependabot[bot] avatar frozensamurai avatar harshcasper avatar iamrajiv avatar janvi-thakkar avatar kamalbuilds avatar padmajabhol avatar palaksharma23 avatar ramgoel avatar rishabhraghwendra18 avatar sambhavgupta0705 avatar sanjaysinghrajpoot avatar shloka-gupta avatar shubhamkarande13 avatar sohamsshah avatar suhaasya avatar sukriti-sood avatar tdallas37 avatar thisiskaransgit avatar timonwa avatar void-hr avatar waridrox avatar yashkandalkar avatar yashsehgal avatar zaidkhan144 avatar zinovik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flint-ui's Issues

DOCS: Document the process for deploying FLINT-UI on a free-tier EC2

This process involves few basic steps:

  • Writing scripts to setup necessary tooling on a fresh instance (Docker, Compose, Git and more)
  • Setup FLINT-UI on the instance by following all the steps outlined on README
  • Expose the running application publicly to run basic workloads
  • Have a nice CI/CD setup to pull latest changes from GitHub, build the Docker container once again

Improve application state management to handle multiple jobs

Currently application state is set in individual components, but this becomes tricky to manage when accessing data across multiple components (e.g. #5).

Soon we will also be adding job management to the GCBM using the Create -> Upload -> Run -> Review workflow, where the configuration and outputs occur in different parts of our application.

Therefore we need an improved state management framework. I recommend Vuex but welcome other design considerations.
https://vuex.vuejs.org/guide/state.html#single-state-tree

Documentation: Update Installation Doc on Sphinx

What is the current documentation state?

Currently, there is no installation documentation on the Sphinx website.

Where is this stated?

We can have an installation.rst file and link it to the index.rst to have it centrally on the website.

Why do you want to improve the statement?

No response

Proposed Statement

We can just copy the instructions on the README.md file and copy that to a Sphinx file.

Additional context.

No response

Storybook not working

Describe the bug
Storybook doesn't work. Also I don't know why is it in the default docker compose file. We should have a different docker compose file for running Storybook with the FLINT UI.

To Reproduce
Steps to reproduce the behavior:

Run docker-compose up --build from the FLINT-UI directory.

Expected behavior
Storybook should work.

Screenshots
Please check the comments.
CC: @waridrox

GCBM workflow and wireframe

The core steps of the GCBM workflow

This issue helps to keep everyone on the same page about what parts of the Flint UI-GCBM we are currently planning on improving/developing.

Please note that:

  1. FLINT-UI is a community-driven project and all contributions towards improving the FLINT-UI are welcome.
  2. If you feel stuck, chat with us on Slack.
  3. The document linked below is updated from time to time.

The GCBM workflow usually consists of the following steps-

Outside the UI

  1. Define your local domain of interest (ie. where is the simulation taking place.)
  2. Choose the model you want to run (i.e. which GCBM modules do you want to include)
  3. Create the input files such as growth rates, disturbances etc.

Inside the UI

  1. Configure the local domain
  2. Configure the variables to accept your input files
  3. Review the starting points for each pool
  4. Set the spin up parameters for each pool
  5. Optionally, review the advanced settings

Dispatched to FLINTcloud

  1. Run the simulation

Outside the UI

  1. Review the results

We’re currently focusing on developing steps 4 to 8 in the UI. This document further expands those steps.
You can know about the rest of the steps in detail with the help of the documentation and videos focused on the GCBM.

Wireframe

This is a very rough sketch of how this might work is presented at https://wireframe.cc/rLPTTX

Configure simulation run duration

All FLINT simulations are temporally explicit (i.e. have a time component). Every run needs to be configured with a start and and end date. Vue Material has a simple date picker component, but it'd be especially helpful if we can also summarise the number of simulation years using moment.js or a similar library - I always recommend using standard logic where dates are concerned πŸ˜…

https://vuematerial.io/components/datepicker/
https://momentjs.com/docs/#/displaying/difference/

Connect GCP with FLINT UI for GCM sample runs

I am trying sample GCBM runs locally. I have hosted FLINT.Cloud on GCP using Terraform script and got ingress URL as this https://fc-ingress-4gtzbngbgq-uc.a.run.app/. So now in FLINT-UI (Vue app) we are using the docker container of GCBM to run the simulations with http://localhost:8081/ URL. So I replaced http://localhost:8081/ to https://fc-ingress-4gtzbngbgq-uc.a.run.app/ all over the FLINT-UI codebase thought it will work and we will be able to simulate with GCP as backend but it is not working showing network error. So help is needed here.

Fix the 'Table of contents' section in the README.

The current 'Table of contents' section doesn't match and link correctly with the contents of the README.

To do:

  1. Claim this issue: Comment below to claim this issue.

  2. You can go through this tutorial if you aren't familiar with working around with Github.

  3. Fix the 'Table of contents' section in the README file

  4. Commit your changes and create a Pull Request.

If you feel stuck or would like to ask questions/have a discussion you can reach out to us on Slack or comment your doubt under this issue itself.

Feature Request: update the landing page of Flint UI according to the new design

Is your feature request related to a problem? Please describe.

The current landing page of Flint UI is not in accordance with the new design.

There are some things that needs to be changed:

  • The font currently being applied is Roboto but should me DM Sans.
  • The landing banner is not of the correct height (has more padding than needed),
  • The landing text is not of the correct size
  • The font color and line height in the 3 LandingPageCard components are not according to the new design.
  • The Button component created in this PR can be used instead of the current "Explore" button (router link).

Describe the solution you'd like.

Most of the issues require some style changes, and the Button component can be imported in LandingPageCard.vue and used for redirecting to the appropriate link (with a new onClick method)

Describe alternatives you've considered

Additional context.

Current UI of landing page:
image

UI after making changes:
image

Similar changes can be made to the banner to match the new design.

Publishing Docker images to GitHub container registry using continuous integration (CI) workflow

Description

As of now, moja global docker images are put in Docker Hub by different people with their accounts so it's hard to have control over that. Also, there are no Continuous integration workflows set up in the repository so the images are not able to update when there is a new release in the project.

To overcome this problem let's have a consistent platform to put our docker images. I would just let's publish the docker images to the GitHub container registry. Also, we will add Continuous integration workflows to make the docker images updated.

GitHub container registry is a part of GitHub Packages. It is a software package hosting service that allows you to host your software packages privately or publicly and use packages as dependencies in your projects.

To automate the task we will need two Github Action i.e. docker-image.yaml which will build a docker image to deploy, run, or push to a registry, and docker-publish.yaml which will build, test, and push docker image to GitHub container registry.

These two actions will run whenever there is a push to the main or master branch or we can also set a cron job to run these two actions.

Create `Button` Component

Is your feature request related to a problem? Please describe.

As per the new design updates, we want to update our Button Component across the project.

Describe the solution you'd like.

We want a new Button Component which is like:
Normal State:
image

Hover State:
image

Describe alternatives you've considered

The new Button shall go in the flint.ui/src/components/Button/Button.vue (create the component in this path). Refer src/stories/Button.vue component for more insights. Refer above given design for developing the component.

Additional context.

Make sure the Button Component is:

  • With required extensible props (eg. isDisabled, size, color etc.)
  • Proper Hover state and transition effect on hover
  • Tested with different props and on different pages.

Feel Free to ask questions or curiosities around its implementation.

Bug: Configuration is not running properly.

Describe the bug.

Configuration is not running properly.
Date / Time is also not formatte
Screenshot

visualize

Describe the steps to reproduce the behavior.

No response

Expected behavior.

No response

Screenshots.

No response

Operating Environment

Linux

Additional Information

No response

Improve developer notes.

The current notes assume that a person willing to contribute is experienced.

This issue aims at:

  1. Shifting contents of Developer Notes to a file and referencing it in the README.
  2. Making the developer notes beginner-friendly so that even a person who isn't as experienced finds it easy to contribute.

Put simulation location on a map

Most spatially explicit models (Chapman Richards, GCBM) have coordinates. It'd be nice to give users a sense of place when they're running their models. VueLayers looks like a nice framework for this feature.

The very simplest test we can try is to add a Latitude and Longitude to the Point example endpoint and let users choose where their simuation takes place: https://vuelayers.github.io/#/docs/component/point-geom

Restructure the README.

To do: Update the README file.

In order to work on this issue:

  1. Claim this issue: Comment below to claim this issue.

  2. You can go through this tutorial if you aren't familiar with working around with Github.

  3. Restructure the README file as follows:

  • Table of Contents:
  • About Project.
  • Built with.
  • Getting started.
    • Prerequisites.
    • Installation.
  • Developer notes.
  • How to Get Involved?
  • Contributors
  • Maintainers Reviewers Ambassadors Coaches.
  • License

You can use this template for reference.

  1. Commit your changes and create a Pull Request.

If you feel stuck or would like to ask questions/have a discussion you can reach out to us on Slack or comment your doubt under this issue itself.

Modify the 'Developer's notes' in the Readme.

Reason for this issue: The developer Notes have been listed in multiple places and make the README heavy. This may make the README light weighted.

To do: Update the README file.

To work on this issue:

  1. Claim this issue: Comment below to claim this issue.

  2. You can go through this tutorial if you aren't familiar with working around with Github.

  3. Modify the 'Developers notes' section in README file as follows:

  • Remove lines 133 to 233.
  • Modify line 132.
- Developer Notes
+ Contributing
  • Once you've removed the line from 133 to 233 add this from line number 133 onwards.
+ To contribute to FLINT-UI:
+ 1) Go through our contributing guidelines over [here.](https://github.com/moja-global/About_moja_global/tree/master/Contributing#community-contributions)
+ 2) Go through the Development Notes [here.](https://github.com/moja-global/FLINT-UI/blob/master/docs/DevelopmentGuide/DevelopmentNotes.rst).
  1. Commit your changes and create a Pull Request.

If you feel stuck or would like to ask questions/have a discussion you can reach out to us on Slack or comment your doubt under this issue itself.

Feature Request: Add the Button component in storybook.

Is your feature request related to a problem? Please describe.

Currently the Button visible in storybook is an example story added when first StoryBook.js was added to the repo (#32). This file can be replaced with the Button component that was created for the new design.

Describe the solution you'd like.

We can replace stories/Button.stories.js with stories/Button/Button.stories.js, which is the button we will be using for the new design.

Describe alternatives you've considered

Additional context.

There may be some changes required before the Button component is properly visible on storybook (run yarn storybook to check if the Button component is properly rendered with different props in storybook).

Create `Accordion` Component

Is your feature request related to a problem? Please describe.

As per new design, Accordion component is included at multiple places. In general, accordion component is a component that has title text, and on clicking the button; it can be expanded where some descriptive text can be seen. Can refer to different design libraries like chakra/bootstrap etc. for its implementation (props, etc.) eg. see this

Describe the solution you'd like.

Create Accordion component similar to:
image

Describe alternatives you've considered

Create this new component in flint.ui/src/components folder.

Additional context.

Make sure that:

  • Use Tailwindcss utility classes
  • Proper Props and Implementation
  • Test the component by seeing the working at different places where this is used

Feel Free to ask questions or curiosities around its implementation.

Use `yarn` instead of `npm`

There are several benefits in using yarn over npm, most notably:

  • Yarn strongly binds package versions
  • Yarn can install packages from a local cache, not requiring network config
  • Yarn installs packages in parallel, greatly improving performance
  • Monorepo support (multiple packages) without the requirement for Lerna

Remove the Sidebar

Currently, we are motivated to restructure the FLINT-UI.
This issue is a piece of the puzzle.

Todo:

Comment out/Remove the Sidebar from the UI.

image

Numeric configuration values are not type-safe

@shubhamkarande13 discovered that JS is lazy and treats floats with no decimal place as integers (i.e. 0.0 = 0). The FLINT does not like this and, worse, uses a mixture of integers and floats in it's configuration.

Currently the solution is to wrap all floats with special characters ($$) but this is undocumented and might be difficult to manage as our application grows in complexity. Alternative solutions are welcomed.

Configure GitHub actions for CI and E2E testing

Now that we've got some basic features down we don't want to lose them (e.g. #3). It'd be nice to have automated end-to-end testing that, at minimum:

  1. Builds the local containers from the flint.cloud sub-module, using the latest FLINT.example image
  2. Builds the UI application
  3. Confirms the latest endpoints are compatible with the UI application

Any means to further test the UI functionality would also be fantastic (e.g. modifying the default config to alternative values and validating the response).

Feature Request: Integrate Hadolint for Docker linting

Is your feature request related to a problem? Please describe.

Hadolint is a tool for linting Dockerfiles. To know more about it, visit here: https://github.com/hadolint/hadolint

We would like to integrate Dockerfile linting as part of our CI pipeline to discover static issues and resolve them.

Describe the solution you'd like.

Use the Hadolint action, referenced here: https://github.com/marketplace/actions/hadolint-action

Add it to main.yml and configure it to run with flint.ui/Dockerfile.

Describe alternatives you've considered

No response

Additional context.

No response

CI build failing

#44 uncovered an dependency incompatibility that was not resolved before merge, meaning our CI pipeline does not currently build.

@shubhamkarande13 - can you please post the error message here? Let's try to find a solution!

Bug: Point & RothC output tables don't load initially

The bug: After running the Point or RothC simlation, the Point & RothC output tables do not load in the first time. We need to go to some other page (for example: the Dashboard) and then come back to Output tables, and then the table loads.

Expected behavior: The table should load up in the first try itself.

2021-10-08.01-05-47.mp4

Create `Date Picker` Component

Is your feature request related to a problem? Please describe.

Currently, the date-picker component looks like:
image

Describe the solution you'd like.

We are aiming for this component design as per latest design update for flint.ui
image

Describe alternatives you've considered

Create this component in the flint.ui/src/components/. You can take reference from other components available in the folder. (don't delete any other component files)

Additional context.

Make sure that:

  • Use Tailwindcss utility classes
  • Proper Props and Implementation
  • Test the component by seeing the working at different places where this is used

Feel Free to ask questions or curiosities around its implementation.

Refactor Vuex mutations for Point example

@shubhamkarande13 and I discussed generalising the mutations for the Point example in #17

One solution might be to define a generic function that accepts a pool index (e.g. 1, 2, 3) or a name (e.g. "Pool 3") as well as the value to be set. Then we can call this mutation three times to set each value, rather than having one mutation for each pool.

Goal: Do Not Repeat Yourself (the DRY principle)

User Feedback: better labels for RothC

Describe what you are trying to do and why it is not optimal.

We have some early documentation for RothC here, with a link to a more comprehensive user guide. We should improve the documentation of the model and improve it's presentation in our UI.

This can be achieved by adding correct labels for UI components related to the presentation, input or review of different datasets and carbon pools:

https://github.com/moja-global/Google.Season.of.Documentation/blob/master/modules-development/rothc-soil-carbon-module.md

Describe the solution you'd like.

image

Describe alternatives you've considered.

No response

Additional context.

No response

Feature Request: Create core E2E for the FLINT-UI project

Is your feature request related to a problem? Please describe.

As of now, the project lacks any core E2E testing. We would need a consistent E2E testing strategy to test our features over CI before rolling it out in the production.

Describe the solution you'd like.

We would like it to use Cypress. The contributor who is planning on doing it should plan the core features that need to be tested, identify the user story and integrate this with the CI.

Describe alternatives you've considered

No response

Additional context.

This issue can be kept open for contributors participating with Moja global on behalf of student-run open-source programs.

Uploading unsupported mime type files from the browser

The params for uploading file types in the GCBM runs requires specific file types to be uploaded that are unsupported via the MIME standards in the browser. Some of these are .db, .cfg, .conf etc. Here's the list for the supported file types in the browser - https://www.iana.org/assignments/media-types/media-types.xhtml

This is how the file types are getting referenced in the file uploader -

accepted-file-types="image/tiff, image/x-tiff, application/json, application/x-geotiff, application/gml+xml, application/x-wms, text/xml, "

The closest thing that may be possible now is the .zip file type which would be sent to the upload route and unzipped there...

CC: @aornugent @shubhamkarande13 @HarshCasper

Feature Request: Track input layers in Vuex

Is your feature request related to a problem? Please describe.

Users should be able to review the metadata and associated config templates for all uploaded data.

Describe the solution you'd like.

In order to keep track of the current application state, we can load the names of uploaded files into a layers array in the Vuex store using Dropzones getAcceptedFiles method.

Because we upload multiple layers (like in the GCBM Demo Run), we can store them as an array using this pattern: https://stackoverflow.com/questions/56748999/how-to-add-new-values-to-an-array-object-using-vuex/56749448#56749448

We want to synchronise the Vuex store and FLINTcloud state after every successful upload, for example here:

Describe alternatives you've considered

None, suggestions welcome.

Additional context.

Post-processing of uploaded files will likely be handled in FLINTcloud using Python. This might including updating JSON templates to configure the simulation to accept the input files. The config templates themselves probably don't need to be stored in the UI, but a user will likely want to retrieve the config. for a given upload to edit or review.

Create `Range Slider` Component

Is your feature request related to a problem? Please describe.

According to the new design update, we are aiming to develop an updated version for Slider Component.
Currently our slider component looks something like:

image

Describe the solution you'd like.

We want to create new component like this (with tailwind css):
image

Describe alternatives you've considered

The current slider component lies in flint.ui/src/components/Sliders. The new Slider Component should be added in this folder (no need to delete other component files.) Test this by updating the views on /flint/configurations/point etc. routes to ensure working of the component.

Additional context.

Make sure the component:

  • Uses Tailwind CSS utility classes (feel free to update tailwind.config.js file to extend new theme if needed(
  • Is accessible and without any logical errors
  • Thoroughly tested on different routes where the older Slider Component was used

Feel Free to ask questions or curiosities around its implementation.

Add Moja Global Logo on the Landing Page Navbar

Is your feature request related to a problem? Please describe.

Currently, the landing page looks like this:
image

We want to replace brand-text in the navbar with moja-global logo.

Describe the solution you'd like.

Add the Logo in the navbar.

Describe alternatives you've considered

N/A

Additional context.

Make sure we implement this such that:

  • The Logo doesn't break the UI on responsive behavior
  • Use static assets like images from the /assets folder.
  • Also, to make it accessible by adding corresponding alt text.
  • Add height and width to make it performant.

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.