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

Add Service Configuration of Layout and Services from the Backend #30

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

irushavm
Copy link
Member

@irushavm irushavm commented Aug 6, 2019

Issue/Feature Request: #21

Objective

In order to abstract away changes to service configuration and layout fro the client side. Models and views were made in the backed when you can edit and set the layout and service configuration for the dashboard.

template structure of config:

# Every row in an array corresponds to either a row or column. If the `h` field is 1, it is organized by columns. Conversely, if `w` fields is 1, it is organized by columns. The `tile` field will have the name of the tile as well as configuration values (timeouts, account to track, etc.)
  [
      {
        "w": 0.5,
        "h": 1,
        "layout": [
          {
            "w": 1,
            "h": 0.5,
            "tile": {
              "name": "sample1",
              "config": {
                "timeout": "1H",
              }
            }
          },
          {
            "w": 1,
            "h": 0.5,
            "tile": {
              "name": "sample2",
              "config": {
                "timeout": "15M",
              }
            }
          }
        ]
      },
      {
        "w": 0.5,
        "h": 1,
        "layout": [
          {
            "w": 1,
            "h": 0.4,
            "tile": {
              "name": "sample3"
            }
          },
          {
            "w": 1,
            "h": 0.6,
            "tile": {
              "name": "sample4",
              "config": {
                "timeout": "4H",
              }
            }
          }
        ]
      }
  ]

Changes

** Backend **

  • Add picture of dashboard in Readme
  • Add makemigrations step in Makefile for running dev server
  • Create ServiceConfig model and Serializer. Expose it in the Admin portal
  • Add ServiceConfig API endpoint to Get the current config.
  • Add DashboardConfig view that pre-populates the config template with JSON
  • Ability to edit and update JSON in config view
  • Basic client-side validation to make sure no JSON formatting errors are present
    ** Frontend **
  • Remove Layout and service JSOn information from App.config .js
  • Add Redux actions GET_CONFIG_SUCCESS and GET_CONFIG_FAILURE to be executed after the User login action has completed
  • Add getConfig userService function to get the configuration
  • Edit Dashboard.jsx to fetch datasources for tiles based on the config passed in
  • Remove references to App.config.js in services and pass in from config file

Areas of Effect

  • Backend - Auth
  • Backend - UI
  • Backend - Data
  • Backend - Other
  • Frontend - UI
  • Frontend - Auth
  • Frontend - Data
  • Frontend - User Flow
  • Frontend - Other

Testing

  • Acceptance testing to ensure that all the configuration is loaded from server-side
  • Basic URL resolve testing in Django

@irushavm irushavm self-assigned this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant