Commit Graph

129 Commits

Author SHA1 Message Date
geraldglynn
cb2fc2089c improvement: move operation JumpToPath (via #4760) 2018-08-08 14:10:48 -07:00
kyle
87296702c6 feature: allowEmptyValue controls (#4788)
* add baseline tests

* coerce empty strings to null when updating parameter values

* add ParameterIncludeEmpty

* add redux management for empty parameter value inclusion state

* use name+in keying for state management instead of hash keying

* update new redux method usages to name+in keying

* coerce empty Immutable iterables in onChangeWrapper

* OAS3 tests & support

* add included empty parameters to requests before dispatching to Swagger Client

* make empty inclusion interface prettier

* add tests for #4587

* linter fixes

* check for truthy value before reaching into property
2018-08-04 01:26:07 -07:00
Yuanhai He
8cde08bd83 improvement: allow viewing model when Try-It-Out is enabled (via #4723) 2018-07-26 17:47:41 -07:00
Markus Poerschke
875caab173 improvement: prevent loading resources from third party CDN (via #4598)
Remove usage of Google Fonts to avoid any data protection issue. Using a
CDN will leak data to a third party that can be simply avoided by using
system fonts instead.

Furthermore the usage of CDNs can cause legal issues in EU countries.
2018-07-05 21:55:25 -05:00
kyle
a86fcf312a improvement: re-enable and improve Models jump-to-path (#4674) 2018-06-22 21:28:19 -07:00
kyle
a03c12786a feat(rendering): gate rendering based on valid version identifiers (#4614)
* create VersionPragmaFilter component

* use VersionPragmaFilter in BaseLayout

* tighten version idenitifier constraints

* handle case where user specifies a valid `swagger` and `openapi` field

* add traceable class names for each message

* add tests

* linter fixes!

* UNRELATED CHANGE: remove travis short-circuit

* add bypass switch to VersionPragmaFilter
2018-06-01 16:04:27 -07:00
kyle
c1007a287b feature: OAS3 object parameter support (#4563)
* render suitable interface for `type: object` parameters

* validate OAS3 object parameters correctly

* display parameter validation errors

* remove irrelevant css classes

* rm comment

* fix failing tests

* add validateParam tests

* add enzyme tests for object parameter rendering

* run actual tests first
2018-05-16 22:48:44 -07:00
kyle
9a121ea445 fix: attempt to display Blob response bodies as text (#4437)
* fix: attempt to display Blob response bodies as text

... if nothing else works.

* correctly pass `prevProps.content` to updateParsedContent

* remove debugger statement

* caniuse `Blob` && `FileReader`? yes.

Blob: https://caniuse.com/#search=Blob
FileReader: https://caniuse.com/#search=filereader
2018-04-13 16:16:54 -07:00
Giancarlo Klemm Camilo
2795518340 enhance: scrollable + downloadable HighlightCode (#4397)
* Auto hidding content that is longer than 600 characters long.

* Added basic downloading

Slightly broken

* Better downloading

now downloads file on button click

* Fix the angry linter

* Fix dist

* Removed collapsing, added scrolling.

* Code clean up.

* CSS fix.

* prevent HighlightCode from scrolling entire document

* center "Download" text in button

* `this.downloadJSON` -> `this.downloadText`

we're always saving as `.txt`, so JSON is a misnomer

* hide Download button behind option `downloadable` prop

* `file-saver` -> `js-file-download`
2018-04-12 18:18:49 -07:00
kyle
83232dc2d8 v3.12.0 (#4282)
* Use `parameterWithMeta` to get parameter data in <ParameterRow>

* Prefer specPath when fetching resolved subtrees in OperationContainer

* Add test for OAS3 callback rendering

* Remove debugger statement

* Pass base resolution URL directly to Swagger-Client subtree resolver

* Remove accidental comment

* Migrate additional options

* Don't default to empty Map when getting subtree

* fix(validateParam): check for ImList type before using count method

* Use `replaceState` to update `urls.primaryName`

This gives us the stateful URL we want, without:
(a) refreshing the page on update
(b) creating a long, useless history for the user
(c) implying that browser history is two-way bound
    to Swagger-UI (it isn't, we don't have a router)

* Add `fn.opsFilter` docs and internal API versioning note

* restrict `x-example` functionality to Swagger 2.0

* polish Authorize + Close buttons

* add tachyons; use it for padding the new Reset button

* v3.12.0

* rebuild dist
2018-03-02 21:13:00 -08:00
kyle
ba1603a7e2 improve: lazy resolver (#4253)
* default to empty `ImmutableMap` when grabbing op metadata
* pass `errors` into JsonSchema components
* Account for Immutable data structure in JavaScriptonSchema...
...and create empty Lists instead of Maps by default.
* Pass ImmutableList through to JsonSchema child components
* Add lazy resolving spec state extensions
* TEMPORARY: disable conventional resolved spec
* WIP
* Use resolveSubtree in Operation display
* Freebie: short-circuit Markdown component if it is given plaintext
* NEW DEFAULT BEHAVIOR: `defaultModelsExpandDepth: 1` does not expand individual models
* Render faked Model expander to trigger resolution
* Baseline support for Editor lifecycles
* Display operation summaries before the operation is resolved
* Test migrations
* WIP
* Swagger2 TIO Body params
* a bit of cleanup
* Debounce string param inputs
* Reach into unresolved operation for deprecated flag, if available
* Fire subtree request outside of render
* Remove debugging flags
* Fix logical errors in spec statePlugins
* TODOs become TODONEs!
* Migrate deeplinking feature to non-resolved spec action
* ESLint fixes
* Reduce action dispatch volume; run resolver on next tick
* Batch resolver requests; use batch progressive results in later iterations
* Add loading states to Model and Operation views
* Preserve object order; remove dupl. import; add warning for action
* LINTER!
* Use require to load SVG
       Works around Webpack weirdness
2018-02-23 22:25:28 -08:00
kyle
ecf688171f feat: lazy resolver (#4249)
* default to empty `ImmutableMap` when grabbing op metadata
* pass `errors` into JsonSchema components
* Account for Immutable data structure in JavaScriptonSchema...
    ...and create empty Lists instead of Maps by default.
* Pass ImmutableList through to JsonSchema child components
* Add lazy resolving spec state extensions
* TEMPORARY: disable conventional resolved spec
* WIP
* Use resolveSubtree in Operation display
* Freebie: short-circuit Markdown component if it is given plaintext
* NEW DEFAULT BEHAVIOR: `defaultModelsExpandDepth: 1` does not expand individual models
* Render faked Model expander to trigger resolution
* Baseline support for Editor lifecycles
* Display operation summaries before the operation is resolved
* Test migrations
* WIP
* Swagger2 TIO Body params
* a bit of cleanup
* Debounce string param inputs
* Reach into unresolved operation for deprecated flag, if available
* Fire subtree request outside of render
* Remove debugging flags
* Fix logical errors in spec statePlugins
* TODOs become TODONEs!
* Migrate deeplinking feature to non-resolved spec action
* ESLint fixes
2018-02-23 01:12:53 -08:00
kyle
1013d16d9e v3.10.0 (#4210)
* v3.10.0

* Fix Execute styling issue

* Rebuild dist
2018-02-09 20:47:44 -08:00
maryscar
3d7a00c0d0 improve: visibility & accessibility (#4202)
* Increase font weight for property-format

* Increase font weight for model property examples.
2018-02-09 19:34:38 -08:00
kyle
1f44231df9 improve: remove CPU-taxing Execute button animation (#4204) 2018-02-07 21:07:10 -08:00
maryscar
2f236982f8 improve(a11y): visibility accessibility via aria-label (#4127)
* Added aria-label for visual readers.

* Increased font weight for Models section span to meet contrast ratio visibility requirements.
2018-01-25 12:41:26 -08:00
Andrew Luca
e531c40356 fix(styles): stop wrapper from overflowing on smaller devices (#4121)
When using `swagger-ui` for consumption by JavaScript web projects
that include module bundlers, instead of `swagger-ui-dist`
there is no `box-sizing: border-box` on `.wrapper`
and it's width overflows because of additional `padding: 0 20px`
2018-01-19 13:54:01 -06:00
Juan J. Jimenez-Anca
bd41b736a8 feat: display last error when definition/config load fails
Contains a breaking internal API change to `errActions.newThrownErr`, which will require a MINOR version bump. Swagger-Editor does not depend on the old usage style.
2018-01-05 21:45:21 -06:00
jenglish404
71c0742735 Make parameter description styles consistent
Remove .swagger-ui .parameters-col_description p formatting from _table.scss. With this in place, the parameter descriptions are bold and a larger font for request parameters. This is inconsistent with how response values are displayed.
2018-01-05 15:17:22 -08:00
Kyle Shockey
00f4fb3326 Add margin to loading container 2017-12-12 13:25:36 -08:00
Kyle Shockey
0864ca849f Use throbber in Standalone layout; center loading messages and content 2017-12-12 13:07:18 -08:00
Kyle Shockey
99d35e06ca Add max-width to servers select element 2017-12-08 20:18:03 -08:00
Kyle Shockey
ba90c70b34 LESS CSS BUGS 2017-11-30 17:10:25 -08:00
Kyle Shockey
ef3ccd7a23 Move server styles into its own scss file; add a little polish 2017-11-30 17:06:17 -08:00
Kyle Shockey
0997c5e5d4 Remove hardwired "Server" header, make global one prettier 2017-11-30 14:34:01 -08:00
Kyle Shockey
640050e54e Add spacing between done and authorize button 2017-11-23 12:35:00 -06:00
Kyle Shockey
c70e0f8c38 Display object model extensions correctly 2017-11-23 12:28:37 -06:00
Greg Thompson
8ff2d77398 Merge branch 'master' into ft/3052-extensions 2017-11-20 09:48:33 -06:00
Kyle Shockey
e5b2193708 Fix Callback Response markdown styling 2017-11-17 22:59:20 -08:00
kyle
b3a602d3b0 Merge branch 'master' into bug/3897-markdown-table-headings 2017-11-17 20:47:34 -08:00
Greg Thompson
31694d7533 Merge branch 'master' into ft/3052-extensions 2017-11-17 11:00:43 -06:00
Greg Thompson
db1ad02a64 strikethrough for deprecated property name 2017-11-16 13:26:38 -06:00
Hugo Ferrando Seage
3139f3a9d7 Change color of <th>'s border-bottom elements in markdown content 2017-11-14 17:36:06 +01:00
Owen Conti
4b6a89dd53 Fixes #3897 - Change color of <th> elements in markdown content. 2017-11-13 17:29:05 -07:00
Greg Thompson
0d0b3279bb Merge branch 'master' into ft/3052-extensions 2017-11-13 09:29:19 -06:00
Minasokoni
5b6cd88557 removed set width 2017-11-09 12:18:10 -08:00
Greg Thompson
a58cd25f08 Merge branch 'master' into ft/3052-extensions 2017-11-06 09:18:51 -06:00
Greg Thompson
44c422eba3 parameter extensions display 2017-11-06 09:17:30 -06:00
kyle
c3123224d3 Merge branch 'master' into execute-animation-cpu-usage 2017-11-03 16:11:30 -07:00
Stuart Nichols
1a02364c2f Replace color values with variables for easier theming
Replaced all color values with variables in scss files and
added associated variables to _variables.scss file
2017-11-02 11:50:33 +00:00
sserbin
cb274caa1f hinting browser about 'Execute' button animation
in attempt to decrease ridiculously high cpu usage of swagger-ui-pulse animation
2017-10-24 01:55:40 +03:00
Ron
d953b7790d Merge branch 'master' into master 2017-10-20 16:54:03 -07:00
Owen Conti
95002ba6e5 Fixes #3783
Remove extra styles for .renderedMarkdown content.
2017-10-19 14:44:17 -06:00
Race, Dale
4da430c08e Lower select and input button width's on mobile 2017-10-11 09:12:55 -05:00
Race, Dale
499d61161a Decrease summary-path font size on mobile 2017-10-11 09:12:17 -05:00
Race, Dale
8acac155e1 Tweak padding values for topbar to fit mobile 2017-10-11 08:46:19 -05:00
Race, Dale
59188b1bfe Remove min-width from search url input field 2017-10-11 08:45:41 -05:00
Owen Conti
2cd4989c05 Fixes #3646
Fix CSS selector for markdown content inside response component.
2017-10-10 15:54:22 -06:00
Joshua Whatley
14f47654ee Merge branch 'master' into bug/3474 2017-09-21 16:54:54 -07:00
Joshua Whatley
6488cbb649 Merge branch 'master' into bug/3474 2017-09-18 11:27:10 -07:00