diff --git a/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.html b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.html new file mode 100644 index 0000000000..1e70bee3c7 --- /dev/null +++ b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.html @@ -0,0 +1,15 @@ +
+

+ {{ title | translate }} + + + +

+

+ {{ subtitle | translate }} + + View logs + +

+
+ diff --git a/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.scss b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.scss new file mode 100644 index 0000000000..42828250b6 --- /dev/null +++ b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.scss @@ -0,0 +1,15 @@ +::ng-deep .title-header { + height: 112px; + display: flex; + flex-direction: column; + justify-content: center; + + .title { + margin-bottom: 0; + } + + .subtitle { + margin-bottom: 0; + color: var(--grey-3); + } +} \ No newline at end of file diff --git a/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.ts b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.ts new file mode 100644 index 0000000000..a67b5b0b45 --- /dev/null +++ b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/common-section-card-title-header/common-section-card-title-header.component.ts @@ -0,0 +1,44 @@ +import { CommonModule } from '@angular/common'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { CommonStatusIndicatorChipComponent } from '../common-status-indicator-chip/common-status-indicator-chip.component'; +import { STATUS_INDICATOR_CHIP_TYPE } from 'upgrade_types'; + +/** + * The `app-common-section-card-search-header` component provides a common header with title and subtitle in section card. + * It contains a title, subtitle, status chip Text and variable to confirm if it should contain view Log text anchor tag. + * It will emit event when view Log text will be clicked which will notify parent component of getting clicked. + * Example usage: + * + * ``` + * + * ``` + */ + +@Component({ + standalone: true, + selector: 'app-common-section-card-title-header', + templateUrl: './common-section-card-title-header.component.html', + styleUrls: ['./common-section-card-title-header.component.scss'], + imports: [CommonModule, TranslateModule, CommonStatusIndicatorChipComponent], + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class CommonSectionCardTitleHeaderComponent { + @Input() title!: string; + @Input() subtitle!: string; + @Input() chipClass?: STATUS_INDICATOR_CHIP_TYPE; + @Input() showViewLogs?: boolean; + @Output() viewLogs = new EventEmitter<{ clicked: boolean }>(); + + viewLogsClicked(): void { + this.viewLogs.emit({ + clicked: true, + }); + } +} diff --git a/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/index.ts b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/index.ts index 188a74834b..1615f07bf8 100644 --- a/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/index.ts +++ b/frontend/projects/upgrade/src/app/shared-standalone-component-lib/components/index.ts @@ -6,6 +6,7 @@ import { CommonSectionCardSearchHeaderComponent } from './common-section-card-se import { CommonSectionCardActionButtonsComponent } from './common-section-card-action-buttons/common-section-card-action-buttons.component'; import { CommonSectionCardComponent } from './common-section-card/common-section-card.component'; import { CommonStatusIndicatorChipComponent } from './common-status-indicator-chip/common-status-indicator-chip.component'; +import { CommonSectionCardTitleHeaderComponent } from './common-section-card-title-header/common-section-card-title-header.component'; export { CommonPageComponent, @@ -14,6 +15,7 @@ export { CommonSectionCardComponent, CommonSectionCardListComponent, CommonSectionCardSearchHeaderComponent, + CommonSectionCardTitleHeaderComponent, CommonSectionCardActionButtonsComponent, CommonStatusIndicatorChipComponent, };