diff --git a/frontend/angular.json b/frontend/angular.json index 53b712d..12f699d 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -48,7 +48,13 @@ "maximumError": "8kB" } ], - "outputHashing": "all" + "outputHashing": "all", + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ] }, "development": { "optimization": false, diff --git a/frontend/src/app/components/home/home.ts b/frontend/src/app/components/home/home.ts index 2350e2a..6f8d1e3 100644 --- a/frontend/src/app/components/home/home.ts +++ b/frontend/src/app/components/home/home.ts @@ -31,6 +31,8 @@ export class HomeComponent implements OnInit { } isMaterialIcon(iconUrl: string): boolean { - return this.iconService.isValidIcon(iconUrl); + // Akzeptiere alle Werte die wie Icon-Namen aussehen (nur Kleinbuchstaben und Unterstriche) + // Nicht nur die in der kuratierten Liste + return this.iconService.looksLikeIconName(iconUrl); } } \ No newline at end of file diff --git a/frontend/src/app/components/item-form/item-form.html b/frontend/src/app/components/item-form/item-form.html index e39daab..cdd0328 100644 --- a/frontend/src/app/components/item-form/item-form.html +++ b/frontend/src/app/components/item-form/item-form.html @@ -44,6 +44,14 @@ + + +
Vorschau: diff --git a/frontend/src/app/components/item-form/item-form.scss b/frontend/src/app/components/item-form/item-form.scss index 2ef71ce..7179a9a 100644 --- a/frontend/src/app/components/item-form/item-form.scss +++ b/frontend/src/app/components/item-form/item-form.scss @@ -25,6 +25,31 @@ mat-form-field { } .icon-picker-section { + .icon-browse-link { + margin-bottom: 16px; + + a { + display: inline-flex; + align-items: center; + gap: 8px; + color: #1976d2; + text-decoration: none; + font-size: 14px; + transition: color 0.2s; + + &:hover { + color: #1565c0; + text-decoration: underline; + } + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + } + } + } + .icon-preview { display: flex; align-items: center; diff --git a/frontend/src/app/components/item-form/item-form.ts b/frontend/src/app/components/item-form/item-form.ts index a7853af..5872db9 100644 --- a/frontend/src/app/components/item-form/item-form.ts +++ b/frontend/src/app/components/item-form/item-form.ts @@ -118,7 +118,7 @@ export class ItemFormComponent implements OnInit { if (this.isEditMode) { this.apiService.updateItem(this.itemId!, itemData).subscribe(() => { - this.router.navigate(['/']); + this.router.navigate(['/admin']); }); } else { this.apiService.createItem(itemData).subscribe(() => { @@ -129,6 +129,6 @@ export class ItemFormComponent implements OnInit { } cancel(): void { - this.router.navigate(['/']); + this.router.navigate(['/admin']); } } \ No newline at end of file diff --git a/frontend/src/app/services/api.ts b/frontend/src/app/services/api.ts index 2c80d97..ac2dd3e 100644 --- a/frontend/src/app/services/api.ts +++ b/frontend/src/app/services/api.ts @@ -2,12 +2,13 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { Item } from '../models/item'; +import { environment } from '../../environments/environment'; @Injectable({ providedIn: 'root' }) export class Api { - private apiUrl = '/api/items'; + private apiUrl = environment.apiUrl; constructor(private http: HttpClient) { } diff --git a/frontend/src/app/services/icon.service.ts b/frontend/src/app/services/icon.service.ts index c882087..0400f24 100644 --- a/frontend/src/app/services/icon.service.ts +++ b/frontend/src/app/services/icon.service.ts @@ -18,8 +18,17 @@ export class IconService { { name: 'apps', category: 'Navigation' }, { name: 'arrow_back', category: 'Navigation' }, { name: 'arrow_forward', category: 'Navigation' }, + { name: 'arrow_upward', category: 'Navigation' }, + { name: 'arrow_downward', category: 'Navigation' }, { name: 'expand_more', category: 'Navigation' }, { name: 'expand_less', category: 'Navigation' }, + { name: 'fullscreen', category: 'Navigation' }, + { name: 'fullscreen_exit', category: 'Navigation' }, + { name: 'refresh', category: 'Navigation' }, + { name: 'more_vert', category: 'Navigation' }, + { name: 'more_horiz', category: 'Navigation' }, + { name: 'close', category: 'Navigation' }, + { name: 'check', category: 'Navigation' }, // Web & Browser { name: 'web', category: 'Web' }, @@ -29,96 +38,267 @@ export class IconService { { name: 'http', category: 'Web' }, { name: 'https', category: 'Web' }, { name: 'vpn_lock', category: 'Web' }, + { name: 'domain', category: 'Web' }, + { name: 'dns', category: 'Web' }, + { name: 'wifi', category: 'Web' }, + { name: 'router', category: 'Web' }, + { name: 'storage', category: 'Web' }, + { name: 'cloud_queue', category: 'Web' }, + { name: 'cloud_done', category: 'Web' }, + { name: 'cloud_off', category: 'Web' }, // Kommunikation { name: 'email', category: 'Kommunikation' }, { name: 'mail', category: 'Kommunikation' }, + { name: 'mail_outline', category: 'Kommunikation' }, { name: 'chat', category: 'Kommunikation' }, + { name: 'chat_bubble', category: 'Kommunikation' }, { name: 'message', category: 'Kommunikation' }, { name: 'forum', category: 'Kommunikation' }, { name: 'phone', category: 'Kommunikation' }, + { name: 'call', category: 'Kommunikation' }, + { name: 'video_call', category: 'Kommunikation' }, + { name: 'voicemail', category: 'Kommunikation' }, + { name: 'textsms', category: 'Kommunikation' }, + { name: 'contact_mail', category: 'Kommunikation' }, + { name: 'contacts', category: 'Kommunikation' }, // Content { name: 'create', category: 'Content' }, { name: 'edit', category: 'Content' }, { name: 'add', category: 'Content' }, + { name: 'add_circle', category: 'Content' }, + { name: 'remove', category: 'Content' }, { name: 'delete', category: 'Content' }, + { name: 'delete_outline', category: 'Content' }, { name: 'content_copy', category: 'Content' }, + { name: 'content_cut', category: 'Content' }, + { name: 'content_paste', category: 'Content' }, { name: 'save', category: 'Content' }, + { name: 'save_alt', category: 'Content' }, + { name: 'undo', category: 'Content' }, + { name: 'redo', category: 'Content' }, + { name: 'archive', category: 'Content' }, + { name: 'unarchive', category: 'Content' }, + { name: 'flag', category: 'Content' }, + { name: 'sort', category: 'Content' }, + { name: 'filter_list', category: 'Content' }, // Dateien & Ordner { name: 'folder', category: 'Dateien' }, { name: 'folder_open', category: 'Dateien' }, + { name: 'folder_shared', category: 'Dateien' }, + { name: 'folder_special', category: 'Dateien' }, + { name: 'create_new_folder', category: 'Dateien' }, { name: 'description', category: 'Dateien' }, { name: 'insert_drive_file', category: 'Dateien' }, + { name: 'text_snippet', category: 'Dateien' }, + { name: 'article', category: 'Dateien' }, + { name: 'attachment', category: 'Dateien' }, { name: 'cloud', category: 'Dateien' }, { name: 'cloud_upload', category: 'Dateien' }, { name: 'cloud_download', category: 'Dateien' }, + { name: 'download', category: 'Dateien' }, + { name: 'upload', category: 'Dateien' }, + { name: 'file_download', category: 'Dateien' }, + { name: 'file_upload', category: 'Dateien' }, // Medien { name: 'image', category: 'Medien' }, { name: 'photo', category: 'Medien' }, + { name: 'photo_camera', category: 'Medien' }, + { name: 'photo_library', category: 'Medien' }, { name: 'video_library', category: 'Medien' }, { name: 'movie', category: 'Medien' }, + { name: 'videocam', category: 'Medien' }, { name: 'music_note', category: 'Medien' }, { name: 'audiotrack', category: 'Medien' }, + { name: 'library_music', category: 'Medien' }, + { name: 'play_arrow', category: 'Medien' }, + { name: 'pause', category: 'Medien' }, + { name: 'stop', category: 'Medien' }, + { name: 'skip_next', category: 'Medien' }, + { name: 'skip_previous', category: 'Medien' }, + { name: 'volume_up', category: 'Medien' }, + { name: 'volume_off', category: 'Medien' }, // Business { name: 'work', category: 'Business' }, { name: 'business', category: 'Business' }, + { name: 'business_center', category: 'Business' }, { name: 'store', category: 'Business' }, + { name: 'storefront', category: 'Business' }, { name: 'shopping_cart', category: 'Business' }, + { name: 'shopping_bag', category: 'Business' }, { name: 'payment', category: 'Business' }, + { name: 'credit_card', category: 'Business' }, { name: 'account_balance', category: 'Business' }, + { name: 'account_balance_wallet', category: 'Business' }, + { name: 'monetization_on', category: 'Business' }, + { name: 'attach_money', category: 'Business' }, + { name: 'trending_up', category: 'Business' }, + { name: 'trending_down', category: 'Business' }, + { name: 'show_chart', category: 'Business' }, + { name: 'bar_chart', category: 'Business' }, + { name: 'pie_chart', category: 'Business' }, // Sozial { name: 'person', category: 'Sozial' }, + { name: 'person_outline', category: 'Sozial' }, { name: 'people', category: 'Sozial' }, { name: 'group', category: 'Sozial' }, { name: 'account_circle', category: 'Sozial' }, + { name: 'account_box', category: 'Sozial' }, { name: 'favorite', category: 'Sozial' }, + { name: 'favorite_border', category: 'Sozial' }, + { name: 'thumb_up', category: 'Sozial' }, + { name: 'thumb_down', category: 'Sozial' }, { name: 'share', category: 'Sozial' }, + { name: 'cake', category: 'Sozial' }, + { name: 'public', category: 'Sozial' }, + { name: 'sentiment_satisfied', category: 'Sozial' }, + { name: 'mood', category: 'Sozial' }, // System { name: 'settings', category: 'System' }, + { name: 'settings_applications', category: 'System' }, { name: 'build', category: 'System' }, + { name: 'build_circle', category: 'System' }, { name: 'search', category: 'System' }, { name: 'info', category: 'System' }, + { name: 'info_outline', category: 'System' }, { name: 'help', category: 'System' }, + { name: 'help_outline', category: 'System' }, { name: 'warning', category: 'System' }, { name: 'error', category: 'System' }, + { name: 'error_outline', category: 'System' }, { name: 'check_circle', category: 'System' }, + { name: 'check_circle_outline', category: 'System' }, { name: 'notifications', category: 'System' }, + { name: 'notifications_active', category: 'System' }, + { name: 'notifications_off', category: 'System' }, + { name: 'update', category: 'System' }, + { name: 'sync', category: 'System' }, + { name: 'power_settings_new', category: 'System' }, + { name: 'visibility', category: 'System' }, + { name: 'visibility_off', category: 'System' }, // Geräte { name: 'computer', category: 'Geräte' }, + { name: 'desktop_windows', category: 'Geräte' }, { name: 'phone_android', category: 'Geräte' }, + { name: 'phone_iphone', category: 'Geräte' }, { name: 'tablet', category: 'Geräte' }, + { name: 'tablet_mac', category: 'Geräte' }, { name: 'laptop', category: 'Geräte' }, + { name: 'laptop_mac', category: 'Geräte' }, { name: 'tv', category: 'Geräte' }, { name: 'watch', category: 'Geräte' }, + { name: 'smartphone', category: 'Geräte' }, + { name: 'devices', category: 'Geräte' }, + { name: 'headset', category: 'Geräte' }, + { name: 'keyboard', category: 'Geräte' }, + { name: 'mouse', category: 'Geräte' }, + { name: 'print', category: 'Geräte' }, + { name: 'scanner', category: 'Geräte' }, - // Entwicklung + // Entwicklung & Git { name: 'code', category: 'Entwicklung' }, + { name: 'code_off', category: 'Entwicklung' }, { name: 'developer_mode', category: 'Entwicklung' }, { name: 'bug_report', category: 'Entwicklung' }, { name: 'terminal', category: 'Entwicklung' }, { name: 'api', category: 'Entwicklung' }, + { name: 'integration_instructions', category: 'Entwicklung' }, + { name: 'source', category: 'Entwicklung' }, + { name: 'account_tree', category: 'Entwicklung' }, + { name: 'fork_right', category: 'Entwicklung' }, + { name: 'merge_type', category: 'Entwicklung' }, + { name: 'commit', category: 'Entwicklung' }, + { name: 'compare_arrows', category: 'Entwicklung' }, + { name: 'difference', category: 'Entwicklung' }, + { name: 'webhook', category: 'Entwicklung' }, + { name: 'data_object', category: 'Entwicklung' }, + { name: 'database', category: 'Entwicklung' }, + { name: 'schema', category: 'Entwicklung' }, + { name: 'memory', category: 'Entwicklung' }, + { name: 'developer_board', category: 'Entwicklung' }, // Sicherheit { name: 'lock', category: 'Sicherheit' }, { name: 'lock_open', category: 'Sicherheit' }, + { name: 'lock_outline', category: 'Sicherheit' }, { name: 'security', category: 'Sicherheit' }, { name: 'verified_user', category: 'Sicherheit' }, + { name: 'verified', category: 'Sicherheit' }, { name: 'vpn_key', category: 'Sicherheit' }, + { name: 'vpn_lock', category: 'Sicherheit' }, + { name: 'shield', category: 'Sicherheit' }, + { name: 'fingerprint', category: 'Sicherheit' }, + { name: 'admin_panel_settings', category: 'Sicherheit' }, + { name: 'privacy_tip', category: 'Sicherheit' }, + { name: 'key', category: 'Sicherheit' }, + + // Orte & Karten + { name: 'location_on', category: 'Orte' }, + { name: 'location_off', category: 'Orte' }, + { name: 'map', category: 'Orte' }, + { name: 'place', category: 'Orte' }, + { name: 'navigation', category: 'Orte' }, + { name: 'explore', category: 'Orte' }, + { name: 'local_cafe', category: 'Orte' }, + { name: 'local_restaurant', category: 'Orte' }, + { name: 'local_pizza', category: 'Orte' }, + { name: 'local_bar', category: 'Orte' }, + { name: 'local_hotel', category: 'Orte' }, + { name: 'local_airport', category: 'Orte' }, + { name: 'flight', category: 'Orte' }, + { name: 'directions_car', category: 'Orte' }, + { name: 'directions_bus', category: 'Orte' }, + { name: 'train', category: 'Orte' }, + + // Zeit & Kalender + { name: 'schedule', category: 'Zeit' }, + { name: 'access_time', category: 'Zeit' }, + { name: 'alarm', category: 'Zeit' }, + { name: 'timer', category: 'Zeit' }, + { name: 'event', category: 'Zeit' }, + { name: 'calendar_today', category: 'Zeit' }, + { name: 'calendar_month', category: 'Zeit' }, + { name: 'date_range', category: 'Zeit' }, + { name: 'today', category: 'Zeit' }, + { name: 'history', category: 'Zeit' }, + + // Tools & Utilities + { name: 'construction', category: 'Tools' }, + { name: 'handyman', category: 'Tools' }, + { name: 'engineering', category: 'Tools' }, + { name: 'science', category: 'Tools' }, + { name: 'calculate', category: 'Tools' }, + { name: 'rule', category: 'Tools' }, + { name: 'colorize', category: 'Tools' }, + { name: 'palette', category: 'Tools' }, + { name: 'brush', category: 'Tools' }, + { name: 'gradient', category: 'Tools' }, // Verschiedenes { name: 'star', category: 'Verschiedenes' }, + { name: 'star_border', category: 'Verschiedenes' }, + { name: 'star_half', category: 'Verschiedenes' }, { name: 'bookmark', category: 'Verschiedenes' }, + { name: 'bookmark_border', category: 'Verschiedenes' }, { name: 'label', category: 'Verschiedenes' }, + { name: 'label_important', category: 'Verschiedenes' }, { name: 'lightbulb', category: 'Verschiedenes' }, + { name: 'lightbulb_outline', category: 'Verschiedenes' }, { name: 'extension', category: 'Verschiedenes' }, { name: 'widgets', category: 'Verschiedenes' }, + { name: 'grade', category: 'Verschiedenes' }, + { name: 'emoji_objects', category: 'Verschiedenes' }, + { name: 'emoji_events', category: 'Verschiedenes' }, + { name: 'sports_esports', category: 'Verschiedenes' }, + { name: 'rocket_launch', category: 'Verschiedenes' }, + { name: 'campaign', category: 'Verschiedenes' }, ]; constructor() { } @@ -153,9 +333,26 @@ export class IconService { } /** - * Prüft, ob ein Icon-Name in der Liste existiert + * Prüft, ob ein Icon-Name in der kuratierten Liste existiert + * Hinweis: Auch andere Material Icon Namen sind gültig, auch wenn sie nicht in der Liste sind */ isValidIcon(iconName: string): boolean { return this.icons.some(icon => icon.name === iconName); } + + /** + * Prüft, ob ein Icon in der kuratierten Liste ist + * Gibt true zurück für bekannte Icons, false für unbekannte (aber möglicherweise gültige) Icons + */ + isKnownIcon(iconName: string): boolean { + return this.icons.some(icon => icon.name === iconName); + } + + /** + * Gibt true zurück, wenn der String wahrscheinlich ein Material Icon Name ist + * (nur Kleinbuchstaben und Unterstriche) + */ + looksLikeIconName(value: string): boolean { + return /^[a-z0-9_]+$/.test(value); + } } diff --git a/frontend/src/environments/environment.prod.ts b/frontend/src/environments/environment.prod.ts new file mode 100644 index 0000000..e79cd77 --- /dev/null +++ b/frontend/src/environments/environment.prod.ts @@ -0,0 +1,5 @@ +// Production Environment (Container) +export const environment = { + production: true, + apiUrl: '/api/items' // Relativer Pfad für Nginx Proxy +}; diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts new file mode 100644 index 0000000..53c7588 --- /dev/null +++ b/frontend/src/environments/environment.ts @@ -0,0 +1,5 @@ +// Development Environment +export const environment = { + production: false, + apiUrl: 'http://localhost:8080/api/items' +};