Skip to content

Commit

Permalink
Fix code style and message file umlauts based on pull request feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslow committed Nov 22, 2024
1 parent 24afccd commit 4d96c98
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1070,11 +1070,7 @@ public boolean isSelectedMediaFirst() {
return false;
}

if (firstPhysicalDivision.equals(lastSelection.getKey())) {
return true;
}

return false;
return firstPhysicalDivision.equals(lastSelection.getKey());
}

/**
Expand All @@ -1093,15 +1089,11 @@ public boolean isSelectedMediaLast() {
return false;
}

PhysicalDivision firstPhysicalDivision = medias.get(medias.size() - 1).getView().getPhysicalDivision();
if (Objects.isNull(firstPhysicalDivision)) {
PhysicalDivision lastPhysicalDivision = medias.get(medias.size() - 1).getView().getPhysicalDivision();
if (Objects.isNull(lastPhysicalDivision)) {
return false;
}

if (firstPhysicalDivision.equals(lastSelection.getKey())) {
return true;
}

return false;
return lastPhysicalDivision.equals(lastSelection.getKey());
}
}
6 changes: 3 additions & 3 deletions Kitodo/src/main/resources/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ dataEditor.layoutMenuSaveForTaskText=Spaltenaufteilung für Aufgabentyp speicher
dataEditor.layoutSavedSuccessfullyTitle=Aktuelle Spaltenaufteilung erfolgreich gespeichert
dataEditor.layoutSavedSuccessfullyDefaultText=Ihre Einstellungen wurden erfolgreich als Standard-Einstellungen gespeichert! Beim n\u00E4chsten \u00D6ffnen des Matadaten-Editors wird die Breite der drei Spalten (Strukturdaten, Metadaten und Galerie) entsprechend ihrer aktuellen Einstellung geladen.
dataEditor.layoutSavedSuccessfullyForTaskText=Ihre Einstellungen wurden erfolgreich f\u00FCr alle zuk\u00FCnftigen Aufgaben des Typs "{0}" gespeichert! Beim n\u00E4chsten \u00D6ffnen des Matadaten-Editors f\u00FCr eine Aufgabe des gleichen Typs wird die Breite der drei Spalten (Strukturdaten, Metadaten und Galerie) entsprechend ihrer aktuellen Einstellung geladen.
dataEditor.navigateToPreviousElementMany=mehrere Elemente zurück springen
dataEditor.navigateToPreviousElementMany=mehrere Elemente zur\u00FCckspringen
dataEditor.navigateToPreviousElementOne=zum vorherigen Element
dataEditor.navigateToNextElementMany=mehrere Elemente weiter springen
dataEditor.navigateToNextElementOne=zum nächsten Element
dataEditor.navigateToNextElementMany=mehrere Elemente vorspringen
dataEditor.navigateToNextElementOne=zum n\u00E4chsten Element
dataEditor.renamingMediaComplete=Das Umbenennen der Medien ist abgeschlossen
dataEditor.renamingMediaError=Beim Umbenennen der Medien ist ein Fehler aufgetreten
dataEditor.renamingMediaText={0} Mediendateien in {1} Ordnern wurden umbenannt. Bitte speichern Sie den Vorgang. Andernfalls werden die Dateiumbennungen beim Schlie\u00DFen des Metadateneditors verworfen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ public void navigationButtonTest() throws Exception {

// image is thumbnail 2, which is the very first image, such that left buttons are disabled
assertEquals("Bild 2, Seite -", findElementsByCSS(GALLERY_HEADING_WRAPPER_SELECTOR).get(0).getText().strip());
WebElement leftFast = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementMany").get(0);
WebElement rightFast = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementMany").get(0);
WebElement leftMany = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementMany").get(0);
WebElement rightMany = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementMany").get(0);

// check left buttons are disabled and right buttons are enabled
assertFalse(leftFast.isEnabled());
assertTrue(rightFast.isEnabled());
assertFalse(leftMany.isEnabled());
assertTrue(rightMany.isEnabled());

// click on right-many button, which selects last image
rightFast.click();
rightMany.click();

// wait for image 3 to be shown
pollAssertTrue(
Expand All @@ -244,15 +244,15 @@ public void navigationButtonTest() throws Exception {
);

// find buttons again because image preview is re-rendered
WebElement leftSlow = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementOne").get(0);
WebElement rightSlow = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementOne").get(0);
WebElement leftOne = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementOne").get(0);
WebElement rightOne = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementOne").get(0);

// check left buttons are enalbed and right buttons are disabled
assertTrue(leftSlow.isEnabled());
assertFalse(rightSlow.isEnabled());
// check left buttons are enabled and right buttons are disabled
assertTrue(leftOne.isEnabled());
assertFalse(rightOne.isEnabled());

// click on left-one button, selecting image 1 (middle image of all 3 images)
leftSlow.click();
leftOne.click();

// wait for image 1 to be shown
pollAssertTrue(
Expand All @@ -262,16 +262,16 @@ public void navigationButtonTest() throws Exception {
);

// find buttons again because image preview is re-rendered
leftSlow = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementOne").get(0);
rightSlow = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementOne").get(0);
leftOne = findElementsByCSS("#imagePreviewForm\\:navigateToPreviousElementOne").get(0);
rightOne = findElementsByCSS("#imagePreviewForm\\:navigateToNextElementOne").get(0);

// both left and right buttons are enabled
assertTrue(leftSlow.isEnabled());
assertTrue(rightSlow.isEnabled());
assertTrue(leftOne.isEnabled());
assertTrue(rightOne.isEnabled());

// check that buttons are displayed (since mouse in hovering buttons due to prior click)
assertTrue(leftSlow.isDisplayed());
assertTrue(rightSlow.isDisplayed());
assertTrue(leftOne.isDisplayed());
assertTrue(rightOne.isDisplayed());

// move mouse to main header menu
new Actions(Browser.getDriver()).moveToElement(findElementsByCSS("#menu").get(0)).perform();
Expand Down

0 comments on commit 4d96c98

Please sign in to comment.