Skip to content

Commit

Permalink
Fix logs (#395)
Browse files Browse the repository at this point in the history
* Edit logs resource. Add polling for logs

* Description is rendered as HTML

* Change sidebar icon

* Edit favicon and logo for preferences page
  • Loading branch information
jamakase authored Sep 23, 2020
1 parent e3297eb commit 916f181
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 111 deletions.
Binary file modified airbyte-webapp/public/favicon.ico
Binary file not shown.
Binary file added airbyte-webapp/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 0 additions & 65 deletions airbyte-webapp/public/logo.svg

This file was deleted.

Binary file modified airbyte-webapp/public/logo112.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified airbyte-webapp/public/logo224.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified airbyte-webapp/public/logo336.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 35 additions & 23 deletions airbyte-webapp/public/simpleLogo.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Img = styled.img`
const BaseClearView: React.FC = props => {
return (
<Content>
<Img src={"/logo.svg"} width={112} height={112} alt={"logo"} />
<Img src={"/logo.png"} width={112} height={112} alt={"logo"} />
{props.children}
</Content>
);
Expand Down
5 changes: 5 additions & 0 deletions airbyte-webapp/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ const Content = styled.label<{ additionLength?: number | string }>`
${({ additionLength }) =>
additionLength === 0 || additionLength ? additionLength : 30}px
);
& a {
text-decoration: underline;
color: #625eff;
}
`;

const MessageText = styled.span<{ error?: boolean; success?: boolean }>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Field, FieldProps } from "formik";
import { FormattedMessage, useIntl } from "react-intl";
import { FormattedHTMLMessage, FormattedMessage, useIntl } from "react-intl";
import React from "react";
import styled from "styled-components";

Expand Down Expand Up @@ -160,7 +160,14 @@ const FormContent: React.FC<IProps> = ({
/>
)
}
message={condition?.description}
message={
condition?.description ? (
<FormattedHTMLMessage
id="1"
defaultMessage={condition?.description}
/>
) : null
}
placeholder={
condition?.examples?.length ? condition?.examples[0] : ""
}
Expand Down
3 changes: 1 addition & 2 deletions airbyte-webapp/src/core/resources/Job.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Resource, FetchOptions } from "rest-hooks";
import BaseResource from "./BaseResource";
import JobLogsResource from "./JobLogs";

export interface Job {
id: number;
Expand Down Expand Up @@ -45,7 +44,7 @@ export default class JobResource extends BaseResource implements Job {
...super.detailShape(),
schema: {
job: this.asSchema(),
logs: JobLogsResource.asSchema()
logs: { logLines: [] }
}
};
}
Expand Down
15 changes: 0 additions & 15 deletions airbyte-webapp/src/core/resources/JobLogs.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { useResource } from "rest-hooks";
import { useResource, useSubscription } from "rest-hooks";
import { FormattedMessage } from "react-intl";
import styled from "styled-components";

Expand All @@ -18,16 +18,16 @@ const Logs = styled.div`

const JobLogs: React.FC<IProps> = ({ id }) => {
const job = useResource(JobResource.detailShape(), { id });
useSubscription(JobResource.detailShape(), { id });

if (!job.logs.logLines.length) {
if (!job.logs.logLines?.length) {
return (
<Logs>
<FormattedMessage id="sources.emptyLogs" />
</Logs>
);
}

// now logs always empty. TODO: Test ui with data
return (
<Logs>
{job.logs.logLines.map((item, key) => (
Expand Down

0 comments on commit 916f181

Please sign in to comment.