From 990c15f7212995f25183e3305130e1a883601f5a Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 9 May 2025 12:30:18 +0200 Subject: [PATCH] wip --- .../app/_components/list/list.component.html | 2 +- .../app/_components/list/list.component.ts | 13 + .../trip/trip-form/trip-form.component.html | 4 +- .../trip-location-form.component.ts | 6 +- angular/src/assets/i18n/en.json | 247 ++++++++---------- 5 files changed, 135 insertions(+), 137 deletions(-) diff --git a/angular/src/app/_components/list/list.component.html b/angular/src/app/_components/list/list.component.html index 1afbd40..5ce0655 100644 --- a/angular/src/app/_components/list/list.component.html +++ b/angular/src/app/_components/list/list.component.html @@ -90,7 +90,7 @@ - + diff --git a/angular/src/app/_components/list/list.component.ts b/angular/src/app/_components/list/list.component.ts index aca20f3..f727fae 100644 --- a/angular/src/app/_components/list/list.component.ts +++ b/angular/src/app/_components/list/list.component.ts @@ -33,6 +33,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { @Input() public searchable: boolean; @Input() public showDetailButton: boolean; @Input() public showEditButton: boolean; + @Input() public showRemoveButton: boolean; @Input() public showPosition: boolean; @Input() public showFilterBar: boolean; @Input() public listColDefinitions!: ListColDefinition[]; @@ -87,6 +88,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { this.showPosition = true; this.showDetailButton = true; this.showEditButton = true; + this.showRemoveButton = true; this.showFilterBar = true; this.filterExists = false; this.filterObj = {}; @@ -106,6 +108,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { if (this.showEditButton) { this.listColDefinitions.unshift(ListComponent.getDefaultColEditBtn()); } + if (this.showRemoveButton) { + this.listColDefinitions.unshift(ListComponent.getDefaultRemoveBtn()); + } if (this.showDetailButton) { const url = this.getCustomDetailLinkFunction !== undefined ? '' : this.router.routerState.snapshot.url; this.listColDefinitions.unshift(ListComponent.getDefaultColDetailBtnLink(url)); @@ -351,6 +356,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { } as ListColDefinition; } + public static getDefaultRemoveBtn(): ListColDefinition { + return { + name: 'remove', + text: '', + type: ListComponent.COLUMN_TYPE_BTN_REMOVE + } as ListColDefinition; + } + public static getDefaultColPosition(): ListColDefinition { return { name: 'pos', diff --git a/angular/src/app/_views/trip/trip-form/trip-form.component.html b/angular/src/app/_views/trip/trip-form/trip-form.component.html index 7344686..092074b 100644 --- a/angular/src/app/_views/trip/trip-form/trip-form.component.html +++ b/angular/src/app/_views/trip/trip-form/trip-form.component.html @@ -55,7 +55,7 @@
{ diff --git a/angular/src/assets/i18n/en.json b/angular/src/assets/i18n/en.json index 32c3473..78d932e 100644 --- a/angular/src/assets/i18n/en.json +++ b/angular/src/assets/i18n/en.json @@ -1,166 +1,149 @@ { - "dashboard": - { - "view": "Dashboard", - "overview": "Overview" + "base_data": { + "locations": "Locations", + "shipping_companies": "Shipping companies", + "vessels": "Vessels", + "view": "Base data", + "zones": "Zones" }, - "view": - { + "basic": { + "account": "Account", + "back": "Back", + "columns": "Columns", + "company_name": "Imaq Pilotage", + "create": "Create", "dashboard": "Dashboard", - "base_data": "Base data" + "date": "date", + "delete": "Delete", + "delete_confirm": "Do you really want to delete this dataset?", + "delete_confirm_related": "Do you really want to delete this dataset? There might be related data, which makes deletion impossible unless the related data will be removed first!", + "details": "Details", + "edit": "Edit", + "edit_after": "Edit", + "edit_before": "", + "end": "End", + "filter": "Filter", + "id": "Id", + "image": "Image", + "logout": "Logout", + "no": "No", + "note": "Note", + "number": "#", + "pleaseChoose": "Please choose", + "refresh": "Refresh", + "resetFilters": "Reset Filters", + "save": "Save", + "saveSettings": "Save settings", + "send": "Send", + "showAllColumns": "Show all columns", + "start": "Start", + "submit": "Submit", + "time": "time", + "users": "Users / Pilots", + "yes": "Yes" }, - "common": - { - "name": "Name", + "common": { "code": "Code", "created_at": "Created at", "date": "Date", - "time": "Time", - "note": "Note" + "name": "Name", + "note": "Note", + "time": "Time" }, - "trip": - { - "view": "Trips", - "view_single": "Trip", - "pilot_reference": "Pilotage reference", - "customer_reference": "Customer reference", - "captain_name": "Captain name", + "dashboard": { + "overview": "Overview", + "view": "Dashboard" + }, + "errors": {}, + "form": { + "email_validation": "Please provide a valid email address", + "mandatory": " Mandatory", + "no_data": "No datasets found.", + "search_placeholder": "Search" + }, + "location": { + "is_place": "Place", + "is_port": "Port", + "is_start_end": "Start/End", + "is_zone": "Zone" + }, + "model": { + "event": "Event", + "location": "Location", + "shipping_company": "Shipping Company", + "trip": "Trip", + "trip_location": "Itinerary location", + "user": "User", + "user_trip": "Pilotage", "vessel": "Vessel", - "start_location": "Start location", - "end_location": "End location", - "start_date": "Start date", + "zone": "Zone" + }, + "profile": { + "view": "Profile" + }, + "trip": { + "add_itinerary_location": "Add itinerary location", + "assigned_users": "Assigned Pilots", + "captain_name": "Captain name", + "completed": "Completed", + "customer_reference": "Customer reference", "end_date": "End date", + "end_location": "End location", + "events": "Events", "is_arrival": "Arrival", - "is_transit": "Transit", "is_departure": "Departure", + "is_transit": "Transit", "itinerary": "Itinerary", "itinerary_locations": "Itinerary locations", - "add_itinerary_location": "Add itinerary location", + "pilot_reference": "Pilotage reference", "remove_itinerary_location": "Remove itinerary location", "save_itinerary": "Save itinerary", - "assigned_users": "Assigned Pilots", "save_user_assignments": "Save user assignments", - "events": "Events", - "completed": "Completed" + "start_date": "Start date", + "start_location": "Start location", + "vessel": "Vessel", + "view": "Trips", + "view_single": "Trip" }, - "trip_location": - { + "trip_location": { "arrival_date_time": "ETA", "departure_date_time": "ETD" }, - "user_trip": - { - "view": "Pilotage", - "events": "Events", + "user_trip": { + "approved": "Approved", "completed": "Completed", "completed_at": "Completed at", - "signature": "Signature Image", "event_date": "Event date", - "approved": "Approved" - }, - "base_data": - { - "view": "Base data", - "locations": "Locations", - "zones": "Zones", - "vessels": "Vessels", - "shipping_companies": "Shipping companies" + "events": "Events", + "signature": "Signature Image", + "view": "Pilotage" }, - "model": { - "location": "Location", - "zone": "Zone", - "vessel": "Vessel", - "shipping_company": "Shipping Company", - "trip": "Trip", - "trip_location": "Itinerary location", + "users": { + "active": "Active", + "email": "Email", + "firstname": "Firstname", + "full_name": "Name", + "image": "Image", + "is_admin": "Admin", + "is_pilot": "Pilot", + "lastname": "Lastname", + "password": "Password", + "pilotIdNo": "#Pilot id", "user": "User", - "user_trip": "Pilotage", - "event": "Event" - }, - "location": - { - "is_zone": "Zone", - "is_place": "Place", - "is_port": "Port", - "is_start_end": "Start/End" - }, - "zone": - { - + "userTrips": "Pilotage", + "view": "Users / Pilots" }, - "vessel": - { - "length": "Length", + "vessel": { "breadth": "Breadth", + "callSign": "Call sign", "draft": "Draft", "grossTonnage": "Gross Tonnage", "imoNo": "Imo", - "callSign": "Call sign" - }, - "profile": - { - "view": "Profile" - }, - "basic": - { - "logout": "Logout", - "company_name": "Imaq Pilotage", - "users": "Users / Pilots", - "create": "Create", - "edit_before": "", - "edit_after": "Edit", - "details": "Details", - "back": "Back", - "yes": "Yes", - "no": "No", - "dashboard": "Dashboard", - "account": "Account", - "date": "Date", - "time": "Time", - "submit": "Submit", - "image": "Image", - "pleaseChoose": "Please choose", - "refresh": "Refresh", - "filter": "Filter", - "columns": "Columns", - "resetFilters": "Reset Filters", - "showAllColumns": "Show all columns", - "saveSettings": "Save settings", - "id": "Id", - "note": "Note", - "number": "#", - "send": "Send", - "edit": "Edit", - "save": "Save", - "delete": "Delete", - "delete_confirm": "Do you really want to delete this dataset?", - "delete_confirm_related": "Do you really want to delete this dataset? There might be related data, which makes deletion impossible unless the related data will be removed first!" - }, - "users": - { - "view": "Users / Pilots", - "user": "User", - "email": "Email", - "full_name": "Name", - "firstname": "Firstname", - "lastname": "Lastname", - "userTrips": "Pilotage", - "pilotIdNo": "#Pilot id", - "password": "Password", - "active": "Active", - "image": "Image", - "is_admin": "Admin", - "is_pilot": "Pilot" + "length": "Length" }, - "form": - { - "mandatory": " Mandatory", - "email_validation": "Please provide a valid email address", - "search_placeholder": "Search", - "no_data": "No datasets found." + "view": { + "base_data": "Base data", + "dashboard": "Dashboard" }, - "errors": - { - - } + "zone": {} } \ No newline at end of file