Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence cased text everywhere #3166

Merged
merged 3 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/api_topologies.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ var (
ID: "pseudo",
Default: "hide",
Options: []APITopologyOption{
{Value: "show", Label: "Show Unmanaged", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide Unmanaged", filter: render.IsNotPseudo, filterPseudo: true},
{Value: "show", Label: "Show unmanaged", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide unmanaged", filter: render.IsNotPseudo, filterPseudo: true},
},
}
)
Expand Down Expand Up @@ -151,8 +151,8 @@ func MakeRegistry() *Registry {
Default: "application",
Options: []APITopologyOption{
{Value: "all", Label: "All", filter: nil, filterPseudo: false},
{Value: "system", Label: "System Containers", filter: render.IsSystem, filterPseudo: false},
{Value: "application", Label: "Application Containers", filter: render.IsApplication, filterPseudo: false}},
{Value: "system", Label: "System containers", filter: render.IsSystem, filterPseudo: false},
{Value: "application", Label: "Application containers", filter: render.IsApplication, filterPseudo: false}},
},
{
ID: "stopped",
Expand All @@ -167,8 +167,8 @@ func MakeRegistry() *Registry {
ID: "pseudo",
Default: "hide",
Options: []APITopologyOption{
{Value: "show", Label: "Show Uncontained", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide Uncontained", filter: render.IsNotPseudo, filterPseudo: true},
{Value: "show", Label: "Show uncontained", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide uncontained", filter: render.IsNotPseudo, filterPseudo: true},
},
},
}
Expand All @@ -178,8 +178,8 @@ func MakeRegistry() *Registry {
ID: "unconnected",
Default: "hide",
Options: []APITopologyOption{
{Value: "show", Label: "Show Unconnected", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide Unconnected", filter: render.IsConnected, filterPseudo: false},
{Value: "show", Label: "Show unconnected", filter: nil, filterPseudo: false},
{Value: "hide", Label: "Hide unconnected", filter: render.IsConnected, filterPseudo: false},
},
},
}
Expand Down Expand Up @@ -236,15 +236,15 @@ func MakeRegistry() *Registry {
id: kubeControllersID,
parent: podsID,
renderer: render.KubeControllerRenderer,
Name: "controllers",
Name: "Controllers",
Options: []APITopologyOptionGroup{unmanagedFilter},
HideIfEmpty: true,
},
APITopologyDesc{
id: servicesID,
parent: podsID,
renderer: render.PodServiceRenderer,
Name: "services",
Name: "Services",
Options: []APITopologyOptionGroup{unmanagedFilter},
HideIfEmpty: true,
},
Expand All @@ -260,14 +260,14 @@ func MakeRegistry() *Registry {
id: ecsServicesID,
parent: ecsTasksID,
renderer: render.ECSServiceRenderer,
Name: "services",
Name: "Services",
Options: []APITopologyOptionGroup{unmanagedFilter},
HideIfEmpty: true,
},
APITopologyDesc{
id: swarmServicesID,
renderer: render.SwarmServiceRenderer,
Name: "services",
Name: "Services",
Rank: 3,
Options: []APITopologyOptionGroup{unmanagedFilter},
HideIfEmpty: true,
Expand Down
2 changes: 1 addition & 1 deletion app/api_topologies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestAPITopology(t *testing.T) {
}

// TODO: add ECS nodes in report fixture
if topology.Name == "Tasks" || topology.Name == "services" {
if topology.Name == "Tasks" || topology.Name == "Services" {
continue
}

Expand Down
20 changes: 16 additions & 4 deletions client/app/scripts/charts/nodes-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
import React from 'react';
import { connect } from 'react-redux';
import { List as makeList, Map as makeMap } from 'immutable';
import capitalize from 'lodash/capitalize';

import NodeDetailsTable from '../components/node-details/node-details-table';
import { clickNode, sortOrderChanged } from '../actions/app-actions';
import { shownNodesSelector } from '../selectors/node-filters';
import { trackAnalyticsEvent } from '../utils/tracking-utils';
import { findTopologyById } from '../utils/topology-utils';
import { TABLE_VIEW_MODE } from '../constants/naming';

import { windowHeightSelector } from '../selectors/canvas';
Expand All @@ -18,7 +20,15 @@ const IGNORED_COLUMNS = ['docker_container_ports', 'docker_container_id', 'docke
'docker_container_command', 'docker_container_networks'];


function getColumns(nodes) {
function topologyLabel(topologies, id) {
const topology = findTopologyById(topologies, id);
if (!topology) {
return capitalize(id);
}
return topology.get('fullName');
}

function getColumns(nodes, topologies) {
const metricColumns = nodes
.toList()
.flatMap((n) => {
Expand All @@ -43,11 +53,12 @@ function getColumns(nodes) {
.toList()
.sortBy(m => m.get('label'));


const relativesColumns = nodes
.toList()
.flatMap((n) => {
const metadata = (n.get('parents') || makeList())
.map(m => makeMap({ id: m.get('topologyId'), label: m.get('topologyId') }));
.map(m => makeMap({ id: m.get('topologyId'), label: topologyLabel(topologies, m.get('topologyId')) }));
return metadata;
})
.toSet()
Expand Down Expand Up @@ -108,7 +119,7 @@ class NodesGrid extends React.Component {

render() {
const {
nodes, gridSortedBy, gridSortedDesc, searchNodeMatches, searchQuery, windowHeight
nodes, gridSortedBy, gridSortedDesc, searchNodeMatches, searchQuery, windowHeight, topologies
} = this.props;
const height =
this.tableRef ? windowHeight - this.tableRef.getBoundingClientRect().top - 30 : 0;
Expand All @@ -131,7 +142,7 @@ class NodesGrid extends React.Component {
.toList()
.filter(n => !(searchQuery && searchNodeMatches.get(n.get('id'), makeMap()).isEmpty()))
.toJS(),
columns: getColumns(nodes)
columns: getColumns(nodes, topologies)
};

return (
Expand Down Expand Up @@ -167,6 +178,7 @@ function mapStateToProps(state) {
searchQuery: state.get('searchQuery'),
selectedNodeId: state.get('selectedNodeId'),
windowHeight: windowHeightSelector(state),
topologies: state.get('topologies'),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class NodeDetailsImageStatus extends React.PureComponent {
return (
<div className="node-details-content-section image-status">
<div className="node-details-content-section-header">
Container Image Status
Container image status
{containers &&
<div>
<a
Expand Down
31 changes: 1 addition & 30 deletions client/app/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,11 @@ a {
}

&-label, .pause-text {
text-transform: uppercase;
margin: 0 0.25em;
}

&-versionupdate {
margin-right: 0.5em;
text-transform: uppercase;
}

&-tools {
Expand Down Expand Up @@ -318,7 +316,6 @@ a {

&-label {
font-size: $font-size-small;
text-transform: uppercase;
}

}
Expand All @@ -327,7 +324,6 @@ a {
&-item {
&-label {
font-size: $font-size-tiny;
text-transform: uppercase;
}
}
}
Expand Down Expand Up @@ -646,7 +642,6 @@ a {
}

&-more {
text-transform: uppercase;
font-size: $font-size-tiny;
color: $color-turquoise;
margin-top: -2px;
Expand Down Expand Up @@ -716,7 +711,6 @@ a {
span {
font-size: $font-size-normal;
margin-left: 0;
text-transform: uppercase;
}
}

Expand Down Expand Up @@ -776,7 +770,6 @@ a {
&-more {
@extend .btn-opacity;
padding: 0 2px;
text-transform: uppercase;
cursor: pointer;
font-size: $font-size-tiny;
font-weight: bold;
Expand Down Expand Up @@ -835,7 +828,6 @@ a {
margin: 16px 0;

&-header {
text-transform: uppercase;
font-size: $font-size-small;
color: $text-tertiary-color;
padding: 4px 0;
Expand Down Expand Up @@ -877,7 +869,6 @@ a {

&-label {
color: $text-secondary-color;
text-transform: uppercase;
font-size: $font-size-tiny;
}
}
Expand All @@ -892,7 +883,6 @@ a {

&-label {
color: $text-secondary-color;
text-transform: uppercase;
font-size: $font-size-small;

.fa {
Expand All @@ -919,10 +909,6 @@ a {
display: flex;
color: inherit;

.label {
text-transform: uppercase;
}

.node-details-health-item {
width: auto;
}
Expand All @@ -941,7 +927,6 @@ a {
color: $text-secondary-color;
padding: 0 0.5em 0 0;
white-space: nowrap;
text-transform: uppercase;
font-size: $font-size-tiny;

&::after {
Expand Down Expand Up @@ -974,7 +959,6 @@ a {
color: $text-secondary-color;
padding: 0 0.5em 0 0;
white-space: nowrap;
text-transform: uppercase;
font-size: $font-size-tiny;

&::after {
Expand Down Expand Up @@ -1014,7 +998,6 @@ a {
}

&-header {
text-transform: uppercase;
color: $text-tertiary-color;
font-size: $font-size-tiny;
text-align: right;
Expand All @@ -1030,7 +1013,7 @@ a {
}

&-sorter {
margin: 0 0.25em;
margin: 0 0.35em;
}

&:first-child {
Expand Down Expand Up @@ -1193,7 +1176,6 @@ a {
font-weight: bold;
padding-right: 20px;
text-align: right;
text-transform: uppercase;
}
}

Expand Down Expand Up @@ -1293,7 +1275,6 @@ a {

font-size: $font-size-tiny;
font-weight: bold;
text-transform: uppercase;

&:hover {
opacity: 1;
Expand Down Expand Up @@ -1345,7 +1326,6 @@ a {
}

.link {
text-transform: uppercase;
font-weight: bold;
cursor: pointer;
float: right;
Expand Down Expand Up @@ -1374,7 +1354,6 @@ a {
padding: 0px 0;
margin-top: 4px;
text-align: right;
text-transform: uppercase;
cursor: pointer;
color: $text-secondary-color;
font-size: $font-size-small;
Expand All @@ -1391,7 +1370,6 @@ a {
margin-right: 0.5em;

&-label {
text-transform: uppercase;
margin-right: 0.25em;
}

Expand Down Expand Up @@ -1421,7 +1399,6 @@ a {
}

.status {
text-transform: uppercase;
padding: 2px 12px;
border-radius: $border-radius-soft;
color: $text-secondary-color;
Expand Down Expand Up @@ -1509,7 +1486,6 @@ a {

&-action {
background-color: transparent;
text-transform: uppercase;

&-selected, &:not([disabled]):hover {
background-color: $background-darker-secondary-color;
Expand Down Expand Up @@ -1676,7 +1652,6 @@ a {

&-hint {
font-size: $font-size-tiny;
text-transform: uppercase;
transition: opacity 0.3s 0.5s $base-ease;
opacity: 1;
}
Expand Down Expand Up @@ -1811,7 +1786,6 @@ a {

h2 {
margin: 0;
text-transform: uppercase;
font-size: $font-size-large;
}
}
Expand Down Expand Up @@ -1845,7 +1819,6 @@ a {
align-items: stretch;

h2 {
text-transform: uppercase;
line-height: 150%;
font-size: $font-size-large;
color: $color-primary-lavender;
Expand All @@ -1854,7 +1827,6 @@ a {
}

h3 {
text-transform: uppercase;
font-size: $font-size-normal;
color: $color-primary-lavender;
padding: 4px 0;
Expand Down Expand Up @@ -1918,7 +1890,6 @@ a {
flex-direction: column;

&-current-topology {
text-transform: uppercase;
color: $color-primary-lavender;
}

Expand Down
Loading