Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Commit

Permalink
New: Added demo page for the inspector page.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodek committed Sep 28, 2017
1 parent 40b4208 commit b8fd084
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 6 deletions.
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"form-action-bar": "advanced-rest-client/form-action-bar#^1.0.4",
"date-time": "advanced-rest-client/date-time#^0.1.2",
"http-method-label": "advanced-rest-client/http-method-label#^0.1.1",
"paper-item": "PolymerElements/paper-item#<2"
"paper-item": "PolymerElements/paper-item#<2",
"paper-toast": "PolymerElements/paper-toast#<2"
},
"devDependencies": {
"iron-component-page": "polymerelements/iron-component-page#1.0.0",
Expand All @@ -61,8 +62,8 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"arc-data-import": "advanced-rest-client/arc-data-import#^0.1.1",
"google-signin": "GoogleWebComponents/google-signin#<2",
"paper-toast": "PolymerElements/paper-toast#<2",
"paper-checkbox": "PolymerElements/paper-checkbox#<2"
"paper-checkbox": "PolymerElements/paper-checkbox#<2",
"arc-demo-helpers": "advanced-rest-client/arc-demo-helpers#^1.0.18"
},
"ignore": [
"**/.*",
Expand Down
113 changes: 113 additions & 0 deletions demo/inspector.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<title>import-panel demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../../arc-demo-helpers/data-generator.html">
<link rel="import" href="../../paper-toast/paper-toast.html">
<link rel="import" href="../import-data-inspector.html">
<style is="custom-style">
html,
body {
background-color: #EEEEEE;
}

.vertical-section-container {
max-width: 1200px;
margin: 24px auto;
}

:root {
--primary-color: #00A2DF;
--accent-color: #FF8A65;
--action-button: {
background-color: var(--primary-color);
color: #fff;
};
--empty-info: {
color: rgba(0, 0, 0, 0.74);
font-size: 16px;
};
--arc-font-headline: {
@apply --paper-font-headline;
};
--arc-font-subhead: {
@apply --paper-font-subhead;
};
--arc-font-body1: {
@apply --paper-font-body1;
};
--arc-font-title: {
@apply --paper-font-title;
}
--paper-progress-active-color: var(--primary-color);
}

section[card] {
padding: 20px;
background: white;
}
</style>
</head>

<body unresolved>
<template is="dom-bind" id="demo">
<div class="vertical-section-container centered">
<section card>
<import-data-inspector data="[[data]]" on-cancel="cancelled" on-import="imported"></import-data-inspector>
</section>
</div>
<paper-toast text="Cancel has been pressed" id="cancelToast"></paper-toast>
<paper-toast text="Import data has been pressed" id="importToast"></paper-toast>
</template>
<script>
/* global DataGenerator */
(function(scope) {
scope.cancelled = function() {
scope.$.cancelToast.opened = true;
};
scope.imported = function() {
scope.$.importToast.opened = true;
};
scope.generate = function() {
var saved = DataGenerator.generateSavedRequestData({
requestsSize: 50,
projectsSize: 3
});
var history = DataGenerator.generateHistoryRequestsData({
requestsSize: 120
});
scope.data = {
kind: 'ARC#import',
createdAt: '2017-09-28T19:43:09.491',
version: '9.14.64.305',
requests: saved.requests,
projects: saved.projects,
history: history,
variables: DataGenerator.generateVariablesData(),
'headers-sets': DataGenerator.generateHeadersSetsData(),
cookies: DataGenerator.generateCookiesData(),
'url-history': DataGenerator.generateUrlsData(),
'websocket-url-history': DataGenerator.generateUrlsData()
};
};
window.addEventListener('WebComponentsReady', function() {
scope.generate();
});
})(document.getElementById('demo'));
</script>
</body>
</html>
3 changes: 1 addition & 2 deletions import-data-inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
`--import-table-list-item` | Mixin applied to data table's items | `{}`
@element import-panel
@demo demo/index.html
@demo demo/index.html
@demo demo/inspector.html Table demo
-->
<dom-module id="import-data-inspector">
<template>
Expand Down
2 changes: 1 addition & 1 deletion import-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
@group UI Elements
@element import-panel
@demo demo/index.html
@demo demo/index.html Main demo
-->
<dom-module id="import-panel">
<template>
Expand Down

0 comments on commit b8fd084

Please sign in to comment.