Skip to content

Commit

Permalink
Merge pull request #2526 from timclifford/feature/ui-adding-filters-t…
Browse files Browse the repository at this point in the history
…o-problems-tab-1-x-master

UI feature: Additional selectors to problem filters tab on environments (master/1.x)
  • Loading branch information
Toby Bellwood authored Feb 23, 2021
2 parents 94d4d00 + 8946da1 commit a69ed2a
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 220 deletions.
2 changes: 1 addition & 1 deletion services/api/src/resources/problem/sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Sql = {
let q = knex('environment_problem as p')
.join('environment as e', {environment: 'e.id'}, '=', {environment: 'p.environment'})
.where('p.deleted', '=', '0000-00-00 00:00:00')
.select('p.*', {environment: 'e.id'}, { name: 'e.name', project: 'e.project',
.select('p.*', {service: 'p.lagoon_service'}, {environment: 'e.id'}, { name: 'e.name', project: 'e.project',
environmentType: 'e.environment_type', openshiftProjectName: 'e.openshift_project_name'});

if (environmentType.length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions services/ui/src/components/Dates/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import moment from "moment";

export const getFromNowTime = (date) => {
return moment(date).fromNow();
return moment.utc(date).fromNow();
};

export const getCreatedDate = (date) => {
return moment.utc(date).local().format('DD MM YYYY, HH:mm:ss');
return moment.utc(date).format('DD MM YYYY, HH:mm:ssZ');
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DrutinyDisplay = ({ problem }) => {
</div>)}
{data.service && (<div className="field-wrapper">
<label>Service</label>
<div className="severity">{data.service}</div>
<div className="service">{data.service}</div>
</div>)}
{data.created && (<div className="field-wrapper">
<label>Last detected</label>
Expand Down
2 changes: 1 addition & 1 deletion services/ui/src/components/Problem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Problem = ({ problem, display }) => {
severity: problem.severity,
source: problem.source,
created: fromNowDate,
severityScore: problem.severityScore,
service: problem.service,
associatedPackage: problem.version ? `${problem.associatedPackage}:${problem.version}` : problem.associatedPackage
};

Expand Down
Loading

0 comments on commit a69ed2a

Please sign in to comment.