mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Applied arrow-parens linting rule
This commit is contained in:
@@ -18,7 +18,11 @@ function setInlineStyles(svg, target, emptySvgDeclarationComputed) {
|
||||
function explicitlySetStyle(element, targetEl) {
|
||||
const cSSStyleDeclarationComputed = getComputedStyle(element);
|
||||
let computedStyleStr = '';
|
||||
<<<<<<< f5ae864fa293b70db13c64d519ec9f261bad4ddd
|
||||
each(cSSStyleDeclarationComputed, key => {
|
||||
=======
|
||||
_.each(cSSStyleDeclarationComputed, (key) => {
|
||||
>>>>>>> Applied arrow-parens linting rule
|
||||
const value = cSSStyleDeclarationComputed.getPropertyValue(key);
|
||||
if (value !== emptySvgDeclarationComputed.getPropertyValue(key) && !cssSkipValues[value]) {
|
||||
computedStyleStr += `${key}:${value};`;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { fromJS, List as makeList } from 'immutable';
|
||||
|
||||
export function getNetworkNodes(nodes) {
|
||||
const networks = {};
|
||||
nodes.forEach(node => (node.get('networks') || makeList()).forEach(n => {
|
||||
nodes.forEach(node => (node.get('networks') || makeList()).forEach((n) => {
|
||||
const networkId = n.get('id');
|
||||
networks[networkId] = (networks[networkId] || []).concat([node.get('id')]);
|
||||
}));
|
||||
|
||||
@@ -132,7 +132,7 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) {
|
||||
|
||||
// metadata
|
||||
if (node.get('metadata')) {
|
||||
node.get('metadata').forEach(field => {
|
||||
node.get('metadata').forEach((field) => {
|
||||
const keyPath = [nodeId, 'metadata', field.get('id')];
|
||||
nodeMatches = findNodeMatch(nodeMatches, keyPath, field.get('value'),
|
||||
query, prefix, field.get('label'), field.get('truncate'));
|
||||
@@ -141,7 +141,7 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) {
|
||||
|
||||
// parents and relatives
|
||||
if (node.get('parents')) {
|
||||
node.get('parents').forEach(parent => {
|
||||
node.get('parents').forEach((parent) => {
|
||||
const keyPath = [nodeId, 'parents', parent.get('id')];
|
||||
nodeMatches = findNodeMatch(nodeMatches, keyPath, parent.get('label'),
|
||||
query, prefix, parent.get('topologyId'));
|
||||
@@ -153,7 +153,7 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) {
|
||||
if (tables) {
|
||||
tables.forEach((table) => {
|
||||
if (table.get('rows')) {
|
||||
table.get('rows').forEach(field => {
|
||||
table.get('rows').forEach((field) => {
|
||||
const keyPath = [nodeId, 'tables', field.get('id')];
|
||||
nodeMatches = findNodeMatch(nodeMatches, keyPath, field.get('value'),
|
||||
query, prefix, field.get('label'));
|
||||
@@ -164,7 +164,7 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) {
|
||||
} else if (metric) {
|
||||
const metrics = node.get('metrics');
|
||||
if (metrics) {
|
||||
metrics.forEach(field => {
|
||||
metrics.forEach((field) => {
|
||||
const keyPath = [nodeId, 'metrics', field.get('id')];
|
||||
nodeMatches = findNodeMatchMetric(nodeMatches, keyPath, field.get('value'),
|
||||
field.get('label'), metric, comp, value);
|
||||
@@ -291,7 +291,7 @@ export function applyPinnedSearches(state) {
|
||||
|
||||
const pinnedSearches = state.get('pinnedSearches');
|
||||
if (pinnedSearches.size > 0) {
|
||||
state.get('pinnedSearches').forEach(query => {
|
||||
state.get('pinnedSearches').forEach((query) => {
|
||||
const parsed = parseQuery(query);
|
||||
if (parsed) {
|
||||
const nodeMatches = searchTopology(state.get('nodes'), parsed);
|
||||
|
||||
@@ -19,7 +19,7 @@ export function getDefaultTopology(topologies) {
|
||||
.flatMap(t => makeList([t]).concat(t.get('sub_topologies', makeList())));
|
||||
|
||||
return flatTopologies
|
||||
.sortBy(t => {
|
||||
.sortBy((t) => {
|
||||
const index = TOPOLOGY_DISPLAY_PRIORITY.indexOf(t.get('id'));
|
||||
return index === -1 ? Infinity : index;
|
||||
})
|
||||
@@ -53,7 +53,7 @@ export function buildTopologyCacheId(topologyId, topologyOptions) {
|
||||
export function findTopologyById(subTree, topologyId) {
|
||||
let foundTopology;
|
||||
|
||||
subTree.forEach(topology => {
|
||||
subTree.forEach((topology) => {
|
||||
if (endsWith(topology.get('url'), topologyId)) {
|
||||
foundTopology = topology;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export function findTopologyById(subTree, topologyId) {
|
||||
}
|
||||
|
||||
export function updateNodeDegrees(nodes, edges) {
|
||||
return nodes.map(node => {
|
||||
return nodes.map((node) => {
|
||||
const nodeId = node.get('id');
|
||||
const degree = edges.count(edge => edge.get('source') === nodeId
|
||||
|| edge.get('target') === nodeId);
|
||||
@@ -76,7 +76,7 @@ export function updateNodeDegrees(nodes, edges) {
|
||||
|
||||
/* set topology.id and parentId for sub-topologies in place */
|
||||
export function updateTopologyIds(topologies, parentId) {
|
||||
return topologies.map(topology => {
|
||||
return topologies.map((topology) => {
|
||||
const result = Object.assign({}, topology);
|
||||
result.id = topology.url.split('/').pop();
|
||||
if (parentId) {
|
||||
@@ -90,7 +90,7 @@ export function updateTopologyIds(topologies, parentId) {
|
||||
}
|
||||
|
||||
export function addTopologyFullname(topologies) {
|
||||
return topologies.map(t => {
|
||||
return topologies.map((t) => {
|
||||
if (!t.sub_topologies) {
|
||||
return Object.assign({}, t, {fullName: t.name});
|
||||
}
|
||||
@@ -108,10 +108,10 @@ export function addTopologyFullname(topologies) {
|
||||
export function setTopologyUrlsById(topologyUrlsById, topologies) {
|
||||
let urlMap = topologyUrlsById;
|
||||
if (topologies) {
|
||||
topologies.forEach(topology => {
|
||||
topologies.forEach((topology) => {
|
||||
urlMap = urlMap.set(topology.id, topology.url);
|
||||
if (topology.sub_topologies) {
|
||||
topology.sub_topologies.forEach(subTopology => {
|
||||
topology.sub_topologies.forEach((subTopology) => {
|
||||
urlMap = urlMap.set(subTopology.id, subTopology.url);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user