Skip to content

Dashboard needs a state for owner that has not connected API to proxy #1763

@bajiat

Description

@bajiat
  1. Visit https://nightly.apinf.io (or current develop branch)
  2. Sign up (a non-admin user)
  3. Add an API (do not add a Proxy Backend)
  4. Go to Dashboard

Expected results

  • Dashboard should inform user that they need to connect API to a proxy in order to see anything on Dashboard.
  • console should contain no errors
    • getElasticSearchData should not be called

Observed result

Anonymous user

  • Dashboard displays 'You don't have any API you manage

Non-admin user

  • Dashboard shows empty charts and empty Select API list.
  • There is also a long console error from Elastic Search
Object { stack: "Meteor.makeErrorType/errorClass@htt…", error: "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[73kkJjeUTGy5qRZSFB6xHw][api-umbrella][0]: SearchParseException[[api-umbrella][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"query":{"bool":{"should":[[]]}},"filter":{"range":{"request_at":{"gte":1473664331176,"lte":1476256331177}}}}},"sort":[{"request_at":{"order":"desc"}}],"fields":["request_at","response_status","response_time","request_ip_country","request_ip","request_path","user_id"]}]]]; nested: QueryParsingException[[api-umbrella] [_na] query malformed, must start with start_object]; }{[73kkJjeUTGy5qRZSFB6xHw][api-umbrella-logs-v1-2016-02][0]: SearchParseException[[api-umbrella-logs-v1-2016-02][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"query":{"bool":{"should":[[]]}},"filter":{"range":{"request_at":{"gte":1473664331176,"lte":1476256331177}}}}},"sort":[{"request_at":{"order":"desc"}}],"fields":["request"[…], reason: undefined, details: undefined, message: "[SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[73kkJjeUTGy5qRZSFB6xHw][api-umbrella][0]: SearchParseException[[api-umbrella][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"query":{"bool":{"should":[[]]}},"filter":{"range":{"request_at":{"gte":1473664331176,"lte":1476256331177}}}}},"sort":[{"request_at":{"order":"desc"}}],"fields":["request_at","response_status","response_time","request_ip_country","request_ip","request_path","user_id"]}]]]; nested: QueryParsingException[[api-umbrella] [_na] query malformed, must start with start_object]; }{[73kkJjeUTGy5qRZSFB6xHw][api-umbrella-logs-v1-2016-02][0]: SearchParseException[[api-umbrella-logs-v1-2016-02][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"filtered":{"query":{"bool":{"should":[[]]}},"filter":{"range":{"request_at":{"gte":1473664331176,"lte":1476256331177}}}}},"sort":[{"request_at":{"order":"desc"}}],"fields":["reques"[], errorType: "Meteor.Error" }

Screenshots

See the console log for anonymous users. In effect, anonymous users should probably be redirected to register/login.

Anonymous user visiting Dashboard

screenshot_20161012_131951

Non-admin user with no APIs

A new user, with no APIs. The correct message is visible, but there is a console error.

screenshot_20161012_132604

Non-admin user with one (or more) API(s)

Here is a regular user with one API. Note:

  • the Select API(s) dropdown is empty
  • Dashboard charts render
    • no results in charts
  • console error from getElasticSearchData

screenshot_20161012_132815

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions