Skip to content

Commit

Permalink
fix: styling search result
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Oct 11, 2024
1 parent 96cc30b commit b6f7ee2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,35 @@
<ng-container *ngIf="col.isDropdown">
{{ 'ENUMS.ANNOUNCEMENT_' + col.header + '.' + rowData[col.field] | translate }}
</ng-container>
<ng-container *ngIf="!(col.isDropdown || col.isDate || col.limit)">
<ng-container *ngIf="col.field !== 'workspaceName' && col.field !== 'productName'">
{{ rowData[col.field] }}</ng-container
>
<ng-container *ngIf="col.field === 'workspaceName' && isWorkspace(rowData.workspaceName)">
{{ getDisplayNameWorkspace(rowData[col.field]) }}
</ng-container>
<ng-container *ngIf="col.field === 'productName' && !rowData.productName">
{{ 'ANNOUNCEMENT.EVERY_PRODUCT' | translate }}
</ng-container>
<ng-container *ngIf="col.field === 'productName'">
{{ getDisplayNameProduct(rowData[col.field]) }}
</ng-container>
<ng-container *ngIf="col.field === 'workspaceName' && !isWorkspace(rowData.workspaceName)">
{{ getTranslationKeyForNonExistingWorkspaces(rowData.workspaceName) | translate }}
</ng-container>

<ng-container *ngIf="col.field === 'status'">
<span
*ngIf="rowData[col.field] === 'ACTIVE'"
class="pi pi-circle-on"
[pTooltip]="'ENUMS.ANNOUNCEMENT_STATUS.ACTIVE' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></span>
<span
*ngIf="rowData[col.field] === 'INACTIVE'"
class="pi pi-circle-off"
[pTooltip]="'ENUMS.ANNOUNCEMENT_STATUS.INACTIVE' | translate"
tooltipPosition="top"
tooltipEvent="hover"
></span>
</ng-container>

<ng-container *ngIf="col.field === 'workspaceName' && isWorkspace(rowData.workspaceName)">
{{ getDisplayNameWorkspace(rowData[col.field]) }}
</ng-container>
<ng-container *ngIf="col.field === 'workspaceName' && !isWorkspace(rowData.workspaceName)">
{{ getTranslationKeyForNonExistingWorkspaces(rowData.workspaceName) | translate }}
</ng-container>
<ng-container *ngIf="col.field === 'productName' && !rowData.productName">
{{ 'ANNOUNCEMENT.EVERY_PRODUCT' | translate }}
</ng-container>
<ng-container *ngIf="col.field === 'productName'">
{{ getDisplayNameProduct(rowData[col.field]) }}
</ng-container>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type ExtendedColumn = Column & {
isDropdown?: true
css?: string
limit?: boolean
needsDisplayName?: boolean
}
type ChangeMode = 'VIEW' | 'NEW' | 'EDIT'

Expand Down Expand Up @@ -57,6 +58,13 @@ export class AnnouncementSearchComponent implements OnInit {
public limitText = limitText

public columns: ExtendedColumn[] = [
{
field: 'status',
header: 'STATUS',
active: true,
translationPrefix: 'ANNOUNCEMENT',
css: 'text-center hidden sm:table-cell'
},
{
field: 'title',
header: 'TITLE',
Expand All @@ -69,14 +77,16 @@ export class AnnouncementSearchComponent implements OnInit {
header: 'WORKSPACE',
active: true,
translationPrefix: 'ANNOUNCEMENT',
css: 'text-center hidden xl:table-cell'
css: 'text-center hidden xl:table-cell',
needsDisplayName: true
},
{
field: 'productName',
header: 'APPLICATION',
active: true,
translationPrefix: 'ANNOUNCEMENT',
css: 'hidden sm:table-cell'
css: 'hidden lg:table-cell',
needsDisplayName: true
},
{
field: 'type',
Expand All @@ -86,14 +96,6 @@ export class AnnouncementSearchComponent implements OnInit {
css: 'text-center hidden xl:table-cell',
isDropdown: true
},
{
field: 'status',
header: 'STATUS',
active: true,
translationPrefix: 'ANNOUNCEMENT',
css: 'text-center hidden lg:table-cell',
isDropdown: true
},
{
field: 'priority',
header: 'PRIORITY',
Expand All @@ -116,7 +118,7 @@ export class AnnouncementSearchComponent implements OnInit {
header: 'END_DATE',
active: true,
translationPrefix: 'ANNOUNCEMENT',
css: 'text-center hidden sm:table-cell',
css: 'text-center hidden md:table-cell',
hasFilter: true,
isDate: true
}
Expand Down

0 comments on commit b6f7ee2

Please sign in to comment.