Skip to content

Commit

Permalink
Merge pull request #1224 from eclipse-tractusx/chore/#1069-adjust-too…
Browse files Browse the repository at this point in the history
…ltip-notification-creation

chore(notifications): 1069 adjust notification creation disabling too…
  • Loading branch information
ds-mwesener authored Jul 17, 2024
2 parents 07a9d23 + 92c147e commit b70280a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="icon-container">

<div *ngIf="tableType === TableType.AS_BUILT_OWN" class="action-button-tile"
matTooltip="{{(roleService.isAdmin() ? 'routing.unauthorized' : (!isAllowedToCreateAlert() && !isAllowedToCreateInvestigation() ? 'routing.partMismatch' : 'table.createNotification')) | i18n}}"
matTooltip="{{(roleService.isAdmin() ? 'routing.unauthorized' : (!isAllowedToCreateAlert() && !isAllowedToCreateInvestigation() ? ( selectionContainsCustomerPart() ? 'routing.hasCustomerPart':'routing.partMismatch') : 'table.createNotification')) | i18n}}"
matTooltipClass="table--header--tooltip"
matTooltipPosition="above"
[class.mdc-tooltip--multiline]="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import { TableSettingsService } from '@core/user/table-settings.service';
import { UserService } from '@core/user/user.service';
import { MainAspectType } from '@page/parts/model/mainAspectType.enum';
import { Owner } from '@page/parts/model/owner.enum';
import { ImportState, Part } from '@page/parts/model/parts.model';
import { PartReloadOperation } from '@page/parts/model/partReloadOperation.enum';
import { ImportState, Part } from '@page/parts/model/parts.model';
import { MultiSelectAutocompleteComponent } from '@shared/components/multi-select-autocomplete/multi-select-autocomplete.component';
import { TableType } from '@shared/components/multi-select-autocomplete/table-type.model';
import { PartsTableConfigUtils } from '@shared/components/parts-table/parts-table-config.utils';
Expand Down Expand Up @@ -176,6 +176,11 @@ export class PartsTableComponent implements OnInit {
return !hasDifferentOwner;
}

selectionContainsCustomerPart(): boolean {
const selected = this.selection.selected as Part[];
return selected.some(part => part.owner === Owner.CUSTOMER);
}

handleKeyDownQualityNotificationClicked(event: KeyboardEvent){
if (event.key === 'Enter') {
this.createQualityNotificationClicked();
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/assets/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"adminBpn": "BPN - EDC Konfiguration",
"adminImport": "Datenbereitstellung",
"adminPolicies" : "Richtlinienverwaltung",
"partMismatch": "Die ausgewählten Teile müssen vom selben Eigentümer sein, um ein Qualitätsthema zu erstellen (Eigen, Lieferant)",
"partMismatch" : "Alle ausgewählten Teile müssen vom selben Eigentümer sein, um ein Qualitätsthema zu erstellen (Lieferant/Eigene).",
"hasCustomerPart" : "Die Erstellung einer Qualitätsmitteilung für Kundenteile ist nicht möglich. Alle ausgewählten Teile müssen vom selben Eigentümer sein (Lieferant/Eigene).",
"unauthorized": "Die Funktion ist aufgrund einer fehlenden Rolle deaktiviert. Bitten Sie Ihren Administrator, die erforderliche Rolle für die Funktion bereitzustellen.",
"notificationInProcess" : "Aktionen für Qualitätsthemen sind während dem Verarbeitungsprozess nicht verfügbar.",
"notAllowedForAsPlanned": "Diese Funktion ist für Produkte im Lebenszyklus \"AsPlanned\" nicht verfügbar.",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/assets/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"adminBpn": "BPN - EDC configuration",
"adminImport": "Data provisioning",
"adminPolicies" : "Policy management",
"partMismatch": "Selected parts must have same owner to create quality topic (Own, Supplier)",
"partMismatch" : "All selected parts must be from the same owner to create a quality notification (Supplier/Own).",
"hasCustomerPart" : "It is not possible to create a quality notification for customer parts. All selected parts must be from the same owner (Supplier/Own).",
"unauthorized": "Functionality is disabled because of missing role. Ask your administrator to provide the required role for the functionality.",
"notificationInProcess" : "Actions are unavailable on notifications in processing state",
"notAllowedForAsPlanned": "This function is not available for Parts in the Lifecycle \"AsPlanned\".",
Expand Down

0 comments on commit b70280a

Please sign in to comment.