Skip to content

Commit

Permalink
feat(cc-jenkins-info): make use of the cc-notice instead of cc-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Galimede committed Jun 30, 2023
1 parent 5ec6767 commit 88429b0
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/components/cc-jenkins-info/cc-jenkins-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../cc-icon/cc-icon.js';
import '../cc-img/cc-img.js';
import '../cc-block-section/cc-block-section.js';
import '../cc-block/cc-block.js';
import '../cc-error/cc-error.js';
import '../cc-notice/cc-notice.js';
import { css, html, LitElement } from 'lit';
import { classMap } from 'lit/directives/class-map.js';
import { iconRemixInformationFill as iconInfo } from '../../assets/cc-remix.icons.js';
Expand Down Expand Up @@ -53,10 +53,13 @@ export class CcJenkinsInfo extends LitElement {
const versions = this.versions ?? {};
const hasNewVersion = versions.current !== versions.available;

if (this.error) {
return html`<cc-notice intent="warning" message="${i18n('cc-jenkins-info.error')}"></cc-notice>`;
}

return html`
<cc-block ribbon=${i18n('cc-jenkins-info.info')} no-head>
${!this.error ? html`
<div class="info-text">${i18n('cc-jenkins-info.text')}</div>
<cc-block-section>
Expand Down Expand Up @@ -91,12 +94,6 @@ export class CcJenkinsInfo extends LitElement {
`)}
</div>
</cc-block-section>
` : ''}
${this.error ? html`
<cc-error>${i18n('cc-jenkins-info.error')}</cc-error>
` : ''}
</cc-block>
`;
}
Expand Down Expand Up @@ -136,10 +133,6 @@ export class CcJenkinsInfo extends LitElement {
.skeleton {
background-color: #bbb;
}
cc-error {
text-align: center;
}
`,
];
}
Expand Down

0 comments on commit 88429b0

Please sign in to comment.