mirror of
https://github.com/yldio/copilot.git
synced 2024-12-28 21:00:05 +02:00
chore: fix linting with hoisted eslint
This commit is contained in:
parent
4923f39463
commit
6cfeae136d
2
.gitignore
vendored
2
.gitignore
vendored
@ -158,3 +158,5 @@ _todo
|
||||
packages/*/dist
|
||||
packages/*/buid
|
||||
packages/ui-toolkit/styleguide/
|
||||
packages/*/package-lock.json
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "independent",
|
||||
"npmClient": "yarn",
|
||||
"hoist": true,
|
||||
"nohoist": ["graphi"],
|
||||
"nohoist": ["graphi", "eslint", "jest", "jest-cli", "react-scripts"],
|
||||
"packages": [
|
||||
"packages/*"
|
||||
]
|
||||
|
@ -13,12 +13,14 @@
|
||||
"format-staged": "./scripts/format --staged",
|
||||
"lint-license": "./scripts/license-to-fail",
|
||||
"lint-docs": "./scripts/quality-docs",
|
||||
"lint:root": "eslint scripts/* --fix",
|
||||
"lint-ci:root": "echo 0 `# eslint scripts/* --format junit --output-file $CIRCLE_TEST_REPORTS/lint/container-pilot-dashboard.xml`",
|
||||
"lint:root": "echo 0 `# eslint scripts/* --fix`",
|
||||
"lint-ci:packages": "lerna run lint-ci",
|
||||
"lint:packages": "lerna run lint",
|
||||
"lint-ci": "redrun -s lint-ci:*",
|
||||
"lint": "redrun -s lint:*",
|
||||
"test-ci": "lerna run test-ci",
|
||||
"test": "lerna run test",
|
||||
"lint-ci": "eslint scripts/* --format junit --output-file $CIRCLE_TEST_REPORTS/lint/container-pilot-dashboard.xml",
|
||||
"test-ci": "echo 0",
|
||||
"clean": "lerna clean --yes",
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"dev": "redrun -p dev:*",
|
||||
|
@ -5,11 +5,13 @@ const { GraphQLID, GraphQLBoolean, GraphQLString } = require('graphql');
|
||||
|
||||
module.exports.createFirewallRule = {
|
||||
type: FirewallRuleType,
|
||||
description: "Adds a new firewall rule for the specified account. This rule will be added to all the account's instances where it may be necessary",
|
||||
description:
|
||||
"Adds a new firewall rule for the specified account. This rule will be added to all the account's instances where it may be necessary",
|
||||
args: {
|
||||
enabled: {
|
||||
type: GraphQLBoolean,
|
||||
description: 'Indicates if the rule is enabled (optional, false by default)'
|
||||
description:
|
||||
'Indicates if the rule is enabled (optional, false by default)'
|
||||
},
|
||||
rule: {
|
||||
type: GraphQLString,
|
||||
@ -31,7 +33,8 @@ module.exports.createFirewallRule = {
|
||||
|
||||
module.exports.updateFirewallRule = {
|
||||
type: FirewallRuleType,
|
||||
description: 'Updates the given rule record and -- depending on rule contents -- adds/removes/updates the rule on all the required instances',
|
||||
description:
|
||||
'Updates the given rule record and -- depending on rule contents -- adds/removes/updates the rule on all the required instances',
|
||||
args: {
|
||||
id: {
|
||||
type: GraphQLID,
|
||||
@ -39,7 +42,8 @@ module.exports.updateFirewallRule = {
|
||||
},
|
||||
enabled: {
|
||||
type: GraphQLBoolean,
|
||||
description: 'Indicates if the rule is enabled (optional, false by default)'
|
||||
description:
|
||||
'Indicates if the rule is enabled (optional, false by default)'
|
||||
},
|
||||
rule: {
|
||||
type: GraphQLString,
|
||||
@ -85,7 +89,8 @@ module.exports.disableFirewallRule = {
|
||||
|
||||
module.exports.deleteFirewallRule = {
|
||||
type: FirewallRuleType,
|
||||
description: 'Removes the given firewall rule from all the required instances',
|
||||
description:
|
||||
'Removes the given firewall rule from all the required instances',
|
||||
args: {
|
||||
id: {
|
||||
type: GraphQLID,
|
||||
|
@ -15,35 +15,43 @@ module.exports.createImage = {
|
||||
args: {
|
||||
machine: {
|
||||
type: new GraphQLNonNull(GraphQLID),
|
||||
description: 'The prepared and stopped instance UUID from which the image is to be created'
|
||||
description:
|
||||
'The prepared and stopped instance UUID from which the image is to be created'
|
||||
},
|
||||
name: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
description: 'The name of the custom image, e.g. "my-image". Maximum 512 characters. However, typical names should be much shorter, e.g. 5-20 characters'
|
||||
description:
|
||||
'The name of the custom image, e.g. "my-image". Maximum 512 characters. However, typical names should be much shorter, e.g. 5-20 characters'
|
||||
},
|
||||
version: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
description: 'The version of the custom image, e.g. "1.0.0". Maximum 128 characters'
|
||||
description:
|
||||
'The version of the custom image, e.g. "1.0.0". Maximum 128 characters'
|
||||
},
|
||||
description: {
|
||||
type: GraphQLString,
|
||||
description: 'A short prose description of this image. Maximum 512 characters'
|
||||
description:
|
||||
'A short prose description of this image. Maximum 512 characters'
|
||||
},
|
||||
homepage: {
|
||||
type: GraphQLString,
|
||||
description: 'Homepage URL where users can find more information about the image. Maximum 128 characters'
|
||||
description:
|
||||
'Homepage URL where users can find more information about the image. Maximum 128 characters'
|
||||
},
|
||||
eula: {
|
||||
type: GraphQLString,
|
||||
description: 'URL of the End User License Agreement (EULA) for the image. Maximum 128 characters'
|
||||
description:
|
||||
'URL of the End User License Agreement (EULA) for the image. Maximum 128 characters'
|
||||
},
|
||||
acl: {
|
||||
type: new GraphQLList(GraphQLID),
|
||||
description: 'An array of user/account UUIDs to which to give read access to a private image. I.e. this is only relevant for images with public === false'
|
||||
description:
|
||||
'An array of user/account UUIDs to which to give read access to a private image. I.e. this is only relevant for images with public === false'
|
||||
},
|
||||
tags: {
|
||||
type: DynamicObjectType,
|
||||
description: 'An object of key/value pairs that allows clients to categorize images by any given criteria'
|
||||
description:
|
||||
'An object of key/value pairs that allows clients to categorize images by any given criteria'
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
|
@ -5,7 +5,8 @@ const { GraphQLNonNull, GraphQLString, GraphQLID } = require('graphql');
|
||||
|
||||
module.exports.createKey = {
|
||||
type: KeyType,
|
||||
description: 'Uploads a new OpenSSH key to Triton for use in HTTP signing and SSH',
|
||||
description:
|
||||
'Uploads a new OpenSSH key to Triton for use in HTTP signing and SSH',
|
||||
args: {
|
||||
name: {
|
||||
type: new GraphQLNonNull(GraphQLString)
|
||||
@ -15,7 +16,8 @@ module.exports.createKey = {
|
||||
},
|
||||
userId: {
|
||||
type: GraphQLID,
|
||||
description: 'UserId to add this key to. Leaving this in blank will add the key to the account'
|
||||
description:
|
||||
'UserId to add this key to. Leaving this in blank will add the key to the account'
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
@ -36,7 +38,8 @@ module.exports.deleteKey = {
|
||||
},
|
||||
userId: {
|
||||
type: GraphQLID,
|
||||
description: 'UserId who this key belongs to. Leaving this in blank will delete an account key'
|
||||
description:
|
||||
'UserId who this key belongs to. Leaving this in blank will delete an account key'
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
|
@ -16,11 +16,13 @@ module.exports.createMachine = {
|
||||
args: {
|
||||
name: {
|
||||
type: GraphQLString,
|
||||
description: 'Friendly name for this instance; default is the first 8 characters of the machine id'
|
||||
description:
|
||||
'Friendly name for this instance; default is the first 8 characters of the machine id'
|
||||
},
|
||||
package: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
description: 'Id of the package to use on provisioning, obtained from ListPackages'
|
||||
description:
|
||||
'Id of the package to use on provisioning, obtained from ListPackages'
|
||||
},
|
||||
image: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
@ -32,11 +34,13 @@ module.exports.createMachine = {
|
||||
},
|
||||
locality: {
|
||||
type: MachineType.locality,
|
||||
description: 'Optionally specify which instances the new instance should be near or far from'
|
||||
description:
|
||||
'Optionally specify which instances the new instance should be near or far from'
|
||||
},
|
||||
metadata: {
|
||||
type: DynamicObjectType,
|
||||
description: 'An arbitrary set of metadata key/value pairs can be set at provision time'
|
||||
description:
|
||||
'An arbitrary set of metadata key/value pairs can be set at provision time'
|
||||
},
|
||||
tags: {
|
||||
type: DynamicObjectType,
|
||||
@ -44,7 +48,8 @@ module.exports.createMachine = {
|
||||
},
|
||||
firewallEnabled: {
|
||||
type: GraphQLBoolean,
|
||||
description: 'Completely enable or disable firewall for this instance. Default is false'
|
||||
description:
|
||||
'Completely enable or disable firewall for this instance. Default is false'
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
@ -98,7 +103,8 @@ module.exports.startMachine = {
|
||||
|
||||
module.exports.startMachineFromSnapshot = {
|
||||
type: MachineType,
|
||||
description: 'If an instance is in the "stopped" state, you can choose to start the instance from the referenced snapshot',
|
||||
description:
|
||||
'If an instance is in the "stopped" state, you can choose to start the instance from the referenced snapshot',
|
||||
args: {
|
||||
id: {
|
||||
type: new GraphQLNonNull(GraphQLID),
|
||||
@ -176,7 +182,8 @@ module.exports.deleteMachine = {
|
||||
|
||||
module.exports.auditMachine = {
|
||||
type: new GraphQLList(DynamicObjectType),
|
||||
description: "Provides a list of an instance's accomplished actions. Results are sorted from newest to oldest action",
|
||||
description:
|
||||
"Provides a list of an instance's accomplished actions. Results are sorted from newest to oldest action",
|
||||
args: {
|
||||
id: {
|
||||
type: new GraphQLNonNull(GraphQLID),
|
||||
@ -309,7 +316,8 @@ module.exports.deleteMachineTags = {
|
||||
},
|
||||
tag: {
|
||||
type: GraphQLString,
|
||||
description: 'Tag name to remove. If value is not supplied, all machine tags are removed'
|
||||
description:
|
||||
'Tag name to remove. If value is not supplied, all machine tags are removed'
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
|
@ -18,7 +18,8 @@ module.exports.createPolicy = {
|
||||
},
|
||||
rules: {
|
||||
type: new GraphQLNonNull(new GraphQLList(GraphQLString)),
|
||||
description: 'One or more Aperture sentences to be added to the current policy'
|
||||
description:
|
||||
'One or more Aperture sentences to be added to the current policy'
|
||||
},
|
||||
description: {
|
||||
type: GraphQLString,
|
||||
@ -32,7 +33,8 @@ module.exports.createPolicy = {
|
||||
|
||||
module.exports.updatePolicy = {
|
||||
type: PolicyType,
|
||||
description: 'Upgrades an existing account policy. Everything but id can be modified',
|
||||
description:
|
||||
'Upgrades an existing account policy. Everything but id can be modified',
|
||||
args: {
|
||||
id: {
|
||||
type: new GraphQLNonNull(GraphQLID)
|
||||
@ -43,7 +45,8 @@ module.exports.updatePolicy = {
|
||||
},
|
||||
rules: {
|
||||
type: new GraphQLNonNull(new GraphQLList(GraphQLString)),
|
||||
description: 'One or more Aperture sentences to be added to the current policy'
|
||||
description:
|
||||
'One or more Aperture sentences to be added to the current policy'
|
||||
},
|
||||
description: {
|
||||
type: GraphQLString,
|
||||
|
@ -22,11 +22,13 @@ module.exports.createRole = {
|
||||
},
|
||||
members: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: "This account's user logins to be added to this role (Optional)"
|
||||
description:
|
||||
"This account's user logins to be added to this role (Optional)"
|
||||
},
|
||||
defaultMembers: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: "This account's user logins to be added to this role and have it enabled by default (Optional)"
|
||||
description:
|
||||
"This account's user logins to be added to this role and have it enabled by default (Optional)"
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
@ -51,11 +53,13 @@ module.exports.updateRole = {
|
||||
},
|
||||
members: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: "This account's user logins to be added to this role (Optional)"
|
||||
description:
|
||||
"This account's user logins to be added to this role (Optional)"
|
||||
},
|
||||
defaultMembers: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: "This account's user logins to be added to this role and have it enabled by default (Optional)"
|
||||
description:
|
||||
"This account's user logins to be added to this role and have it enabled by default (Optional)"
|
||||
}
|
||||
},
|
||||
resolve: (root, args) => {
|
||||
@ -80,7 +84,8 @@ module.exports.deleteRole = {
|
||||
|
||||
module.exports.setRoleTags = {
|
||||
type: RoleType.tag,
|
||||
description: "Sets the given role tags to the provided resource path. resource_path can be the path to any of the CloudAPI resources described in this document: account, keys, users, roles, policies, user's ssh keys, datacenters, images, packages, instances, analytics, instrumentations, firewall rules and networks.",
|
||||
description:
|
||||
"Sets the given role tags to the provided resource path. resource_path can be the path to any of the CloudAPI resources described in this document: account, keys, users, roles, policies, user's ssh keys, datacenters, images, packages, instances, analytics, instrumentations, firewall rules and networks.",
|
||||
args: {
|
||||
resource: {
|
||||
type: new GraphQLNonNull(GraphQLString),
|
||||
|
@ -29,7 +29,8 @@ module.exports = {
|
||||
},
|
||||
state: {
|
||||
type: GraphQLString,
|
||||
description: 'Filter on image state. By default only active images are shown. Use "all" to list all images'
|
||||
description:
|
||||
'Filter on image state. By default only active images are shown. Use "all" to list all images'
|
||||
},
|
||||
owner: {
|
||||
type: GraphQLString,
|
||||
|
@ -16,7 +16,8 @@ module.exports = {
|
||||
},
|
||||
name: {
|
||||
type: GraphQLString,
|
||||
description: 'Machine name to find (will make your list size 1, or 0 if nothing found)'
|
||||
description:
|
||||
'Machine name to find (will make your list size 1, or 0 if nothing found)'
|
||||
},
|
||||
image: {
|
||||
type: GraphQLString,
|
||||
@ -36,7 +37,8 @@ module.exports = {
|
||||
},
|
||||
first: {
|
||||
type: GraphQLInt,
|
||||
description: 'Return a max of N instances; default is 1000 (which is also the maximum allowable result set size)'
|
||||
description:
|
||||
'Return a max of N instances; default is 1000 (which is also the maximum allowable result set size)'
|
||||
},
|
||||
after: {
|
||||
type: GraphQLInt,
|
||||
@ -48,11 +50,13 @@ module.exports = {
|
||||
},
|
||||
docker: {
|
||||
type: GraphQLString,
|
||||
description: 'Whether to only list Docker instances, or only non-Docker instances, if present. Defaults to showing all instances.'
|
||||
description:
|
||||
'Whether to only list Docker instances, or only non-Docker instances, if present. Defaults to showing all instances.'
|
||||
},
|
||||
credentials: {
|
||||
type: GraphQLString,
|
||||
description: 'Whether to include the generated credentials for instances, if present. Defaults to false'
|
||||
description:
|
||||
'Whether to include the generated credentials for instances, if present. Defaults to false'
|
||||
}
|
||||
},
|
||||
resolve(root, args) {
|
||||
|
@ -29,7 +29,8 @@ module.exports = {
|
||||
},
|
||||
lwps: {
|
||||
type: GraphQLInt,
|
||||
description: 'Filter on maximum number of light-weight processes (threads) allowed'
|
||||
description:
|
||||
'Filter on maximum number of light-weight processes (threads) allowed'
|
||||
},
|
||||
vcpus: {
|
||||
type: GraphQLInt,
|
||||
|
@ -7,19 +7,23 @@ const CallerType = new GraphQLObjectType({
|
||||
fields: {
|
||||
type: {
|
||||
type: GraphQLString,
|
||||
description: 'Authentication type for the action request. One of "basic", "operator", "signature" or "token"'
|
||||
description:
|
||||
'Authentication type for the action request. One of "basic", "operator", "signature" or "token"'
|
||||
},
|
||||
user: {
|
||||
type: GraphQLString,
|
||||
description: 'When the authentication type is "basic", this member will be present and include user login'
|
||||
description:
|
||||
'When the authentication type is "basic", this member will be present and include user login'
|
||||
},
|
||||
ip: {
|
||||
type: GraphQLString,
|
||||
description: 'The IP addresses this from which the action was requested. Not present if type is "operator"'
|
||||
description:
|
||||
'The IP addresses this from which the action was requested. Not present if type is "operator"'
|
||||
},
|
||||
keyId: {
|
||||
type: GraphQLString,
|
||||
description: 'When authentication type is either "signature" or "token", SSH key identifier'
|
||||
description:
|
||||
'When authentication type is either "signature" or "token", SSH key identifier'
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -33,7 +37,8 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
parameters: {
|
||||
type: DynamicObjectType,
|
||||
description: 'The original set of parameters sent when the action was requested'
|
||||
description:
|
||||
'The original set of parameters sent when the action was requested'
|
||||
},
|
||||
success: {
|
||||
type: GraphQLBoolean,
|
||||
|
@ -14,7 +14,8 @@ const ErrorType = new GraphQLObjectType({
|
||||
fields: {
|
||||
code: {
|
||||
type: GraphQLString,
|
||||
description: 'A CamelCase string code for this error, e.g. "PrepareImageDidNotRun". See GetImage docs for a table of error.code values'
|
||||
description:
|
||||
'A CamelCase string code for this error, e.g. "PrepareImageDidNotRun". See GetImage docs for a table of error.code values'
|
||||
},
|
||||
message: {
|
||||
type: GraphQLString,
|
||||
@ -28,11 +29,13 @@ const ImageFileType = new GraphQLObjectType({
|
||||
fields: {
|
||||
compression: {
|
||||
type: GraphQLString,
|
||||
description: 'The type of file compression used for the image file. One of "bzip2", "gzip", "none"'
|
||||
description:
|
||||
'The type of file compression used for the image file. One of "bzip2", "gzip", "none"'
|
||||
},
|
||||
sha1: {
|
||||
type: GraphQLString,
|
||||
description: 'SHA-1 hex digest of the file content. Used for corruption checking'
|
||||
description:
|
||||
'SHA-1 hex digest of the file content. Used for corruption checking'
|
||||
},
|
||||
size: {
|
||||
type: GraphQLInt,
|
||||
@ -43,7 +46,8 @@ const ImageFileType = new GraphQLObjectType({
|
||||
|
||||
module.exports = new GraphQLObjectType({
|
||||
name: 'ImageType',
|
||||
description: 'An image contains the software packages that will be available on newly-provisioned instance. In the case of hardware virtual machines, the image also includes the operating system',
|
||||
description:
|
||||
'An image contains the software packages that will be available on newly-provisioned instance. In the case of hardware virtual machines, the image also includes the operating system',
|
||||
fields: {
|
||||
id: {
|
||||
type: GraphQLID,
|
||||
@ -67,15 +71,18 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
requirements: {
|
||||
type: DynamicObjectType,
|
||||
description: 'Contains a grouping of various minimum requirements for provisioning an instance with this image. For example "password" indicates that a password must be provided'
|
||||
description:
|
||||
'Contains a grouping of various minimum requirements for provisioning an instance with this image. For example "password" indicates that a password must be provided'
|
||||
},
|
||||
homepage: {
|
||||
type: GraphQLString,
|
||||
description: 'The URL for a web page with more detailed information for this image'
|
||||
description:
|
||||
'The URL for a web page with more detailed information for this image'
|
||||
},
|
||||
files: {
|
||||
type: new GraphQLList(ImageFileType),
|
||||
description: 'An array of image files that make up each image. Currently only a single file per image is supported'
|
||||
description:
|
||||
'An array of image files that make up each image. Currently only a single file per image is supported'
|
||||
},
|
||||
publishedAt: {
|
||||
type: GraphQLString,
|
||||
@ -94,11 +101,13 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
state: {
|
||||
type: GraphQLString,
|
||||
description: 'The current state of the image. One of "active", "unactivated", "disabled", "creating", "failed"'
|
||||
description:
|
||||
'The current state of the image. One of "active", "unactivated", "disabled", "creating", "failed"'
|
||||
},
|
||||
tags: {
|
||||
type: DynamicObjectType,
|
||||
description: 'An object of key/value pairs that allows clients to categorize images by any given criteria'
|
||||
description:
|
||||
'An object of key/value pairs that allows clients to categorize images by any given criteria'
|
||||
},
|
||||
eula: {
|
||||
type: GraphQLString,
|
||||
@ -106,11 +115,13 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
acl: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: 'Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images'
|
||||
description:
|
||||
'Access Control List. An array of account UUIDs given access to a private image. The field is only relevant to private images'
|
||||
},
|
||||
error: {
|
||||
type: ErrorType,
|
||||
description: 'If state=="failed", resulting from CreateImageFromMachine failure, then there may be an error object of the form {"code": "<string error code>", "message": "<string desc>"}'
|
||||
description:
|
||||
'If state=="failed", resulting from CreateImageFromMachine failure, then there may be an error object of the form {"code": "<string error code>", "message": "<string desc>"}'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -14,7 +14,8 @@ const {
|
||||
|
||||
module.exports = new GraphQLObjectType({
|
||||
name: 'MachineType',
|
||||
description: 'An image contains the software packages that will be available on newly-provisioned instance. In the case of hardware virtual machines, the image also includes the operating system',
|
||||
description:
|
||||
'An image contains the software packages that will be available on newly-provisioned instance. In the case of hardware virtual machines, the image also includes the operating system',
|
||||
// Function to allow circular dependencies
|
||||
fields: () => ({
|
||||
id: {
|
||||
|
@ -10,7 +10,8 @@ const {
|
||||
|
||||
module.exports = new GraphQLObjectType({
|
||||
name: 'NetworkType',
|
||||
description: 'Logical networks in Triton model core network configurations to enable Triton to define Virtual Network Interfaces and IP addresses for instances',
|
||||
description:
|
||||
'Logical networks in Triton model core network configurations to enable Triton to define Virtual Network Interfaces and IP addresses for instances',
|
||||
fields: {
|
||||
id: {
|
||||
type: GraphQLID,
|
||||
|
@ -2,7 +2,8 @@ const { GraphQLBoolean, GraphQLObjectType, GraphQLString } = require('graphql');
|
||||
|
||||
module.exports = new GraphQLObjectType({
|
||||
name: 'NicType',
|
||||
description: 'Logical networks are used both on head nodes and compute nodes, and are associated with physical interfaces by using a system called NIC Tags',
|
||||
description:
|
||||
'Logical networks are used both on head nodes and compute nodes, and are associated with physical interfaces by using a system called NIC Tags',
|
||||
fields: {
|
||||
ip: {
|
||||
type: GraphQLString,
|
||||
@ -29,7 +30,8 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
state: {
|
||||
type: GraphQLString,
|
||||
description: 'Describes the state of the NIC (e.g. provisioning, running, or stopped)'
|
||||
description:
|
||||
'Describes the state of the NIC (e.g. provisioning, running, or stopped)'
|
||||
},
|
||||
network: {
|
||||
type: GraphQLString,
|
||||
|
@ -7,7 +7,8 @@ const {
|
||||
|
||||
module.exports = new GraphQLObjectType({
|
||||
name: 'RoleType',
|
||||
description: 'Roles are lists of users and policies. Roles describe which users are allowed access according to the policies',
|
||||
description:
|
||||
'Roles are lists of users and policies. Roles describe which users are allowed access according to the policies',
|
||||
fields: {
|
||||
id: {
|
||||
type: GraphQLID,
|
||||
@ -27,7 +28,8 @@ module.exports = new GraphQLObjectType({
|
||||
},
|
||||
defaultMembers: {
|
||||
type: new GraphQLList(GraphQLString),
|
||||
description: "This account's user logins this role applies to by default (Optional)"
|
||||
description:
|
||||
"This account's user logins this role applies to by default (Optional)"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "joyent-portal",
|
||||
"rules": {
|
||||
"no-console": 0
|
||||
"no-console": 0,
|
||||
"new-cap": 0
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
"lint-ci:js": "eslint . --format junit --output-file $CIRCLE_TEST_REPORTS/lint/cp-frontend.xml",
|
||||
"lint-ci": "redrun -p lint-ci:*",
|
||||
"test": "NODE_ENV=test ./test/run --env=jsdom",
|
||||
"test-ci": "NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/cp-frontend.xml ./test/run --env=jsdom --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/cp-frontend --testResultsProcessor='./node_modules/jest-junit'",
|
||||
"test-ci": "NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/cp-frontend.xml ./test/run --env=jsdom --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/cp-frontend --testResultsProcessor=$(node -e \"console.log(require.resolve('jest-junit'))\")",
|
||||
"postinstall": "node scripts/postinstall"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -23,6 +23,7 @@
|
||||
"apr-intercept": "^1.0.4",
|
||||
"constant-case": "^2.0.0",
|
||||
"graphql-tag": "^2.2.2",
|
||||
"jest-cli": "^20.0.4",
|
||||
"joyent-manifest-editor": "^1.0.0",
|
||||
"joyent-ui-toolkit": "^1.1.0",
|
||||
"lodash.isstring": "^4.0.1",
|
||||
|
@ -4,6 +4,7 @@ const forEach = require('apr-for-each');
|
||||
const find = require('apr-find');
|
||||
const path = require('path');
|
||||
|
||||
const ROOT = path.join(__dirname, '../node_modules/react-scripts/config');
|
||||
const configs = ['webpack.config.dev', 'webpack.config.prod'];
|
||||
|
||||
const toCopy = [
|
||||
@ -12,8 +13,6 @@ const toCopy = [
|
||||
'webpack.config.prod'
|
||||
];
|
||||
|
||||
let ROOT;
|
||||
|
||||
const backup = async file => {
|
||||
const backupPath = path.join(ROOT, `${file}.original.js`);
|
||||
const backupExists = await exists(backupPath);
|
||||
@ -37,15 +36,6 @@ const copy = async file => {
|
||||
|
||||
main(
|
||||
(async () => {
|
||||
ROOT = await find([
|
||||
path.join(__dirname, '../node_modules/react-scripts/config'),
|
||||
path.join(__dirname, '../../../node_modules/react-scripts/config')
|
||||
], exists);
|
||||
|
||||
if (!ROOT) {
|
||||
throw new Error('react-scripts not found');
|
||||
}
|
||||
|
||||
await forEach(configs, backup);
|
||||
await forEach(toCopy, copy);
|
||||
})()
|
||||
|
@ -3,7 +3,6 @@ import { reduxForm } from 'redux-form';
|
||||
import { compose, graphql } from 'react-apollo';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import intercept from 'apr-intercept';
|
||||
import PropTypes from 'prop-types';
|
||||
import paramCase from 'param-case';
|
||||
|
||||
import DeploymentGroupBySlug from '@graphql/DeploymentGroupBySlug.gql';
|
||||
@ -29,6 +28,7 @@ const validateName = async ({ name = '' }) => {
|
||||
});
|
||||
|
||||
if (data.deploymentGroups.length) {
|
||||
// eslint-disable-next-line no-throw-literal
|
||||
throw { name: `"${name}" already exists!` };
|
||||
}
|
||||
};
|
||||
@ -132,7 +132,7 @@ class DeploymentGroupCreate extends Component {
|
||||
const { manifest } = this.state;
|
||||
const { provisionManifest } = this.props;
|
||||
|
||||
const [err, { data }] = await intercept(
|
||||
const [err] = await intercept(
|
||||
provisionManifest({
|
||||
deploymentGroupId,
|
||||
type: 'COMPOSE',
|
||||
|
@ -1,6 +1,85 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders <Header /> without throwing 1`] = `
|
||||
.iKAUmn {
|
||||
font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif;
|
||||
font-weight: 500;
|
||||
font-size: 1.5rem;
|
||||
-webkit-text-transform: uppercase;
|
||||
text-transform: uppercase;
|
||||
color: ;
|
||||
font-size: 1.8125rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.eVSukw {
|
||||
-webkit-flex: 1 1 auto;
|
||||
-ms-flex: 1 1 auto;
|
||||
flex: 1 1 auto;
|
||||
-webkit-align-self: stretch;
|
||||
-ms-flex-item-align: stretch;
|
||||
align-self: stretch;
|
||||
-webkit-order: 0;
|
||||
-ms-flex-order: 0;
|
||||
order: 0;
|
||||
padding: 0.9375rem 0;
|
||||
}
|
||||
|
||||
.facVTr {
|
||||
font-family: "Libre Franklin",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica,sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 1.5rem;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
color: ;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.hnPDgK {
|
||||
-webkit-flex: 0 1 auto;
|
||||
-ms-flex: 0 1 auto;
|
||||
flex: 0 1 auto;
|
||||
-webkit-align-self: auto;
|
||||
-ms-flex-item-align: auto;
|
||||
align-self: auto;
|
||||
-webkit-order: 0;
|
||||
-ms-flex-order: 0;
|
||||
order: 0;
|
||||
padding: 0.9375rem 0;
|
||||
width: 6.25rem;
|
||||
max-width: 6.25rem;
|
||||
}
|
||||
|
||||
.fAWQXE {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-flex-direction: row;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-webkit-flex-wrap: nowrap;
|
||||
-ms-flex-wrap: nowrap;
|
||||
flex-wrap: nowrap;
|
||||
-webkit-box-pack: space-between;
|
||||
-webkit-justify-content: space-between;
|
||||
-ms-flex-pack: space-between;
|
||||
justify-content: space-between;
|
||||
-webkit-align-content: stretch;
|
||||
-ms-flex-line-pack: stretch;
|
||||
align-content: stretch;
|
||||
-webkit-align-items: stretch;
|
||||
-webkit-box-align: stretch;
|
||||
-ms-flex-align: stretch;
|
||||
align-items: stretch;
|
||||
background-color: ;
|
||||
max-height: 3.3125rem;
|
||||
min-height: 3.3125rem;
|
||||
padding: 0 1.125rem;
|
||||
line-height: 1.5625rem;
|
||||
}
|
||||
|
||||
<div
|
||||
className="header__Header-cywcLi fAWQXE"
|
||||
>
|
||||
@ -8,14 +87,14 @@ exports[`renders <Header /> without throwing 1`] = `
|
||||
className="brand__Box-cSEQoZ eVSukw"
|
||||
>
|
||||
<h2
|
||||
className="sc-chPdSV giFJbY"
|
||||
className="sc-kkGfuU iKAUmn"
|
||||
>
|
||||
<a
|
||||
href="/"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<img
|
||||
className="sc-bdVaJa kujeyI"
|
||||
className="sc-hSdWYo iogIsy"
|
||||
src="test-file-mock"
|
||||
/>
|
||||
</a>
|
||||
@ -25,14 +104,14 @@ exports[`renders <Header /> without throwing 1`] = `
|
||||
className="item__Box-hzIdkQ hnPDgK"
|
||||
>
|
||||
<p
|
||||
className="sc-kgoBCf dYRxpA"
|
||||
className="sc-iAyFgw facVTr"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className="item__Box-hzIdkQ hnPDgK"
|
||||
>
|
||||
<p
|
||||
className="sc-kgoBCf dYRxpA"
|
||||
className="sc-iAyFgw facVTr"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2,14 +2,14 @@
|
||||
* @jest-environment node
|
||||
*/
|
||||
|
||||
// import 'jest-styled-components';
|
||||
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import 'jest-styled-components';
|
||||
|
||||
import Header from '@components/navigation/header';
|
||||
import { Router } from './mocks';
|
||||
|
||||
it('renders <Header /> without throwing', () => {
|
||||
const tree = renderer.create(<Router><Header /></Router>).toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
expect(tree).toMatchStyledComponentsSnapshot();
|
||||
});
|
||||
|
@ -2,6 +2,5 @@ import React from 'react';
|
||||
import { client, store } from '@state/store';
|
||||
import { ApolloProvider } from 'react-apollo';
|
||||
|
||||
export default ({ children }) => (
|
||||
<ApolloProvider client={client} store={store}>{children}</ApolloProvider>
|
||||
);
|
||||
export default ({ children }) =>
|
||||
<ApolloProvider client={client} store={store}>{children}</ApolloProvider>;
|
||||
|
@ -2,6 +2,5 @@ import React from 'react';
|
||||
import { ThemeProvider } from 'styled-components';
|
||||
import { theme } from 'joyent-ui-toolkit';
|
||||
|
||||
export default ({ children }) => (
|
||||
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
||||
);
|
||||
export default ({ children }) =>
|
||||
<ThemeProvider theme={theme}>{children}</ThemeProvider>;
|
||||
|
@ -10,14 +10,26 @@
|
||||
"test": "echo 0",
|
||||
"test-ci": "echo 0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^7.2.3",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-config-prettier": "^2.1.1",
|
||||
"eslint-config-react-app": "^1.0.4",
|
||||
"eslint-config-xo-space": "^0.16.0",
|
||||
"eslint-plugin-flowtype": "^2.34.0",
|
||||
"eslint-plugin-import": "^2.3.0",
|
||||
"eslint-plugin-jsx-a11y": "^5.0.3",
|
||||
"eslint-plugin-prettier": "^2.1.1",
|
||||
"eslint-plugin-react": "^7.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"babel-eslint": "^7.2.3",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-config-prettier": "^2.1.1",
|
||||
"eslint-config-react-app": "^0.6.2",
|
||||
"eslint-config-react-app": "^1.0.4",
|
||||
"eslint-config-xo-space": "^0.16.0",
|
||||
"eslint-plugin-flowtype": "^2.33.0",
|
||||
"eslint-plugin-import": "^2.2.0",
|
||||
"eslint-plugin-flowtype": "^2.34.0",
|
||||
"eslint-plugin-import": "^2.3.0",
|
||||
"eslint-plugin-jsx-a11y": "^5.0.3",
|
||||
"eslint-plugin-prettier": "^2.1.1",
|
||||
"eslint-plugin-react": "^7.0.1"
|
||||
|
@ -17,8 +17,8 @@
|
||||
"lint-ci:js": "eslint . --format junit --output-file $CIRCLE_TEST_REPORTS/lint/manifest-editor.xml",
|
||||
"lint": "redrun -s lint:*",
|
||||
"lint-ci": "redrun -p lint-ci:*",
|
||||
"test": "echo 0 # bup && NODE_ENV=test jest --coverage",
|
||||
"test-ci": "echo 0 # NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/manifest-editor.xml jest --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/manifest-editor --testResultsProcessor='./node_modules/jest-junit'",
|
||||
"test": "echo 0 `# bup && NODE_ENV=test jest --coverage`",
|
||||
"test-ci": "echo 0 `# NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/manifest-editor.xml jest --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/manifest-editor --testResultsProcessor=$(node -e \"console.log(require.resolve('jest-junit'))\")`",
|
||||
"build": "bup",
|
||||
"prepublish": "redrun build"
|
||||
},
|
||||
|
@ -25,7 +25,7 @@
|
||||
"lint": "redrun -s lint:*",
|
||||
"lint-ci": "redrun -p lint-ci:*",
|
||||
"test": "bup && NODE_ENV=test jest --coverage",
|
||||
"test-ci": "NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/normalized-styled-components.xml jest --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/normalized-styled-components --testResultsProcessor='./node_modules/jest-junit'",
|
||||
"test-ci": "NODE_ENV=test JEST_JUNIT_OUTPUT=$CIRCLE_TEST_REPORTS/test/normalized-styled-components.xml jest --coverage --coverageDirectory=$CIRCLE_ARTIFACTS/normalized-styled-components --testResultsProcessor=$(node -e \"console.log(require.resolve('jest-junit'))\")",
|
||||
"build": "bup",
|
||||
"prepublish": "redrun build"
|
||||
},
|
||||
@ -46,6 +46,7 @@
|
||||
"jest-snapshot": "^20.0.3",
|
||||
"jest-styled-components": "^3.0.0-2",
|
||||
"react": "^15.5.4",
|
||||
"react-scripts": "^1.0.7",
|
||||
"react-test-renderer": "^15.5.4",
|
||||
"redrun": "^5.9.14",
|
||||
"strip-ansi": "^3.0.1",
|
||||
@ -60,7 +61,19 @@
|
||||
"styled-components": "*"
|
||||
},
|
||||
"jest": {
|
||||
"testEnvironment": "jsdom",
|
||||
"testRegex": "test/index.js",
|
||||
"setupFiles": [
|
||||
"<rootDir>/node_modules/react-scripts/config/polyfills.js"
|
||||
],
|
||||
"testEnvironment": "node",
|
||||
"testRegex": "test/index.js"
|
||||
"transform": {
|
||||
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/react-scripts/config/jest/babelTransform.js",
|
||||
"^(?!.*\\.(js|jsx|css|json)$)": "<rootDir>/node_modules/react-scripts/config/jest/fileTransform.js"
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"
|
||||
],
|
||||
"rootDir": "."
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,14 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders <A /> correctly 1`] = `
|
||||
.lovCuy {
|
||||
.jleQxG {
|
||||
background-color: transparent;
|
||||
-webkit-text-decoration-skip: objects;
|
||||
text-decoration-skip: objects;
|
||||
}
|
||||
|
||||
<a
|
||||
className="src__A-ecpVJh lovCuy"
|
||||
className="sc-gqjmRU jleQxG"
|
||||
/>
|
||||
`;
|
||||
|
||||
@ -15,215 +16,216 @@ exports[`renders <Abbr /> correctly 1`] = `
|
||||
|
||||
|
||||
<abbr
|
||||
className="src__Abbr-bAnqpS gtMeep"
|
||||
className="sc-VigVT ijOVMO"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Article /> correctly 1`] = `
|
||||
.ikMeRt {
|
||||
.fpcbkF {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<article
|
||||
className="src__Article-cKDuAy ikMeRt"
|
||||
className="sc-bdVaJa fpcbkF"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Aside /> correctly 1`] = `
|
||||
.ijRwfR {
|
||||
.gbieAY {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<aside
|
||||
className="src__Aside-blfygu ijRwfR"
|
||||
className="sc-bwzfXH gbieAY"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Audio /> correctly 1`] = `
|
||||
.eYhVCs {
|
||||
.SYMpT {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.eYhVCs:not([controls]) {
|
||||
.SYMpT:not([controls]) {
|
||||
display: none;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
<audio
|
||||
className="src__Audio-cpeMhj eYhVCs"
|
||||
className="sc-ckVGcZ SYMpT"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <B /> correctly 1`] = `
|
||||
.dLmUSQ {
|
||||
.vhpOG {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
<b
|
||||
className="src__B-kYcTRm dLmUSQ"
|
||||
className="sc-jTzLTM vhpOG"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Button /> correctly 1`] = `
|
||||
.iRzzDR {
|
||||
.efaqoE {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
-webkit-text-transform: none;
|
||||
text-transform: none;
|
||||
-webkit-appearance: button;
|
||||
-moz-appearance: button;
|
||||
appearance: button;
|
||||
}
|
||||
|
||||
.iRzzDR::-moz-focus-inner,
|
||||
.iRzzDR[type="button"]::-moz-focus-inner,
|
||||
.iRzzDR[type="reset"]::-moz-focus-inner,
|
||||
.iRzzDR[type="submit"]::-moz-focus-inner {
|
||||
.efaqoE::-moz-focus-inner,
|
||||
.efaqoE[type="button"]::-moz-focus-inner,
|
||||
.efaqoE[type="reset"]::-moz-focus-inner,
|
||||
.efaqoE[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.iRzzDR:-moz-focusring,
|
||||
.iRzzDR[type="button"]:-moz-focusring,
|
||||
.iRzzDR[type="reset"]:-moz-focusring,
|
||||
.iRzzDR[type="submit"]:-moz-focusring {
|
||||
.efaqoE:-moz-focusring,
|
||||
.efaqoE[type="button"]:-moz-focusring,
|
||||
.efaqoE[type="reset"]:-moz-focusring,
|
||||
.efaqoE[type="submit"]:-moz-focusring {
|
||||
outline: 0.0625rem dotted ButtonText;
|
||||
}
|
||||
|
||||
<button
|
||||
className="src__Button-bjtQYq iRzzDR"
|
||||
className="sc-kEYyzF efaqoE"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Canvas /> correctly 1`] = `
|
||||
.bTMtpB {
|
||||
.gIGqrW {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
<canvas
|
||||
className="src__Canvas-dHWBuw bTMtpB"
|
||||
className="sc-gPEVay gIGqrW"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Code /> correctly 1`] = `
|
||||
.bFMmpU {
|
||||
font-family: monospace, monospace;
|
||||
.NmzmU {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
<code
|
||||
className="src__Code-jYaiac bFMmpU"
|
||||
className="sc-jzJRlG NmzmU"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Details /> correctly 1`] = `
|
||||
.eLTDBU {
|
||||
.kSeyxS {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<details
|
||||
className="src__Details-bMPFts eLTDBU"
|
||||
className="sc-cMljjf kSeyxS"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Dfn /> correctly 1`] = `
|
||||
.giuCOS {
|
||||
.lcACZG {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
<dfn
|
||||
className="src__Dfn-ffMPxK giuCOS"
|
||||
className="sc-chPdSV lcACZG"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Fieldset /> correctly 1`] = `
|
||||
.gKnJJb {
|
||||
.dLqrpE {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
<fieldset
|
||||
className="src__Fieldset-fInase gKnJJb"
|
||||
className="sc-cvbbAY dLqrpE"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <FigCaption /> correctly 1`] = `
|
||||
.epAseh {
|
||||
.fGYiaS {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<figcaption
|
||||
className="src__FigCaption-hoDWbO epAseh"
|
||||
className="sc-bZQynM fGYiaS"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Figure /> correctly 1`] = `
|
||||
.kYFPua {
|
||||
.fpLcXm {
|
||||
display: block;
|
||||
margin: 1rem 2.5rem;
|
||||
}
|
||||
|
||||
<figure
|
||||
className="src__Figure-MvZXy kYFPua"
|
||||
className="sc-gzVnrw fpLcXm"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Footer /> correctly 1`] = `
|
||||
.fzGbIX {
|
||||
.dMAkQL {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<footer
|
||||
className="src__Footer-cICHrI fzGbIX"
|
||||
className="sc-htpNat dMAkQL"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <H1 /> correctly 1`] = `
|
||||
.cdoVsj {
|
||||
.itlxbG {
|
||||
font-size: 2rem;
|
||||
margin: 0.625rem 0;
|
||||
}
|
||||
|
||||
<h1
|
||||
className="src__H1-kNUGse cdoVsj"
|
||||
className="sc-dnqmqq itlxbG"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Header /> correctly 1`] = `
|
||||
.cXQwqY {
|
||||
.imCjfa {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<header
|
||||
className="src__Header-bIhUgD cXQwqY"
|
||||
className="sc-bxivhb imCjfa"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Hr /> correctly 1`] = `
|
||||
.gzArFj {
|
||||
.jvTISp {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
<hr
|
||||
className="src__Hr-jTIkCb gzArFj"
|
||||
className="sc-iwsKbI jvTISp"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Img /> correctly 1`] = `
|
||||
.ivJkKO {
|
||||
.gLFqHa {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
<img
|
||||
className="src__Img-gjPRNy ivJkKO"
|
||||
className="sc-eNQAEJ gLFqHa"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Input /> correctly 1`] = `
|
||||
.kPJKsw {
|
||||
.gtmtGl {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
@ -231,7 +233,7 @@ exports[`renders <Input /> correctly 1`] = `
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.kPJKsw::-webkit-file-upload-button {
|
||||
.gtmtGl::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
-moz-appearance: button;
|
||||
appearance: button;
|
||||
@ -239,23 +241,23 @@ exports[`renders <Input /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<input
|
||||
className="src__Input-fEcOwi kPJKsw"
|
||||
className="sc-kkGfuU gtmtGl"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Kbd /> correctly 1`] = `
|
||||
.isVSTd {
|
||||
font-family: monospace, monospace;
|
||||
.cNQErp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
<kbd
|
||||
className="src__Kbd-dxUERL isVSTd"
|
||||
className="sc-cSHVUG cNQErp"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Legend /> correctly 1`] = `
|
||||
.dJEAnh {
|
||||
.iBvQlR {
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
display: table;
|
||||
@ -265,53 +267,53 @@ exports[`renders <Legend /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<legend
|
||||
className="src__Legend-bAhEow dJEAnh"
|
||||
className="sc-jWBwVP iBvQlR"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Main /> correctly 1`] = `
|
||||
.gwWdmq {
|
||||
.kGbKV {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<main
|
||||
className="src__Main-btYlaf gwWdmq"
|
||||
className="sc-htoDjs kGbKV"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Mark /> correctly 1`] = `
|
||||
.juvXfj {
|
||||
.gUcHXP {
|
||||
background-color: #ff0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
<mark
|
||||
className="src__Mark-gsydcK juvXfj"
|
||||
className="sc-kgoBCf gUcHXP"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Menu /> correctly 1`] = `
|
||||
.jRYaVX {
|
||||
.EtDOy {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<menu
|
||||
className="src__Menu-jiUApB jRYaVX"
|
||||
className="sc-jAaTju EtDOy"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Nav /> correctly 1`] = `
|
||||
.eayfNy {
|
||||
.kXFzZl {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<nav
|
||||
className="src__Nav-iOoeuf eayfNy"
|
||||
className="sc-ifAKCX kXFzZl"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Optgroup /> correctly 1`] = `
|
||||
.iFSmzs {
|
||||
.bwvGAC {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
@ -319,89 +321,90 @@ exports[`renders <Optgroup /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<optgroup
|
||||
className="src__Optgroup-Phlfn iFSmzs"
|
||||
className="sc-iAyFgw bwvGAC"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Pre /> correctly 1`] = `
|
||||
.beuufU {
|
||||
font-family: monospace, monospace;
|
||||
.ePyiae {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
<pre
|
||||
className="src__Pre-fkXllC beuufU"
|
||||
className="sc-gZMcBi ePyiae"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Progress /> correctly 1`] = `
|
||||
.bEoZpq {
|
||||
.irOoVX {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
<progress
|
||||
className="src__Progress-fidndm bEoZpq"
|
||||
className="sc-brqgnP irOoVX"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Samp /> correctly 1`] = `
|
||||
.ktmDsn {
|
||||
font-family: monospace, monospace;
|
||||
.brPjlW {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
<samp
|
||||
className="src__Samp-fCgRqV ktmDsn"
|
||||
className="sc-kAzzGY brPjlW"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Section /> correctly 1`] = `
|
||||
.eLknUB {
|
||||
.kyfnqM {
|
||||
display: block;
|
||||
}
|
||||
|
||||
<section
|
||||
className="src__Section-dZUgTN eLknUB"
|
||||
className="sc-EHOje kyfnqM"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Select /> correctly 1`] = `
|
||||
.ekFIkW {
|
||||
.kskmSD {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
-webkit-text-transform: none;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
<select
|
||||
className="src__Select-kkUZlk ekFIkW"
|
||||
className="sc-hSdWYo kskmSD"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Small /> correctly 1`] = `
|
||||
.herZpY {
|
||||
.eNDzVi {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
<small
|
||||
className="src__Small-gOuvkQ herZpY"
|
||||
className="sc-kGXeez eNDzVi"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Strong /> correctly 1`] = `
|
||||
.gABlxY {
|
||||
.liZvtt {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
<strong
|
||||
className="src__Strong-laomNI gABlxY"
|
||||
className="sc-fjdhpX liZvtt"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Sub /> correctly 1`] = `
|
||||
.jzNWGj {
|
||||
.bfYNTw {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
@ -410,22 +413,22 @@ exports[`renders <Sub /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<sub
|
||||
className="src__Sub-jswKaB jzNWGj"
|
||||
className="sc-kpOJdX bfYNTw"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Summary /> correctly 1`] = `
|
||||
.jeqMzv {
|
||||
.chrtFK {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
<summary
|
||||
className="src__Summary-cPdbBK jeqMzv"
|
||||
className="sc-jDwBTQ chrtFK"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Sup /> correctly 1`] = `
|
||||
.iqVsOf {
|
||||
.hZcmXd {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
@ -434,22 +437,22 @@ exports[`renders <Sup /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<sup
|
||||
className="src__Sup-eHQeoX iqVsOf"
|
||||
className="sc-dxgOiQ hZcmXd"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Svg /> correctly 1`] = `
|
||||
.chrnMV:not(:root) {
|
||||
.GnRoM:not(:root) {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
<svg
|
||||
className="src__Svg-kcnftw chrnMV"
|
||||
className="sc-hMqMXs GnRoM"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Textarea /> correctly 1`] = `
|
||||
.bCxsrI {
|
||||
.bDTEgL {
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
@ -458,16 +461,16 @@ exports[`renders <Textarea /> correctly 1`] = `
|
||||
}
|
||||
|
||||
<textarea
|
||||
className="src__Textarea-jjPykp bCxsrI"
|
||||
className="sc-eHgmQL bDTEgL"
|
||||
/>
|
||||
`;
|
||||
|
||||
exports[`renders <Video /> correctly 1`] = `
|
||||
.dpXJul {
|
||||
.bkGlpl {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
<video
|
||||
className="src__Video-ggHrOn dpXJul"
|
||||
className="sc-jKJlTe bkGlpl"
|
||||
/>
|
||||
`;
|
||||
|
@ -43,7 +43,7 @@ import {
|
||||
Menu,
|
||||
Summary,
|
||||
Canvas
|
||||
} from '../';
|
||||
} from '../src/';
|
||||
|
||||
it('renders <Article /> correctly', () => {
|
||||
const tree = renderer.create(<Article />).toJSON();
|
||||
|
@ -10,7 +10,7 @@
|
||||
"lint": "belly-button --fix",
|
||||
"lint-ci": "belly-button",
|
||||
"test": "lab -c",
|
||||
"test-ci": "echo 0 # lab -c -r console -o stdout -r tap -o $CIRCLE_TEST_REPORTS/test/portal-data.xml"
|
||||
"test-ci": "echo 0 `# lab -c -r console -o stdout -r tap -o $CIRCLE_TEST_REPORTS/test/portal-data.xml`"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "wyatt",
|
||||
|
@ -5,7 +5,9 @@ export const borderRadius = remcalc(4);
|
||||
export const bottomShaddow = `0 ${remcalc(2)} 0 0 rgba(0, 0, 0, 0.05)`;
|
||||
export const bottomShaddowDarker = `0 ${remcalc(2)} 0 0 rgba(0, 0, 0, 0.1)`;
|
||||
export const insetShaddow = `inset 0 ${remcalc(3)} 0 0 rgba(0, 0, 0, 0.05)`;
|
||||
export const tooltipShadow = `0 ${remcalc(2)} ${remcalc(6)} ${remcalc(1)} rgba(0, 0, 0, 0.1)`;
|
||||
export const tooltipShadow = `0 ${remcalc(2)} ${remcalc(6)} ${remcalc(
|
||||
1
|
||||
)} rgba(0, 0, 0, 0.1)`;
|
||||
|
||||
export const border = {
|
||||
checked: css`${remcalc(1)} solid ${props => props.theme.primary}`,
|
||||
|
@ -32,7 +32,7 @@ const InnerDescription = styled.div`
|
||||
`;
|
||||
|
||||
const Description = ({ children, ...rest }) => {
|
||||
const render = ({ collapsed = false }) => (
|
||||
const render = ({ collapsed = false }) =>
|
||||
<StyledTitle
|
||||
collapsed={collapsed}
|
||||
name="card-description"
|
||||
@ -42,8 +42,7 @@ const Description = ({ children, ...rest }) => {
|
||||
<InnerDescription collapsed={collapsed}>
|
||||
{children}
|
||||
</InnerDescription>
|
||||
</StyledTitle>
|
||||
);
|
||||
</StyledTitle>;
|
||||
|
||||
return (
|
||||
<Subscriber channel="card">
|
||||
|
@ -9,10 +9,9 @@ const StyledView = View.extend`
|
||||
background-color: ${props => props.grey};
|
||||
`;
|
||||
|
||||
const GroupView = ({ children, ...rest }) => (
|
||||
const GroupView = ({ children, ...rest }) =>
|
||||
<StyledView {...rest}>
|
||||
{children}
|
||||
</StyledView>
|
||||
);
|
||||
</StyledView>;
|
||||
|
||||
export default Baseline(GroupView);
|
||||
|
@ -71,7 +71,7 @@ const StyledCircle = styled.div`
|
||||
`;
|
||||
|
||||
const Options = ({ children, ...rest }) => {
|
||||
const render = ({ fromHeader = false, collapsed = false }) => (
|
||||
const render = ({ fromHeader = false, collapsed = false }) =>
|
||||
<StyledNav fromHeader={fromHeader} name="card-options">
|
||||
<StyledButton
|
||||
secondary={!fromHeader}
|
||||
@ -85,8 +85,7 @@ const Options = ({ children, ...rest }) => {
|
||||
<StyledCircle secondary={!fromHeader} />
|
||||
</StyledContainer>
|
||||
</StyledButton>
|
||||
</StyledNav>
|
||||
);
|
||||
</StyledNav>;
|
||||
|
||||
return (
|
||||
<Subscriber channel="card">
|
||||
|
@ -22,11 +22,10 @@ const StyledCol = Col.extend`
|
||||
`;
|
||||
|
||||
const Outlet = ({ children, ...rest }) => {
|
||||
const render = ({ collapsed = false }) => (
|
||||
const render = ({ collapsed = false }) =>
|
||||
<StyledCol name="card-outlet" collapsed={collapsed} xs={6} {...rest}>
|
||||
{children}
|
||||
</StyledCol>
|
||||
);
|
||||
</StyledCol>;
|
||||
|
||||
return (
|
||||
<Subscriber channel="card">
|
||||
|
@ -43,7 +43,7 @@ const StyledTitle = Title.extend`
|
||||
`;
|
||||
|
||||
const Subtitle = ({ children, ...props }) => {
|
||||
const render = ({ fromHeader = false, collapsed = false }) => (
|
||||
const render = ({ fromHeader = false, collapsed = false }) =>
|
||||
<StyledTitle
|
||||
name="card-subtitle"
|
||||
fromHeader={fromHeader}
|
||||
@ -53,8 +53,7 @@ const Subtitle = ({ children, ...props }) => {
|
||||
<Span fromHeader={fromHeader} collapsed={collapsed}>
|
||||
{children}
|
||||
</Span>
|
||||
</StyledTitle>
|
||||
);
|
||||
</StyledTitle>;
|
||||
|
||||
return (
|
||||
<Subscriber channel="card">
|
||||
|
@ -51,7 +51,7 @@ const Span = styled.span`
|
||||
const Title = ({ children, ...rest }) => {
|
||||
const _children = isString(children) ? <Span>{children}</Span> : children;
|
||||
|
||||
const render = ({ collapsed = false, fromHeader = false }) => (
|
||||
const render = ({ collapsed = false, fromHeader = false }) =>
|
||||
<Container
|
||||
collapsed={collapsed}
|
||||
fromHeader={fromHeader}
|
||||
@ -60,8 +60,7 @@ const Title = ({ children, ...rest }) => {
|
||||
{...rest}
|
||||
>
|
||||
{_children}
|
||||
</Container>
|
||||
);
|
||||
</Container>;
|
||||
|
||||
return (
|
||||
<Subscriber channel="card">
|
||||
|
@ -14,8 +14,7 @@ const Checkbox = Baseline(
|
||||
/**
|
||||
* @example ./usage-checkbox.md
|
||||
*/
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Checkbox {...rest}>
|
||||
{children}
|
||||
</Checkbox>
|
||||
);
|
||||
</Checkbox>;
|
||||
|
@ -34,23 +34,13 @@ class FormGroup extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
name = rndId(),
|
||||
reduxForm = false,
|
||||
...rest
|
||||
} = this.props;
|
||||
const { name = rndId(), reduxForm = false, ...rest } = this.props;
|
||||
|
||||
if (!reduxForm) {
|
||||
return this.renderGroup({});
|
||||
}
|
||||
|
||||
return (
|
||||
<Field
|
||||
name={name}
|
||||
component={this.renderGroup}
|
||||
{...rest}
|
||||
/>
|
||||
);
|
||||
return <Field name={name} component={this.renderGroup} {...rest} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,8 +7,7 @@ const Input = Baseline(BaseInput(Stylable('input')));
|
||||
/**
|
||||
* @example ./usage-input.md
|
||||
*/
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Input {...rest}>
|
||||
{children}
|
||||
</Input>
|
||||
);
|
||||
</Input>;
|
||||
|
@ -16,11 +16,11 @@ const Ul = styled.ul`
|
||||
padding: 0;
|
||||
`;
|
||||
|
||||
const RadioItem = BaseInput(({ children, id, ...rest }) => (
|
||||
const RadioItem = BaseInput(({ children, id, ...rest }) =>
|
||||
<Li {...rest}>
|
||||
{children}
|
||||
</Li>
|
||||
));
|
||||
);
|
||||
|
||||
const Radio = Baseline(
|
||||
BaseToggle({
|
||||
@ -32,10 +32,9 @@ const Radio = Baseline(
|
||||
/**
|
||||
* @example ./usage-radio.md
|
||||
*/
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Radio {...rest}>
|
||||
{children}
|
||||
</Radio>
|
||||
);
|
||||
</Radio>;
|
||||
|
||||
export const RadioList = Baseline(Ul);
|
||||
|
@ -7,8 +7,7 @@ const Select = Baseline(BaseInput(Stylable('select')));
|
||||
/**
|
||||
* @example ./usage-select.md
|
||||
*/
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Select {...rest}>
|
||||
{children}
|
||||
</Select>
|
||||
);
|
||||
</Select>;
|
||||
|
@ -130,11 +130,10 @@ const BaseToggle = BaseInput(({ children, ...rest }) => {
|
||||
/**
|
||||
* @example ./usage-toggle.md
|
||||
*/
|
||||
const Toggle = ({ children, ...rest }) => (
|
||||
const Toggle = ({ children, ...rest }) =>
|
||||
<BaseToggle {...rest}>
|
||||
{children}
|
||||
</BaseToggle>
|
||||
);
|
||||
</BaseToggle>;
|
||||
|
||||
export default Baseline(Toggle);
|
||||
|
||||
|
@ -19,10 +19,9 @@ const Box = styled.div`
|
||||
padding: ${remcalc(15)} 0;
|
||||
`;
|
||||
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Box {...rest}>
|
||||
<Brand>
|
||||
{children}
|
||||
</Brand>
|
||||
</Box>
|
||||
);
|
||||
</Box>;
|
||||
|
@ -20,11 +20,10 @@ const Header = styled.div`
|
||||
/**
|
||||
* @example ./usage.md
|
||||
*/
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Header {...rest}>
|
||||
{children}
|
||||
</Header>
|
||||
);
|
||||
</Header>;
|
||||
|
||||
export { default as Brand } from './brand';
|
||||
export { default as Item } from './item';
|
||||
|
@ -23,10 +23,9 @@ const Box = styled.div`
|
||||
max-width: ${remcalc(100)};
|
||||
`;
|
||||
|
||||
export default ({ children, ...rest }) => (
|
||||
export default ({ children, ...rest }) =>
|
||||
<Box {...rest}>
|
||||
<Text>
|
||||
{children}
|
||||
</Text>
|
||||
</Box>
|
||||
);
|
||||
</Box>;
|
||||
|
@ -26,10 +26,9 @@ const StyledLi = styled.li`
|
||||
/**
|
||||
* @example ./usage.md
|
||||
*/
|
||||
const Li = ({ children, ...rest }) => (
|
||||
const Li = ({ children, ...rest }) =>
|
||||
<StyledLi {...rest}>
|
||||
{children}
|
||||
</StyledLi>
|
||||
);
|
||||
</StyledLi>;
|
||||
|
||||
export default Baseline(Li);
|
||||
|
@ -15,10 +15,9 @@ const StyledUl = styled.ul`
|
||||
/**
|
||||
* @example ./usage.md
|
||||
*/
|
||||
const Ul = ({ children, ...rest }) => (
|
||||
const Ul = ({ children, ...rest }) =>
|
||||
<StyledUl {...rest}>
|
||||
{children}
|
||||
</StyledUl>
|
||||
);
|
||||
</StyledUl>;
|
||||
|
||||
export default Baseline(Ul);
|
||||
|
@ -55,7 +55,7 @@ const borderColor = hex =>
|
||||
])
|
||||
.toHexString();
|
||||
|
||||
const Color = ({ name, hex }) => (
|
||||
const Color = ({ name, hex }) =>
|
||||
<Box border={borderColor(hex)}>
|
||||
<Preview hex={hex} />
|
||||
<InnerBox background={hex} text={mostReadable(hex)}>
|
||||
@ -71,8 +71,7 @@ const Color = ({ name, hex }) => (
|
||||
<Strong>Hex</Strong>: <br /><code>{hex.toUpperCase()}</code>
|
||||
</Paragraph>
|
||||
</InnerBox>
|
||||
</Box>
|
||||
);
|
||||
</Box>;
|
||||
|
||||
export default () => {
|
||||
const colors = Object.keys(theme)
|
||||
@ -83,11 +82,11 @@ export default () => {
|
||||
|
||||
return _a >= _b ? -1 : 1;
|
||||
})
|
||||
.map(name => (
|
||||
.map(name =>
|
||||
<Col key={name} xs={4}>
|
||||
<Color name={name} hex={theme[name]} />
|
||||
</Col>
|
||||
));
|
||||
);
|
||||
|
||||
return (
|
||||
<Row>
|
||||
|
@ -34,10 +34,9 @@ const StyledButton = styled(Button)`
|
||||
}
|
||||
`;
|
||||
|
||||
const TooltipButton = props => (
|
||||
const TooltipButton = props =>
|
||||
<li>
|
||||
<StyledButton {...props} />
|
||||
</li>
|
||||
);
|
||||
</li>;
|
||||
|
||||
export default TooltipButton;
|
||||
|
@ -196,7 +196,7 @@ class Topology extends React.Component {
|
||||
this.setDragInfo(false);
|
||||
};
|
||||
|
||||
const renderedNode = (n, index) => (
|
||||
const renderedNode = (n, index) =>
|
||||
<TopologyNode
|
||||
key={index}
|
||||
data={n}
|
||||
@ -205,16 +205,13 @@ class Topology extends React.Component {
|
||||
onNodeTitleClick={onNodeTitleClick}
|
||||
onQuickActions={onQuickActionsClick}
|
||||
connected={n.id !== 'consul'}
|
||||
/>
|
||||
);
|
||||
/>;
|
||||
|
||||
const renderedLink = (l, index) => (
|
||||
<TopologyLink key={index} data={l} index={index} />
|
||||
);
|
||||
const renderedLink = (l, index) =>
|
||||
<TopologyLink key={index} data={l} index={index} />;
|
||||
|
||||
const renderedLinkArrow = (l, index) => (
|
||||
<TopologyLinkArrow key={index} data={l} index={index} />
|
||||
);
|
||||
const renderedLinkArrow = (l, index) =>
|
||||
<TopologyLinkArrow key={index} data={l} index={index} />;
|
||||
|
||||
const renderedNodes = this.dragInfo && this.dragInfo.dragging
|
||||
? nodesData
|
||||
|
@ -12,7 +12,7 @@ const NodeButton = ({ connected, onButtonClick, index }) => {
|
||||
const buttonCircleY =
|
||||
(height - buttonCircleRadius * 4 - buttonCircleSpacing * 2) / 2;
|
||||
|
||||
const buttonCircles = [1, 2, 3].map((item, index) => (
|
||||
const buttonCircles = [1, 2, 3].map((item, index) =>
|
||||
<GraphButtonCircle
|
||||
cx={width / 2}
|
||||
cy={
|
||||
@ -22,7 +22,7 @@ const NodeButton = ({ connected, onButtonClick, index }) => {
|
||||
r={2}
|
||||
connected={connected}
|
||||
/>
|
||||
));
|
||||
);
|
||||
|
||||
return (
|
||||
<g transform={`translate(${x}, ${y})`}>
|
||||
|
@ -67,7 +67,7 @@ const GraphNode = ({
|
||||
: {};
|
||||
|
||||
const nodeContent = data.children
|
||||
? data.children.map((d, i) => (
|
||||
? data.children.map((d, i) =>
|
||||
<GraphNodeContent
|
||||
key={i}
|
||||
child
|
||||
@ -75,7 +75,7 @@ const GraphNode = ({
|
||||
data={d}
|
||||
index={i}
|
||||
/>
|
||||
))
|
||||
)
|
||||
: <GraphNodeContent connected={connected} data={data} />;
|
||||
|
||||
return (
|
||||
|
@ -8,7 +8,7 @@ const GraphNodeMetrics = ({ connected, metrics, pos }) => {
|
||||
const { x, y } = pos;
|
||||
|
||||
const metricSpacing = 18;
|
||||
const metricsText = metrics.map((metric, index) => (
|
||||
const metricsText = metrics.map((metric, index) =>
|
||||
<GraphText
|
||||
key={index}
|
||||
x={0}
|
||||
@ -17,7 +17,7 @@ const GraphNodeMetrics = ({ connected, metrics, pos }) => {
|
||||
>
|
||||
{`${metric.name}: ${metric.value}`}
|
||||
</GraphText>
|
||||
));
|
||||
);
|
||||
|
||||
return (
|
||||
<g transform={`translate(${x}, ${y})`}>
|
||||
|
@ -5,7 +5,7 @@ import Constants from '../constants';
|
||||
import { GraphTitle, GraphHealthyCircle } from './shapes';
|
||||
import HeartIcon from './icon-heart.svg';
|
||||
|
||||
const GraphNodeTitle = ({ connected, data, onNodeTitleClick }) => (
|
||||
const GraphNodeTitle = ({ connected, data, onNodeTitleClick }) =>
|
||||
<g>
|
||||
<GraphTitle
|
||||
x={Constants.paddingLeft}
|
||||
@ -20,8 +20,7 @@ const GraphNodeTitle = ({ connected, data, onNodeTitleClick }) => (
|
||||
<GraphHealthyCircle cx={9} cy={9} r={9} />
|
||||
<HeartIcon />
|
||||
</g>
|
||||
</g>
|
||||
);
|
||||
</g>;
|
||||
|
||||
GraphNodeTitle.propTypes = {
|
||||
connected: PropTypes.bool,
|
||||
|
Loading…
Reference in New Issue
Block a user