Fix typos
parent
86e404ef3e
commit
8cf89736e5
|
@ -11,7 +11,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
# Dont proceed with login if they need to sign the EULA
|
# Don't proceed with login if they need to sign the EULA
|
||||||
def maybe_halt_login(result)
|
def maybe_halt_login(result)
|
||||||
result.result[:user].try(:require_consent!) if result.success?
|
result.result[:user].try(:require_consent!) if result.success?
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ class DashboardController < ApplicationController
|
||||||
render html: THE_FRONTEND_APP, layout: false
|
render html: THE_FRONTEND_APP, layout: false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Hit by Certbot / Let's Encrypt when its time to verify control of domain.
|
# Hit by Certbot / Let's Encrypt when it's time to verify control of domain.
|
||||||
def lets_encrypt
|
def lets_encrypt
|
||||||
render plain: ACME_SECRET
|
render plain: ACME_SECRET
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ module CeleryScript
|
||||||
# Don't use this on unverified data structures.
|
# Don't use this on unverified data structures.
|
||||||
class JSONClimber
|
class JSONClimber
|
||||||
HASH_ONLY = "Expected a Hash."
|
HASH_ONLY = "Expected a Hash."
|
||||||
NOT_NODE = "Expected hash with atleast a `kind` and `args` prop."
|
NOT_NODE = "Expected hash with at least a `kind` and `args` prop."
|
||||||
|
|
||||||
def self.climb(thing, &callable)
|
def self.climb(thing, &callable)
|
||||||
raise HASH_ONLY unless thing.is_a?(Hash)
|
raise HASH_ONLY unless thing.is_a?(Hash)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Describes the allowed arguments and body types of CeleryScript node.
|
# Describes the allowed arguments and body types of CeleryScript node.
|
||||||
# Eg: Which arguments does it take? Whic nodes can be placed in the body field?
|
# Eg: Which arguments does it take? Which nodes can be placed in the body field?
|
||||||
module CeleryScript
|
module CeleryScript
|
||||||
class NodeSpecification
|
class NodeSpecification
|
||||||
attr_reader :name, :allowed_args, :allowed_body_types
|
attr_reader :name, :allowed_args, :allowed_body_types
|
||||||
|
|
|
@ -24,7 +24,7 @@ module CeleryScript
|
||||||
private
|
private
|
||||||
|
|
||||||
def self.visit_node(node, callable)
|
def self.visit_node(node, callable)
|
||||||
if node.is_a?(AstNode) # Keep recursing if its not a leaf.
|
if node.is_a?(AstNode) # Keep recursing if it's not a leaf.
|
||||||
callable.call(node)
|
callable.call(node)
|
||||||
visit_each_arg(node, callable)
|
visit_each_arg(node, callable)
|
||||||
visit_each_body_item(node, callable)
|
visit_each_body_item(node, callable)
|
||||||
|
|
|
@ -21,7 +21,7 @@ module SequenceMigration
|
||||||
VERSION = "YOU MUST CHANGE THIS!!!"
|
VERSION = "YOU MUST CHANGE THIS!!!"
|
||||||
|
|
||||||
# I shouldn't need to do this, as this method comes with ActiveSupport, but
|
# I shouldn't need to do this, as this method comes with ActiveSupport, but
|
||||||
# its acting weird with autoloading right now :shipit:. TODO: See if there
|
# it's acting weird with autoloading right now :shipit:. TODO: See if there
|
||||||
# is a way to automatically infer all classes
|
# is a way to automatically infer all classes
|
||||||
def self.descendants
|
def self.descendants
|
||||||
[
|
[
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# A regimen takes a SEQUENCES and repeats them over a fixed amount of time slots
|
# A regimen takes a SEQUENCES and repeats them over a fixed amount of time slots
|
||||||
class Regimen < ActiveRecord::Base
|
class Regimen < ActiveRecord::Base
|
||||||
# Regimen gets pluralized strangely by Rails.
|
# Regimen gets pluralized strangely by Rails.
|
||||||
# Ocasionally to "regimans".
|
# Occasionally to "regimans".
|
||||||
# This is the workaround.
|
# This is the workaround.
|
||||||
self.table_name = "regimens"
|
self.table_name = "regimens"
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module FarmEvents
|
module FarmEvents
|
||||||
# Used to calculate next 60ish occurences or so of a FarmEvent.
|
# Used to calculate next 60ish occurrences or so of a FarmEvent.
|
||||||
class GenerateCalendar < Mutations::Command
|
class GenerateCalendar < Mutations::Command
|
||||||
NEVER = FarmEvent::NEVER.to_s
|
NEVER = FarmEvent::NEVER.to_s
|
||||||
TIME = { "minutely" => 60,
|
TIME = { "minutely" => 60,
|
||||||
|
@ -41,7 +41,7 @@ module FarmEvents
|
||||||
return Montrose
|
return Montrose
|
||||||
.every(every, options)
|
.every(every, options)
|
||||||
.take(60)
|
.take(60)
|
||||||
.reject { |x| end_time ? x > (end_time + 1.second) : false } # clear events beyon the end time
|
.reject { |x| end_time ? x > (end_time + 1.second) : false } # clear events beyond the end time
|
||||||
.reject { |x| x <= Time.now } # Clear past events
|
.reject { |x| x <= Time.now } # Clear past events
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ class CSNode
|
||||||
def arg_names
|
def arg_names
|
||||||
allowed_args
|
allowed_args
|
||||||
.map{ |x| ARGS[x] }
|
.map{ |x| ARGS[x] }
|
||||||
.each { |x| raise "NON EXISTANT ARG TYPE" unless x }
|
.each { |x| raise "NON-EXISTENT ARG TYPE" unless x }
|
||||||
.map(&:to_ts)
|
.map(&:to_ts)
|
||||||
.join("")
|
.join("")
|
||||||
end
|
end
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
// var ordered = {};
|
// var ordered = {};
|
||||||
// var fileContent;
|
// var fileContent;
|
||||||
// try {
|
// try {
|
||||||
// //check the file can be openned
|
// //check the file can be opened
|
||||||
// var stats = fs.statSync(langFilePath);
|
// var stats = fs.statSync(langFilePath);
|
||||||
|
|
||||||
// // load the file
|
// // load the file
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
// delete result[key];
|
// delete result[key];
|
||||||
// result[key] = ordered[key];
|
// result[key] = ordered[key];
|
||||||
// }
|
// }
|
||||||
// // if the tag doesnt exist but a translation exists,
|
// // if the tag doesn't exist but a translation exists,
|
||||||
// // put the key/value at the end of the json
|
// // put the key/value at the end of the json
|
||||||
// else {
|
// else {
|
||||||
// unexistingTag[key] = ordered[key];
|
// unexistingTag[key] = ordered[key];
|
||||||
|
|
|
@ -57,7 +57,7 @@ describe CeleryScript::Checker do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'handles wrong leaf types' do
|
it 'handles wrong leaf types' do
|
||||||
hash[:body][0][:args][:location][:args][:x] = "supposed to be a Integer"
|
hash[:body][0][:args][:location][:args][:x] = "supposed to be an Integer"
|
||||||
result = checker.run
|
result = checker.run
|
||||||
expect(result.message).to eq("Expected leaf 'x' within 'coordinate' to"\
|
expect(result.message).to eq("Expected leaf 'x' within 'coordinate' to"\
|
||||||
" be one of: [Integer] but got String")
|
" be one of: [Integer] but got String")
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe Device do
|
||||||
expect(user.device).to be_kind_of(Device)
|
expect(user.device).to be_kind_of(Device)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'destroys dependant devices' do
|
it 'destroys dependent devices' do
|
||||||
bot_id = device.id
|
bot_id = device.id
|
||||||
user_id = user.id
|
user_id = user.id
|
||||||
user.destroy
|
user.destroy
|
||||||
|
|
|
@ -14,7 +14,7 @@ interface AxisStatus {
|
||||||
* If neither of these are enabled, FarmBot can do some pretty dangerous things,
|
* If neither of these are enabled, FarmBot can do some pretty dangerous things,
|
||||||
* such as smashing tools and ramming into tool bays.
|
* such as smashing tools and ramming into tool bays.
|
||||||
*
|
*
|
||||||
* This function returns a 2 dimensional array describing wether or not a particular
|
* This function returns a 2 dimensional array describing whether or not a particular
|
||||||
* axis has at least one of the precautions in place. Useful for checking if it is safe
|
* axis has at least one of the precautions in place. Useful for checking if it is safe
|
||||||
* to proceed with certain actions that could damage the bot.
|
* to proceed with certain actions that could damage the bot.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function timezoneMismatch(botTime: string | undefined,
|
||||||
if (_.isString(botTime) && _.isString(userTime)) {
|
if (_.isString(botTime) && _.isString(userTime)) {
|
||||||
return botTime.toUpperCase() !== userTime.toUpperCase();
|
return botTime.toUpperCase() !== userTime.toUpperCase();
|
||||||
} else {
|
} else {
|
||||||
// Dont show warnings if TZ data is unavailable.
|
// Don't show warnings if TZ data is unavailable.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ import { maybeWarnAboutMissedTasks } from "./util";
|
||||||
import { TzWarning } from "./tz_warning";
|
import { TzWarning } from "./tz_warning";
|
||||||
|
|
||||||
type FormEvent = React.SyntheticEvent<HTMLInputElement>;
|
type FormEvent = React.SyntheticEvent<HTMLInputElement>;
|
||||||
/** Seperate each of the form fields into their own interface. Recombined later
|
/** Separate each of the form fields into their own interface. Recombined later
|
||||||
* on save.
|
* on save.
|
||||||
*/
|
*/
|
||||||
interface FarmEventViewModel {
|
interface FarmEventViewModel {
|
||||||
|
|
|
@ -16,7 +16,7 @@ function getUserLang(langCode = "en_us") {
|
||||||
|
|
||||||
export function detectLanguage() {
|
export function detectLanguage() {
|
||||||
return getUserLang(navigator.language).then(function (lang) {
|
return getUserLang(navigator.language).then(function (lang) {
|
||||||
// TODO: Possiblly requires optimization using Webpack chunking.
|
// TODO: Possibly requires optimization using Webpack chunking.
|
||||||
let langi = require("../public/app-resources/languages/" + lang + ".js");
|
let langi = require("../public/app-resources/languages/" + lang + ".js");
|
||||||
return {
|
return {
|
||||||
nsSeparator: "",
|
nsSeparator: "",
|
||||||
|
|
|
@ -35,14 +35,14 @@ function inferUpdateId(url: string) {
|
||||||
try {
|
try {
|
||||||
let ids = url
|
let ids = url
|
||||||
.split("/")
|
.split("/")
|
||||||
.filter(x => !x.includes(",")) // Dont allow batch endpoints to participate.
|
.filter(x => !x.includes(",")) // Don't allow batch endpoints to participate.
|
||||||
.map(x => parseInt(x, 10))
|
.map(x => parseInt(x, 10))
|
||||||
.filter(x => !_.isNaN(x));
|
.filter(x => !_.isNaN(x));
|
||||||
let id: number | undefined = ids[0];
|
let id: number | undefined = ids[0];
|
||||||
let isNum = _.isNumber(id);
|
let isNum = _.isNumber(id);
|
||||||
let onlyOne = ids.length === 1;
|
let onlyOne = ids.length === 1;
|
||||||
return (isNum && onlyOne) ? ("" + id) : "*";
|
return (isNum && onlyOne) ? ("" + id) : "*";
|
||||||
} catch (error) { // Dont crash- just keep moving along. This is a temp patch.
|
} catch (error) { // Don't crash - just keep moving along. This is a temp patch.
|
||||||
return "*";
|
return "*";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ function prod() {
|
||||||
|
|
||||||
export function configureStore(options = {}) {
|
export function configureStore(options = {}) {
|
||||||
let store: Store = (ENV === "production" ? prod() : dev());
|
let store: Store = (ENV === "production" ? prod() : dev());
|
||||||
// Make store global in in case I need to probe it.
|
// Make store global in case I need to probe it.
|
||||||
(window as any)["store"] = store;
|
(window as any)["store"] = store;
|
||||||
registerSubscribers(store);
|
registerSubscribers(store);
|
||||||
return store;
|
return store;
|
||||||
|
|
|
@ -13,7 +13,7 @@ export function groupRegimenItemsByWeek(weeks: Week[], OFFSET: number,
|
||||||
|
|
||||||
return weeks
|
return weeks
|
||||||
// Collect all of the true/false values in weekX.days. These indicate
|
// Collect all of the true/false values in weekX.days. These indicate
|
||||||
// wether we should add a sequence on that day or not.
|
// whether we should add a sequence on that day or not.
|
||||||
.map((week) =>
|
.map((week) =>
|
||||||
keys.map((key) =>
|
keys.map((key) =>
|
||||||
(week.days as { [day: string]: boolean })[key]))
|
(week.days as { [day: string]: boolean })[key]))
|
||||||
|
@ -29,7 +29,7 @@ export function groupRegimenItemsByWeek(weeks: Week[], OFFSET: number,
|
||||||
// lol, In band signaling.
|
// lol, In band signaling.
|
||||||
});
|
});
|
||||||
})// [[-1, 99999, -1, -1],[.....]]
|
})// [[-1, 99999, -1, -1],[.....]]
|
||||||
// "flatten" the array into a 1d structure (its an array of
|
// "flatten" the array into a 1d structure (it's an array of
|
||||||
// number arrays right now)
|
// number arrays right now)
|
||||||
.reduce((arr, acc) => acc.concat(arr))
|
.reduce((arr, acc) => acc.concat(arr))
|
||||||
// Remove -1 values (days that don't execute a sequence).
|
// Remove -1 values (days that don't execute a sequence).
|
||||||
|
|
|
@ -34,7 +34,7 @@ function remove({ regimen, dispatch }: DeleteButtonProps) {
|
||||||
regimen && dispatch(deleteRegimen(regimen.uuid));
|
regimen && dispatch(deleteRegimen(regimen.uuid));
|
||||||
} else {
|
} else {
|
||||||
// Technically unreachable, but I'll keep TS happy...
|
// Technically unreachable, but I'll keep TS happy...
|
||||||
throw new Error("Tried to delete non-existant regimen");
|
throw new Error("Tried to delete non-existent regimen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,7 @@ export function hasKey<T>(base: (keyof T)[]) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Usefull for calculating uploads and progress bars for Promise.all */
|
/** Useful for calculating uploads and progress bars for Promise.all */
|
||||||
export class Progress {
|
export class Progress {
|
||||||
constructor(public total: number,
|
constructor(public total: number,
|
||||||
public cb: ProgressCallback,
|
public cb: ProgressCallback,
|
||||||
|
|
Loading…
Reference in New Issue