Skip to content

Commit

Permalink
Merge branch 'thebadmonkeydev-add-deprecations-to-connection-fields'
Browse files Browse the repository at this point in the history
  • Loading branch information
gjtorikian committed Mar 4, 2019
2 parents 015e64f + 677e82d commit 29c6caa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
5 changes: 4 additions & 1 deletion lib/graphql-docs/layouts/includes/connections.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
<span id="<%= slugify.(connection[:name]) %>" class="field-name connection-name anchored"><%= connection[:name] %> (<code><a href="<%= base_url %>/<%= connection[:type][:path] %>"><%= connection[:type][:info] %></a></code>)</span>

<div class="description-wrapper">
<%= include.('deprecations.html', item: connection) %>

<%= include.('notices.html', notices: connection[:notices]) %>
<p><%= connection[:description] %></p>

<%= markdownify.(connection[:description]) %>

<% unless connection[:arguments].empty? %>
<%= include.('arguments.html', arguments: connection[:arguments]) %>
Expand Down
6 changes: 6 additions & 0 deletions lib/graphql-docs/layouts/includes/deprecations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<% if item[:is_deprecated] %>
<div class="deprecation-notice <%= classes[:deprecation_notice] %>">
<span class="deprecation-title">Deprecation notice</span>
<%= markdownify.(item[:deprecation_reason]) %>
</div>
<% end %>
18 changes: 6 additions & 12 deletions lib/graphql-docs/layouts/includes/fields.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
<span id="<%= slugify.(field[:name]) %>" class="field-name anchored"><%= field[:name] %> (<code><a href="<%= base_url %>/<%= field[:type][:path] %>"><%= field[:type][:info] %></a></code>)</span>

<div class="description-wrapper">
<% if field[:is_deprecated] %>
<div class="deprecation-notice <%= classes[:deprecation_notice] %>">
<span class="deprecation-title">Deprecation notice</span>
<%= markdownify.(field[:deprecation_reason]) %>
</div>
<% end %>
<%= include.('deprecations.html', item: field) %>

<%= include.('notices.html', notices: field[:notices]) %>
<%= include.('notices.html', notices: field[:notices]) %>

<%= markdownify.(field[:description]) %>

<% unless field[:arguments].empty? %>
<%= include.('arguments.html', arguments: field[:arguments]) %>
<% end %>
<%= markdownify.(field[:description]) %>

<% unless field[:arguments].empty? %>
<%= include.('arguments.html', arguments: field[:arguments]) %>
<% end %>
</div>
</div>

Expand Down
11 changes: 3 additions & 8 deletions lib/graphql-docs/layouts/includes/values.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ <h3 id="fields">Values</h3>
<h4 id="<%= slugify.(value[:name]) %>" class="name anchored"><%= value[:name] %></h4>

<div class="description-wrapper">
<%= include.('notices.html', notices: value[:notices]) %>
<%= include.('deprecations.html', item: value) %>

<% if value[:is_deprecated] %>
<div class="deprecation-notice <%= classes[:deprecation_notice] %>">
<span class="deprecation-title">Deprecation notice</span>
<%= markdownify.(value[:deprecation_reason]) %>
</div>
<% end %>
<%= include.('notices.html', notices: value[:notices]) %>

<p><%= value[:description] %></p>
<%= markdownify.(value[:description]) %>
</div>

<% end %>

0 comments on commit 29c6caa

Please sign in to comment.