Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -369,19 +369,24 @@ private void onAcceptFilter()
final boolean deletable;
final boolean editable;

// Check if it's an initial condition
if(this.editingBadgeId != null && !this.editingBadgeId.equals(NO_BADGE_ID_STRING))
if(this.deletingBadgeEnabled != null && this.editingBadgeEnabled != null)
{
deletable = this.deletingBadgeEnabled;
editable = this.editingBadgeEnabled;

// Get customization rating from initial condition
customizationDegree = this.initialChipBadges
.stream()
.filter(e -> e.getBadgeId().equals(this.editingBadgeId))
.toList()
.get(0)
.getCustomizationRating();
this.deletingBadgeEnabled = null;
this.editingBadgeEnabled = null;

if(this.editingBadgeId != null)
{
// Get customization rating from initial condition
customizationDegree = this.initialChipBadges
.stream()
.filter(e -> e.getBadgeId().equals(this.editingBadgeId))
.toList()
.get(0)
.getCustomizationRating();
}
}
else
{
Expand Down Expand Up @@ -461,17 +466,15 @@ private void onAcceptFilter()
// Make the cancel button invisible
this.btnCancelFilter.setVisible(false);

// Needed to save state of the condition if it was editable/deletable before editing
this.editingBadgeEnabled = badge.isBtnEditEnabled();
this.deletingBadgeEnabled = badge.isBtnDeleteEnabled();

// Just activated when the url parameters are enabled
// Set the customization rating for the filter select and condition select
this.setUsedCustomizationDegreeForComponents(customizationDegree);

// Just activated when the url parameters are activated
if(!this.identifier.isBlank())
{
this.editingBadgeId = badge.getBadgeId();
// Needed for the acceptFilterBtn
this.editingBadgeEnabled = badge.isBtnEditEnabled();
this.deletingBadgeEnabled = badge.isBtnDeleteEnabled();
}
this.editingBadgeId = badge.getBadgeId();

// Remove filter, update grid
this.removeChipBadgeCondition(badge);
Expand Down