Permalink
Browse files

cleanup

  • Loading branch information...
peh committed Feb 14, 2017
1 parent d9b1d51 commit e0a151684ee9fcebd0a9c6401caeeb9c2d706f34
Showing with 231 additions and 447 deletions.
  1. +1 −1 .babelrc
  2. +1 −1 build.gradle
  3. +1 −1 grails-app/assets/javascripts/app/components/errors/entry-details.js
  4. +34 −40 grails-app/assets/javascripts/app/components/errors/error-list.js
  5. +2 −2 grails-app/assets/javascripts/app/components/tools/base-component.js
  6. +1 −2 grails-app/assets/javascripts/app/services/configuration-service.js
  7. +2 −2 grails-app/assets/javascripts/app/services/user-service.js
  8. +11 −9 grails-app/assets/stylesheets/app/_variables.scss
  9. +30 −0 grails-app/assets/stylesheets/app/components/_entry-list.scss
  10. +1 −28 grails-app/assets/stylesheets/app/components/_list-row.scss
  11. +1 −0 grails-app/assets/stylesheets/app/components/_pagination.scss
  12. +29 −0 grails-app/assets/stylesheets/app/components/_similar.scss
  13. +5 −0 grails-app/assets/stylesheets/app/main.scss
  14. +34 −0 grails-app/conf/application.groovy
  15. +1 −1 grails-app/controllers/errbuddy/{AbstractAppApiController.groovy → AbstractApiController.groovy}
  16. +5 −4 grails-app/controllers/errbuddy/ApiController.groovy
  17. +1 −1 grails-app/controllers/errbuddy/{AppApiApplicationController.groovy → ApplicationController.groovy}
  18. +1 −1 grails-app/controllers/errbuddy/{AppApiDeploymentController.groovy → DeploymentController.groovy}
  19. +1 −1 grails-app/controllers/errbuddy/{AppApiEntryGroupController.groovy → EntryGroupController.groovy}
  20. +24 −0 grails-app/controllers/errbuddy/ErrorController.groovy
  21. +1 −1 grails-app/controllers/errbuddy/{AppApiMonitoringController.groovy → MonitoringController.groovy}
  22. +12 −2 grails-app/controllers/errbuddy/ShortlinkController.groovy
  23. +23 −20 grails-app/controllers/errbuddy/UrlMappings.groovy
  24. +1 −1 grails-app/controllers/errbuddy/{AppApiUserController.groovy → UserController.groovy}
  25. +2 −1 grails-app/init/BootStrap.groovy
  26. +0 −55 grails-app/services/errbuddy/CookieService.groovy
  27. +0 −68 grails-app/services/errbuddy/FilterService.groovy
  28. +0 −136 grails-app/services/errbuddy/MessageService.groovy
  29. +4 −3 package.json
  30. +0 −15 src/main/groovy/errbuddy/CustomExceptionHandler.groovy
  31. +0 −27 src/test/groovy/errbuddy/ApiInterceptorSpec.groovy
  32. +2 −2 src/test/groovy/errbuddy/{PageControllerSpec.groovy → ErrorControllerSpec.groovy}
  33. +0 −22 src/test/groovy/errbuddy/ShortlinkControllerSpec.groovy
View
@@ -1,4 +1,4 @@
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["lodash"]
"plugins": [ "transform-decorators-legacy", "lodash"]
}
View
@@ -90,7 +90,7 @@ dependencies {
compile "com.uberall.plugins:uber-doc:2.0.4"
compile 'org.grails.plugins:elasticsearch:1.0.0.2'
compile 'org.grails.plugins:grails-jesque-admin:0.1.5'
compile 'org.grails.plugins:jesque:1.1.9'
compile 'org.grails.plugins:jesque:1.2.0'
assets 'net.errbuddy.plugins:babel-asset-pipeline:2.1.0'
@@ -267,7 +267,7 @@ export default class EntryDetails extends BaseComponent {
<h3>Actions</h3>
<EntryResolveButton entryGroup={entryGroup} withText={true} onClick={this.onResolveClicked}/>
<EntryDeleteButton entryGroup={entryGroup} withText={true} onClick={this.onDeleteClicked}/>
<EntryReportButton entryGroup={entryGroup} withText={true} onClick={this.onReportClicked}/>
{/*<EntryReportButton entryGroup={entryGroup} withText={true} onClick={this.onReportClicked}/>*/}
</div>
</div>
</section>
@@ -6,7 +6,6 @@ import BaseComponent from "../tools/base-component";
import LoadingHero from "../tools/loading-hero";
import EntryGroupTableRow from "./list-row";
import ReactPaginate from "react-paginate";
const cx = require('classnames');
const querystring = require('querystring');
@@ -16,26 +15,47 @@ export default class ErrorList extends BaseComponent {
let params = props.urlParameters || {};
let selectedApplication = this.getConfigurationService().get('errbuddy.applicaiton.selected');
this.state = {
list: [],
total: 0,
query: props.query || params.query || "",
applications: null,
selectedApplication: null,
selectedApplication: selectedApplication || null,
loading: false
};
this._bindThis('loadObjectsFromServer',
'handlePausedChange',
'setPage',
'searchQueryChanged',
'_toggleApplicationFilter',
'updateHistory',
'toggleApplicationFilter',
'changePage',
'getMax',
'getOffset',
'doLoad'
);
}
componentWillMount() {
this.getApplicationService().list(0, 10000).then(applications => {
this.setState(_.assign({}, this.state, {applications: applications.applications}));
})
}
componentWillReceiveProps(newProps) {
if (!this.props.urlParameters || _.get(newProps.urlParameters, 'offset') !== `${this.getOffset()}`) {
this.loadObjectsFromServer(newProps.urlParameters)
}
}
componentWillUnmount() {
this.stopInterval();
}
componentDidMount() {
this.loadObjectsFromServer(true);
this.setInterval(this.loadObjectsFromServer, 2000);
}
handlePausedChange(paused) {
@@ -70,35 +90,15 @@ export default class ErrorList extends BaseComponent {
});
}
componentWillMount() {
this.getApplicationService().list(0, 10000).then(applications => {
this.setState(_.assign({}, this.state, {applications: applications.applications}));
})
}
_toggleApplicationFilter(appId) {
toggleApplicationFilter(appId) {
if (this.state.selectedApplication === appId) {
appId = null
}
this.setState(_.assign(this.state, {selectedApplication: appId}))
this.getConfigurationService().set('errbuddy.applicaiton.selected', appId);
this.setState(_.assign(this.state, {selectedApplication: appId}));
this.loadObjectsFromServer(true)
}
componentWillReceiveProps(newProps) {
if (!this.props.urlParameters || _.get(newProps.urlParameters, 'offset') !== `${this.getOffset()}`) {
this.loadObjectsFromServer(newProps.urlParameters)
}
}
componentWillUnmount() {
this.stopInterval();
}
componentDidMount() {
this.loadObjectsFromServer(true);
this.setInterval(this.loadObjectsFromServer, 2000);
}
changePage(pageObj) {
if (!this.state.loading) {
let max = this.getMax();
@@ -129,25 +129,20 @@ export default class ErrorList extends BaseComponent {
let buttons = _.map(this.state.applications, (app) => {
let buttonClasses = cx('btn', {
'btn-default': app.id !== toggledApplication,
'btn-success': app.id === toggledApplication,
'active': app.id === toggledApplication,
});
return (
<button key={`app-choose-${app.id}`} type="button" className={buttonClasses} onClick={() => {
this._toggleApplicationFilter(app.id)
this.toggleApplicationFilter(app.id)
}}>{app.name}</button>
)
});
return (
<div>
<div className="row">
<div className="col-sm-12">
<div className="btn-group" role="group">
<div className="entry-list-container">
<div className="head">
<div className="btn-group application-chooser" role="group">
{buttons}
</div>
</div>
</div>
<div className="row">
<div className="col-sm-12">
<ReactPaginate
pageCount={Math.ceil(total / max)}
pageRangeDisplayed={4}
@@ -160,7 +155,6 @@ export default class ErrorList extends BaseComponent {
activeClassName="active"
containerClassName="pagination"
/>
</div>
</div>
<div className="row">
<div className="col-sm-12">
@@ -42,7 +42,7 @@ export default class BaseComponent extends React.Component {
let url = "";
if (params) {
let cleanParams = {};
_.each(params, (v, k)=> {
_.each(params, (v, k) => {
if (v !== null && v !== "") {
cleanParams[k] = v
}
@@ -73,7 +73,7 @@ export default class BaseComponent extends React.Component {
}
setInterval(fn, int) {
this.interval = setInterval(()=> {
this.interval = setInterval(() => {
this.doInterval(fn)
}, int)
}
@@ -1,6 +1,5 @@
/* globals localStorage */
const INSTANCE = null
const INSTANCE = null;
export default class ConfigurationService {
constructor() {
@@ -1,8 +1,8 @@
'use strict';
import 'whatwg-fetch';
import BaseService from "./base-service";
var AppEvents = require('../events/application-events');
const AppEvents = require('../events/application-events');
const PATH = '/api/app/users/';
export default class UserService extends BaseService {
@@ -1,9 +1,11 @@
@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,700);
$base-font: 'Open Sans', sans-serif !important;
$base-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
$errbuddy-blue: #2C3E50;
$brand-primary: $errbuddy-blue;
$danger-base: rgba(169, 68, 68, 0.7);
$warning-base: rgba(226, 157, 63, 0.7);
$ok-base: rgba(86, 169, 87, 0.7);
$navbar-border-color: #A9A9A9;
$apps-color: #64c6c9;
$pagination-active-bg: $errbuddy-blue;
@@ -42,17 +44,17 @@ $navbar-default-toggle-hover-bg: darken($navbar-default-bg, 10%);
$navbar-default-toggle-icon-bar-bg: #fff;
$navbar-default-toggle-border-color: darken($navbar-default-bg, 10%);
$similar-danger-bg: rgba(169, 68, 68, 0.7);
$similar-danger-bg: $danger-base;
$similar-danger-hover-bg: rgba($similar-danger-bg, 0.9);
$similar-danger-text: rgba(255,255,255,0.9); // lighten($similar-danger-bg, 50%);
$similar-danger-text: rgba(255, 255, 255, 0.9); // lighten($similar-danger-bg, 50%);
$similar-warning-bg: rgba(226, 157, 63, 0.7);
$similar-warning-bg: $warning-base;
$similar-warning-hover-bg: rgba($similar-warning-bg, 0.9);
$similar-warning-text: rgba(255,255,255,0.9); // lighten($similar-warning-bg, 50%);
$similar-warning-text: rgba(255, 255, 255, 0.9); // lighten($similar-warning-bg, 50%);
$similar-okay-bg: rgba(86, 169, 87, 0.7);
$similar-okay-bg: $ok-base;
$similar-okay-hover-bg: rgba($similar-okay-bg, 0.9);
$similar-okay-text: rgba(255,255,255,0.9); // lighten($similar-okay-bg, 50%);
$similar-okay-text: rgba(255, 255, 255, 0.9); // lighten($similar-okay-bg, 50%);
$glow-transition-length: 0.3s;
@@ -0,0 +1,30 @@
@import "../variables";
@import "similar";
.entry-list-container {
display: flex;
flex-direction: column;
width: 100%;
.head {
display: flex;
flex-direction: row;
justify-content: space-between;
flex: 0 0;
margin-bottom: 10px;
.application-chooser {
button.btn {
font-weight: 400;
&:active, &.active {
box-shadow: none;
}
&.active {
background: $ok-base;
color: #fff;
}
}
}
}
.list {
flex: 0 1;
}
}
@@ -1,5 +1,5 @@
@import "../variables";
@import "similar";
.list-row {
padding: 3px;
@@ -55,31 +55,4 @@
}
}
.similar {
font-weight: bold;
font-size: 15px;
margin-right: 0;
margin-left: auto;
display: block;
text-align: center;
width: 150px;
max-width: 150px;
border-radius: 3px;
padding: 3px 10px;
&.danger {
background: $similar-danger-bg;
color: $similar-danger-text;
}
&.warn {
background: $similar-warning-bg;
color: $similar-warning-text;
}
&.okay {
background: $similar-okay-bg;
color: $similar-okay-text;
}
&.details-pill {
margin-bottom: 2px;
}
}
}
@@ -1,6 +1,7 @@
$pagination-color: #337ab7;
.pagination {
margin: 0;
&.disabled {
a {
color: #999 !important;
@@ -0,0 +1,29 @@
@import "../variables";
.similar {
font-weight: bold;
font-size: 15px;
margin-right: 0;
margin-left: auto;
display: block;
text-align: center;
width: 150px;
max-width: 150px;
border-radius: 3px;
padding: 3px 10px;
&.danger {
background: $similar-danger-bg;
color: $similar-danger-text;
}
&.warn {
background: $similar-warning-bg;
color: $similar-warning-text;
}
&.okay {
background: $similar-okay-bg;
color: $similar-okay-text;
}
&.details-pill {
margin-bottom: 2px;
}
}
@@ -9,11 +9,16 @@ $fa-font-path: "~font-awesome/fonts";
@import "./components/entry-details";
@import "./components/monitoring-list";
@import "./components/pagination";
@import "./components/entry-list";
*, *:before, *:after {
box-sizing: border-box;
}
h1, h2, h3, h4, h5 ,h6 {
font-weight: 400;
}
#app-body {
width: 100vw;
height: 100vh;
Oops, something went wrong.

0 comments on commit e0a1516

Please sign in to comment.