Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/axonivy-market/portal int…
Browse files Browse the repository at this point in the history
…o feature/IVYPORTAL-17428-Check-and-remove-deprecated-features-from-portal---Code-+-Docs
  • Loading branch information
lttung-axonivy committed Aug 30, 2024
2 parents e57a7db + e042691 commit e9534df
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.axonivy.portal.selenium.common;

import static com.codeborne.selenide.Condition.exist;

import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.open;
import static com.codeborne.selenide.Selenide.refresh;
Expand All @@ -17,8 +18,6 @@
import org.openqa.selenium.support.ui.WebDriverWait;

import com.axonivy.ivy.webtest.engine.EngineUrl;
import com.axonivy.portal.selenium.page.NewDashboardPage;
import com.axonivy.portal.selenium.page.UserProfilePage;
import com.codeborne.selenide.Condition;
import com.codeborne.selenide.WebDriverRunner;

Expand Down Expand Up @@ -347,13 +346,6 @@ public void createJSonFile(String jsonFile, String key) {
redirectToRelativeLink(String.format(createJSonFileUrl, filepath, key));
}

public void resetFormattingLanguage() {
NewDashboardPage newDashboardPage = new NewDashboardPage();
UserProfilePage userProfilePage = newDashboardPage.openMyProfilePage();
userProfilePage.inputFormattingLanguage("English (United Kingdom)");
newDashboardPage = userProfilePage.save();
}

protected void showNewDashboard() {
redirectToRelativeLink(PORTAL_HOME_PAGE_URL);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.axonivy.portal.selenium.page;

import static com.codeborne.selenide.Condition.appear;
import static com.codeborne.selenide.Selenide.$;

import org.openqa.selenium.By;
Expand All @@ -14,8 +15,7 @@ protected String getLoadedLocator() {
}

public String getInfoSummary() {
return WebDriverRunner.getWebDriver().findElement(By.cssSelector("div[id$='messages'] span[class$='summary']"))
.getText();
return $("div[id$='announcement-tab']").shouldBe(appear, DEFAULT_TIMEOUT).$("span.ui-messages-error-summary").shouldBe(appear, DEFAULT_TIMEOUT).getText();
}

public void publish() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.axonivy.portal.selenium.test;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -69,7 +67,7 @@ public void testShouldDisplayNotification() {
}

@Test
public void testDepulishNotification() {
public void testDepublishNotification() {
NewDashboardPage newDashboardPage = new NewDashboardPage();
AdminSettingsPage adminSettingsPage = newDashboardPage.openAdminSettings();
AnnouncementPage announcementPage = adminSettingsPage.openAnnouncementTab();
Expand All @@ -83,9 +81,4 @@ public void testDepulishNotification() {
announcementPage.dePublish();
assertTrue(newDashboardPage.isAnnouncementMessageNotDisplayed());
}

@AfterEach
public void resetDefaultFormattingLanguage() {
resetFormattingLanguage();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.axonivy.portal.selenium.test;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -55,9 +54,4 @@ public void testChangeLanguage() {
private void createTestData() {
redirectToRelativeLink(createTestingTasksUrl);
}

@AfterEach
public void resetDefaultFormattingLanguage() {
resetFormattingLanguage();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ public IvyLanguage getIvyLanguageOfUser() {
}

public String getUserLanguage() {
return loadLanguage(IUser::getLanguage);
String languageTag = loadLanguage(IUser::getLanguage);
if (languageTag == StringUtils.EMPTY) {
return getDefaultLanguage().toLanguageTag();
}
return languageTag;
}

public String getUserFormatLanguage() {
Expand All @@ -75,9 +79,7 @@ private String loadLanguage(Function<IUser, Locale> userLocaleLoader) {
} else {
Locale apply = userLocaleLoader.apply(Ivy.session().getSessionUser());
languageTag = Objects.nonNull(apply) ? apply.toLanguageTag() : languageTag;
if (languageTag == StringUtils.EMPTY) {
return getDefaultLanguage().toLanguageTag();
}

}
return languageTag;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.. _configure-new-dashboard-custom-widget:

Configure Custom Widget
========================
=======================

Portal offers a variety of widgets, such as task, case, and process widgets. But what if you need a widget like a
weather widget? Fortunately, Portal allows you to create custom widgets as well. These custom widgets utilize
an IFrame to display content, which you can define. The content can be an Ivy process or the URL of an external
webpage.

.. _define-an-ivy-process-for-the-custom-widget:

Expand Down

0 comments on commit e9534df

Please sign in to comment.