Skip to content
Snippets Groups Projects
Commit dea8cf32 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5010-OZG-5577 Fix bug on wrong icons in attachments

parent eaf3ec48
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
[attr.aria-label]="'Anhang: Dateiname: ' + file.name" [attr.aria-label]="'Anhang: Dateiname: ' + file.name"
> >
<ods-spinner-icon spinner *ngIf="isLoading" class="mr-3 size-10" /> <ods-spinner-icon spinner *ngIf="isLoading" class="mr-3 size-10" />
<ods-icon icon name="file-pdf" class="mr-3 size-10 fill-primary"></ods-icon> <ods-icon
icon
[name]="'file-' + getIconType(file.contentType)"
class="mr-3 size-10 fill-primary"
></ods-icon>
<button <button
close close
*ngIf="deletable" *ngIf="deletable"
......
...@@ -34,6 +34,11 @@ export class BinaryFile2Component { ...@@ -34,6 +34,11 @@ export class BinaryFile2Component {
return isNil(this.stateResource) ? createEmptyStateResource<Resource>() : this.stateResource; return isNil(this.stateResource) ? createEmptyStateResource<Resource>() : this.stateResource;
} }
getIconType(type: string): string {
if (type.startsWith('image')) return 'image';
return type.split('/')[1];
}
downloadFile(): void { downloadFile(): void {
this.startDownload.emit(this.file); this.startDownload.emit(this.file);
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<ng-content select="[spinner]"></ng-content> <ng-content select="[spinner]"></ng-content>
<ng-content select="[icon]"></ng-content> <ng-content select="[icon]"></ng-content>
<div class="flex w-full flex-col items-start"> <div class="flex w-full flex-col items-start">
<p class="text-sm">{{ documentName }}</p> <p class="text-sm text-start">{{ documentName }}</p>
<p class="text-xs text-ozggray-600">{{ description }}</p> <p class="text-xs text-ozggray-600">{{ description }}</p>
</div> </div>
<ng-content select="[close]"></ng-content> <ng-content select="[close]"></ng-content>
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
viewBox="0 0 32 40" viewBox="0 0 32 40"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
class="fill-pdf" [ngClass]="getFileIconFill(name)"
> >
<path <path
d="M32 12L20 0H4C1.8 0 0.0200005 1.8 0.0200005 4L0 36C0 38.2 1.78 40 3.98 40H28C30.2 40 32 38.2 32 36V12ZM28 36H4V4H18V14H28V36Z" d="M32 12L20 0H4C1.8 0 0.0200005 1.8 0.0200005 4L0 36C0 38.2 1.78 40 3.98 40H28C30.2 40 32 38.2 32 36V12ZM28 36H4V4H18V14H28V36Z"
......
...@@ -11,4 +11,20 @@ export class IconComponent { ...@@ -11,4 +11,20 @@ export class IconComponent {
@Input() name!: string; @Input() name!: string;
@Input() fillColor: string = 'black'; @Input() fillColor: string = 'black';
@Input() size: string = '100%'; @Input() size: string = '100%';
getFileIconFill(type: string): string {
switch (type.split('-')[1]) {
case 'pdf':
case 'exclamation':
case 'generate':
case 'upload':
return 'fill-pdf';
case 'doc':
case 'docx':
return 'fill-doc';
case 'image':
return 'fill-ozggray-800';
}
return 'fill-ozggray-300';
}
} }
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
--color-abgelehnt-500: 0 100% 60%; --color-abgelehnt-500: 0 100% 60%;
--color-pdf: 4 62% 63%; --color-pdf: 4 62% 63%;
--color-doc: 219 63% 54%;
} }
.dark { .dark {
......
...@@ -51,8 +51,10 @@ module.exports = { ...@@ -51,8 +51,10 @@ module.exports = {
ozggray: { ozggray: {
100: 'hsl(0, 0%, 92%)', 100: 'hsl(0, 0%, 92%)',
200: 'hsla(0, 0%, 94%)', 200: 'hsla(0, 0%, 94%)',
300: 'hsla(0, 0%, 77%)',
600: 'hsla(0, 0%, 0%, 0.4)', 600: 'hsla(0, 0%, 0%, 0.4)',
700: 'hsl(213, 27%, 84%)', 700: 'hsl(213, 27%, 84%)',
800: 'hsl(0, 0%, 43%)',
DEFAULT: 'hsl(0, 0%, 98%)', DEFAULT: 'hsl(0, 0%, 98%)',
}, },
background: { background: {
...@@ -74,6 +76,9 @@ module.exports = { ...@@ -74,6 +76,9 @@ module.exports = {
pdf: { pdf: {
DEFAULT: 'hsl(var(--color-pdf) / <alpha-value>)', DEFAULT: 'hsl(var(--color-pdf) / <alpha-value>)',
}, },
doc: {
DEFAULT: 'hsl(var(--color-doc) / <alpha-value>)',
},
mainbg: 'hsl(var(--color-mainbg) / <alpha-value>)', mainbg: 'hsl(var(--color-mainbg) / <alpha-value>)',
primary: { primary: {
600: 'hsl(var(--color-primary-600) / <alpha-value>)', 600: 'hsl(var(--color-primary-600) / <alpha-value>)',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment