You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by garrensmith <gi...@git.apache.org> on 2016/11/07 13:56:00 UTC
[GitHub] couchdb-fauxton pull request #804: Create polling component
GitHub user garrensmith opened a pull request:
https://github.com/apache/couchdb-fauxton/pull/804
Create polling component
Update active tasks to use the polling component
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/garrensmith/couchdb-fauxton add-polling-component
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-fauxton/pull/804.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #804
----
commit 66781f6801057445a0bb83333c65766d9ada29b8
Author: Garren Smith <ga...@gmail.com>
Date: 2016-11-07T12:17:26Z
Create polling component
Update active tasks to use the polling component
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #804: Create polling component
Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/804#discussion_r86791217
--- Diff: app/addons/activetasks/assets/less/activetasks.less ---
@@ -188,54 +188,47 @@
}
}
-.nav.polling-interval {
- li.nav-header {
- padding: 9px 0px 0px 9px;
- }
- li {
- padding: 0px 15px 3px 9px;
- margin-left: 0px;
-
- input {
- width: 100%;
- }
-
- label span {
- font-weight: bold;
- }
- }
-}
-
-.polling-interval-widget {
- width: 225px;
- margin: 10px 30px 0 0;
- color: #666;
- float: right;
-
- li {
- list-style-type: none;
- }
- .polling-interval-time-label {
- display: inline-block;
- float: right;
- margin-right: 0;
- cursor: default;
- }
- #polling-range {
- width: 225px;
- }
-}
-
-.active-tasks-loading-lines-container {
- width: 355px;
- .active-tasks-loading-lines {
- border: 0;
- position: relative;
- top: 17px;
- float: left;
- padding-left: 20px;
- #line1, #line2, #line3, #line4 {
- background-color: #bbb;
- }
- }
+// .nav.polling-interval {
+// li.nav-header {
+// padding: 9px 0px 0px 9px;
+// }
+// li {
+// padding: 0px 15px 3px 9px;
+// margin-left: 0px;
+//
+// input {
+// width: 100%;
+// }
+//
+// label span {
+// font-weight: bold;
+// }
+// }
+// }
+
+// .polling-interval-widget {
+// width: 225px;
+// margin: 10px 30px 0 0;
+// color: #666;
+// float: right;
+//
+// li {
+// list-style-type: none;
+// }
+// .polling-interval-time-label {
+// display: inline-block;
+// float: right;
+// margin-right: 0;
+// cursor: default;
+// }
+// #polling-range {
+// width: 225px;
+// }
+// }
--- End diff --
I'd recommend removing these lines if they're going to be commented out.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #804: Create polling component
Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/804#discussion_r86811607
--- Diff: app/addons/components/components/polling.js ---
@@ -0,0 +1,130 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+import React from "react";
+import ReactDOM from "react-dom";
+
+let pollIntervalId;
+
+export const clearPollCounter = () => {
+ if (pollIntervalId) {
+ window.clearInterval(pollIntervalId);
+ }
+};
+
+export const resetPollCounter = (time, cb) => {
+ clearPollCounter();
+ pollIntervalId = window.setInterval(cb, time);
+};
+
+const getCountdown = (secsString, units, max, min) => {
+ const secs = parseInt(secsString, 10);
+ if (secs === 0 || secs > max || secs < min) {
+ return 'off';
+ }
+
+ if (secs < 60 && units === 'minute') {
+ return `${secs} seconds`;
+ }
+
+ let displayValue = secs;
+ if (units === "minute") {
--- End diff --
minor but stay consistent with single or double quotes on string comparisons
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #804: Create polling component
Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/804
+1 after my minor comments are discussed/addressed
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #804: Create polling component
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/804
Passed over here https://travis-ci.org/garrensmith/couchdb-fauxton/builds/174136630
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton pull request #804: Create polling component
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith closed the pull request at:
https://github.com/apache/couchdb-fauxton/pull/804
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb-fauxton issue #804: Create polling component
Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/804
Merged
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---