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

feat(ui): redesign load data page #19246

Merged
merged 78 commits into from
Aug 14, 2020
Merged

feat(ui): redesign load data page #19246

merged 78 commits into from
Aug 14, 2020

Conversation

alexpaxton
Copy link
Contributor

@alexpaxton alexpaxton commented Aug 6, 2020

Screen Shot 2020-08-13 at 10 23 23 AM
Screen Shot 2020-08-13 at 4 31 14 PM

UX Goals

  • Make it easier for users to see all the ways they can write data
  • Make it easier for users to find the method that works for them (and set it up quickly)

Architecture Notes

This section of the app is essentially a miniature static site. The addition of markdown and image files for all these pages makes this PR seem much larger than it is. The code previously located in src/clientLibraries has been moved and modified to fit the new model.

  • Sources Page
    • Displays list of all data sources organized by category
    • There are 2 categories with unfinished content that are feature flagged off
  • Details template
    • Used to display client libraries, telegraf plugins, and others
    • Renders a markdown file
  • Content definition files
    • One file per category (example: contentClientLibraries)
    • Determines information about the category and what items appear within it
    • Each category has a folder for all the markdown files that relate to it

Build Changes

  • Add support for importing SVG and MD files into react components
  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@alexpaxton
Copy link
Contributor Author

alexpaxton commented Aug 6, 2020

TODO:

  • Convert 1 client library page to markdown format (as an example)
  • Feature flag each section
  • Create placeholder image for items with no image
  • Enable regular image loading (instead of react component images)
  • Bring back tabs
  • Fill in description for Telegraf Inputs
  • Enable substitution in code blocks
  • Handle long lists in resources widget
  • Remove user id
  • Allow creation of tokens
  • Allow creation of buckets
  • dedupe github plugins
  • Remove defunct plugins
  • Instrument copy code button in telegraf code samples

import {sortBy} from 'lodash'

// Contexts
import {WriteDataSearchContext} from 'src/writeData/containers/WriteDataPage'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ITS SPILLING OUT OF NOTEBOOKS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did this to me


const filteredSections = WRITE_DATA_SECTIONS.filter(section => {
const containsMatches = sectionContainsMatchingItems(section, searchTerm)
const featureFlagEnabled = isFlagEnabled(section.featureFlag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fancy

doesItemMatchSearchTerm(item.name, searchTerm)
)

const sortedItems = sortBy(filteredItems, item => item.name.toLowerCase())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filteredItems.sort((a,b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()))

now get that lodash nonsense outta here

import WriteDataIndexView from 'src/writeData/components/WriteDataIndexView'

// Constants
import WRITE_DATA_CLIENT_LIBRARIES_SECTION from 'src/writeData/constants/contentClientLibraries'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how come not wrapped in curly brackets?

import {WriteDataItem, WriteDataSection} from 'src/writeData/constants'

// Markdown
import ArduinoMarkdown from 'src/writeData/components/clientLibraries/Arduino.md'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if only there was a way to self register these to the page.... where have i seen that....

import azure_storage_queueMarkdown from 'src/writeData/components/telegrafPlugins/azure_storage_queue.md'
import bcacheMarkdown from 'src/writeData/components/telegrafPlugins/bcache.md'
import beanstalkdMarkdown from 'src/writeData/components/telegrafPlugins/beanstalkd.md'
import bindMarkdown from 'src/writeData/components/telegrafPlugins/bind.md'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if webpack, could somehow find all of these.. using a folder mechanism....

)
}

@ErrorHandling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should put watts up to teaching us how to add decorators to functional components

@drdelambre
Copy link
Contributor

my favorite part was when there was that block of code hidden in the middle of all of that svg code. like treasure hunting

Copy link
Contributor

@drdelambre drdelambre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. these telegraf plugins should be served by an api that reads from the latest version of telegraf and not defined here to languish and fall out of spec.... but thats for a different PR. the design looks real nice! like it'll work for people and junk.

@alexpaxton alexpaxton merged commit 67857f2 into master Aug 14, 2020
@alexpaxton alexpaxton deleted the feat/write-data-page branch August 14, 2020 21:00
alexpaxton added a commit that referenced this pull request Aug 15, 2020
alexpaxton added a commit that referenced this pull request Aug 15, 2020
alexpaxton added a commit that referenced this pull request Aug 17, 2020
alexpaxton added a commit that referenced this pull request Aug 18, 2020
* Revert "Revert "feat(ui): redesign load data page (#19246)" (#19336)"

This reverts commit 0111f02.

* fix: guard against no tokens or buckets

* fix: typo

* refactor: name sources page titles properly

* fix: avoid referencing image asset inline
Cubone21 pushed a commit that referenced this pull request Aug 25, 2020
* refactor: rename client libraries from overlay to page

* refactor: remove client libraries from load data nav

* refactor: remove client libraries from main nav

* refactor: convert client library overlays to pages

* feat: create Write Data and related sub-pages

* fix: assing proper component to route

* refactor: separate sections of write data page into own files

* refactor: implement telegraf plugins pages

* refactor: rename components to match filenames

* refactor: organize client libraries within writeData folder

* fix: cleanup loose ends from moving files around

* refactor: move client lib graphics into write data section

* fix: correct import path

* fix: import path

* feat: enable importing of markdown files

* feat: use markdown source for example telegraf plugin

* feat: convert Arduino page to use markdown

* fix: properly type svg and markdown imports

* feat: replace react component images with regular images

* feat: add placeholder image for items without images

* fix: cleanup

* feat: start standardizing pages for write data views

* refactor: use params instead making a component for each page

* refactor: make client libraries pages all markdown and use template

* refactor: cleanup

* refactor: move templates out of folder

* refactor: style details view

* feat(ui): add activemq, aerospike, and bcache

* feat(writeData): load up all the telegraf inputs

* feat: add telegraf explainer to telegraf plugins pages

* refactor: make card grid more compact

* refactor: polish

* feat(write): adding logos

* fix(writeData): more logos

* refactor: make CopyButton more customizable

* refactor: add real content to telegraf plugin explainer

* refactor: polish thumbnail appearance

* refactor: make index views scrollable

* feat(write): alphabetize & more logos

* refactor: increase width of token overlay

* refactor: add description to telegraf section

* feat: wrap each section in feature flags

* refactor: WIP helper widgets for details pages

* feat(writeData): add more logos

* feat(writeData): update Plugin names, readmes, add logos

* feat(write): final batch of logos

* feat(write): readme updates

* feat(write): adding proxmox

* refactor: add tabbed navigation back to browse page

* refactor: make code snippets templatized

* fix: replace untemplatized URL key in arduino markdown

* refactor: cleanup

* refactor: rename "browse" to "sources"

* refactor: rename feature flags to match page names

* refactor: make sort case insensitive

* refactor: make code sample helper only appear in client libraries pages

* fix: remove image padding from client library logos

* fix: select first user bucket instead of first any bucket

* fix: make less legible logos more legible

* refactor: make search field autofocus

* fix: linter error

* fix: case sensitive file import

* fix: remove empty prop definitions

* fix: more case sensitive imports

* refactor: remove use of lodash

* fix(writeData): update kapa & tele logos; rename internal plugin

* fix: repair broken explorer test

* fix: rework client libs e2e tests to match new design

* refactor: rename e2e test appropriately

* refactor: rewrite data sources e2e to assert proper rendering of the details views

* feat: add GA tracking of code snippet copy event

* chore: changelog update

Co-authored-by: Russ Savage <[email protected]>
Cubone21 pushed a commit that referenced this pull request Aug 25, 2020
Cubone21 pushed a commit that referenced this pull request Aug 25, 2020
* Revert "Revert "feat(ui): redesign load data page (#19246)" (#19336)"

This reverts commit 0111f02.

* fix: guard against no tokens or buckets

* fix: typo

* refactor: name sources page titles properly

* fix: avoid referencing image asset inline
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.

3 participants