Unverified Commit 31e565d6 authored by Tao Feng's avatar Tao Feng Committed by GitHub

fix: make last run state in dashboard page optional (#814)

* fix: make last run state in dashboard page optional
Signed-off-by: 's avatarfeng-tao <fengtao04@gmail.com>

* update
Signed-off-by: 's avatarfeng-tao <fengtao04@gmail.com>

* update
Signed-off-by: 's avatarfeng-tao <fengtao04@gmail.com>

* update
Signed-off-by: 's avatarfeng-tao <fengtao04@gmail.com>
parent b730effa
...@@ -160,6 +160,8 @@ export class DashboardPage extends React.Component< ...@@ -160,6 +160,8 @@ export class DashboardPage extends React.Component<
const { dashboard, isLoading } = this.props; const { dashboard, isLoading } = this.props;
const hasDescription = const hasDescription =
dashboard.description && dashboard.description.length > 0; dashboard.description && dashboard.description.length > 0;
const hasLastRunState =
dashboard.last_run_state && dashboard.last_run_state.length > 0;
if (isLoading) { if (isLoading) {
return <LoadingSpinner />; return <LoadingSpinner />;
...@@ -294,6 +296,7 @@ export class DashboardPage extends React.Component< ...@@ -294,6 +296,7 @@ export class DashboardPage extends React.Component<
uriKey={this.props.dashboard.uri} uriKey={this.props.dashboard.uri}
/> />
</EditableSection> </EditableSection>
{hasLastRunState && [
<section className="metadata-section"> <section className="metadata-section">
<div className="section-title title-3"> <div className="section-title title-3">
Last Successful Run Last Successful Run
...@@ -306,7 +309,7 @@ export class DashboardPage extends React.Component< ...@@ -306,7 +309,7 @@ export class DashboardPage extends React.Component<
}) })
: NO_TIMESTAMP_TEXT} : NO_TIMESTAMP_TEXT}
</time> </time>
</section> </section>,
<section className="metadata-section"> <section className="metadata-section">
<div className="section-title title-3">Last Run</div> <div className="section-title title-3">Last Run</div>
<div> <div>
...@@ -327,7 +330,8 @@ export class DashboardPage extends React.Component< ...@@ -327,7 +330,8 @@ export class DashboardPage extends React.Component<
/> />
</div> </div>
</div> </div>
</section> </section>,
]}
</section> </section>
</section> </section>
<ImagePreview uri={this.state.uri} redirectUrl={dashboard.url} /> <ImagePreview uri={this.state.uri} redirectUrl={dashboard.url} />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment