Skip to content

Commit

Permalink
Merge branch 'liferay:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
liferay-frontend authored Aug 24, 2023
2 parents a2b887e + 61fba6c commit 01c01ca
Show file tree
Hide file tree
Showing 80 changed files with 253 additions and 84 deletions.
61 changes: 18 additions & 43 deletions build-test-batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ mariadb.executable=${mariadb.executable}]]></echo>
<first id="test.class.file">
<fileset
dir="modules"
excludes="**/node_modules/**"
includes="**/${test.class.java}"
/>
</first>
Expand All @@ -770,32 +771,6 @@ mariadb.executable=${mariadb.executable}]]></echo>
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public static File getBndFile(File file) {
if (file == null) {
return null;
}
File canonicalFile = JenkinsResultsParserUtil.getCanonicalFile(file);
File parentFile = canonicalFile.getParentFile();
if ((parentFile == null) || !parentFile.exists()) {
return file;
}
if (!canonicalFile.isDirectory()) {
return getBndFile(parentFile);
}
File bndFile = new File(canonicalFile, "bnd.bnd");
if (!bndFile.exists()) {
return getBndFile(parentFile);
}
return bndFile;
}
public static String getTestName(String testClassFilePath) {
Pattern pattern = Pattern.compile("/([^/]+)\\.java");
Expand All @@ -808,20 +783,26 @@ mariadb.executable=${mariadb.executable}]]></echo>
return null;
}
public static String getTestProjectName(File bndFile) {
Properties bndFileProperties = JenkinsResultsParserUtil.getProperties(new File[] {bndFile});
public static String getTestProjectName(String testClassFilePath) {
String projectDir = project.getProperty("project.dir");
String regex = projectDir + "/modules(\\/+.+)/src/test";
String bundleSymbolicName = bndFileProperties.getProperty("Bundle-SymbolicName");
Pattern pattern = Pattern.compile(regex);
File modulesPropertiesFile = new File(project.getProperty("project.dir") + "/modules/modules.properties");
Matcher matcher = pattern.matcher(testClassFilePath);
Properties modulesProperties = JenkinsResultsParserUtil.getProperties(new File[] {modulesPropertiesFile});
if (matcher.find()) {
String testProjectName = matcher.group(1);
return modulesProperties.getProperty("project.name[" + bundleSymbolicName + "]");
return testProjectName.replaceAll("/", ":");
}
return null;
}
public static String getTestProjectResultsDir(File bndFile) {
String testProjectName = getTestProjectName(bndFile);
public static String getTestProjectResultsDir(String testClassFilePath) {
String testProjectName = getTestProjectName(testClassFilePath);
File testProjectResultsDir = new File(project.getProperty("project.dir") + "/modules/" + testProjectName.replaceAll(":", "/") + "/test-results/");
Expand All @@ -830,21 +811,15 @@ mariadb.executable=${mariadb.executable}]]></echo>
String testClassFilePath = project.getProperty("test.class.file.path");
File bndFile = getBndFile(new File(testClassFilePath));
if (bndFile == null) {
throw new Exception("Unable to find bnd.bnd file for " + testClassFilePath);
}
String testProjectName = getTestProjectName(bndFile);
String testProjectName = getTestProjectName(testClassFilePath);
if (testProjectName == null) {
throw new Exception("Unable to find corresponding project name for module test. Please add project name to modules/modules.properties.");
throw new Exception("Unable to find corresponding project name for " + testClassFilePath + ".");
}
project.setProperty("test.name", getTestName(testClassFilePath));
project.setProperty("test.project.name", testProjectName);
project.setProperty("test.project.results.dir", getTestProjectResultsDir(bndFile));
project.setProperty("test.project.results.dir", getTestProjectResultsDir(testClassFilePath));
]]>
</beanshell>
</sequential>
Expand Down
1 change: 1 addition & 0 deletions modules/apps/account/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.component.names ~ "Account")

##
Expand Down
1 change: 1 addition & 0 deletions modules/apps/asset/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.main.component.name ~ "Upgrades WEM")
1 change: 1 addition & 0 deletions modules/apps/change-tracking/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
(testray.main.component.name ~ "Publications")

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.main.component.name ~ "Upgrades Publications")

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import ClayAlert from '@clayui/alert';
import ClayDropdown, {Align} from '@clayui/drop-down';
import ClayIcon from '@clayui/icon';
import ClayLabel from '@clayui/label';
import ClayLayout from '@clayui/layout';
Expand Down Expand Up @@ -50,8 +51,6 @@ const SidebarPanelInfoView = ({
}) => {
const [activeTabKeyValue, setActiveTabKeyValue] = useState(TABS.details);

const showTabs = !!getItemVersionsURL;

const [error, setError] = useState(false);

const stickerColor = parseInt(user.userId, 10) % 10;
Expand All @@ -63,6 +62,18 @@ const SidebarPanelInfoView = ({
const hasCategorization =
!!tags.length || !!Object.keys(vocabularies).length;

const showTabs = !!getItemVersionsURL || hasCategorization;

const allTabs = !!getItemVersionsURL && hasCategorization;

const [active, setActive] = useState(false);

function _handleItemClick() {
setActive(false);

setActiveTabKeyValue(TABS.version);
}

return (
<>
<Sidebar.Header
Expand Down Expand Up @@ -156,9 +167,7 @@ const SidebarPanelInfoView = ({
<div className="c-mb-3 sidebar-section">
{showTabs && activeTabKeyValue !== null && (
<ClayTabs
className={classNames('d-flex flex-nowrap', {
'justify-content-center': hasCategorization,
})}
className="c-px-3 d-flex flex-nowrap justify-content-start"
modern
>
<ClayTabs.Item
Expand Down Expand Up @@ -189,16 +198,46 @@ const SidebarPanelInfoView = ({
</ClayTabs.Item>
)}

<ClayTabs.Item
active={activeTabKeyValue === TABS.version}
className="flex-shrink-0"
innerProps={{
'aria-controls': 'versions',
}}
onClick={() => setActiveTabKeyValue(TABS.version)}
>
{Liferay.Language.get('versions')}
</ClayTabs.Item>
{!!getItemVersionsURL && !hasCategorization && (
<ClayTabs.Item
active={activeTabKeyValue === TABS.version}
className="flex-shrink-0"
innerProps={{
'aria-controls': 'versions',
}}
onClick={() =>
setActiveTabKeyValue(TABS.version)
}
>
{Liferay.Language.get('versions')}
</ClayTabs.Item>
)}

{allTabs && (
<ClayDropdown
active={active}
alignmentPosition={Align.BottomLeft}
hasRightSymbols
onActiveChange={setActive}
trigger={
<ClayTabs.Item>
{Liferay.Language.get('more')}

<ClayIcon symbol="caret-bottom" />
</ClayTabs.Item>
}
>
<ClayDropdown.Item
active={activeTabKeyValue === TABS.version}
aria-selected={
activeTabKeyValue === TABS.version
}
onClick={() => _handleItemClick()}
>
{Liferay.Language.get('versions')}
</ClayDropdown.Item>
</ClayDropdown>
)}
</ClayTabs>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ describe('SidebarPanelInfoView', () => {
});

it('renders Details and Versions tabs when getItemVersionsURL prop is received', () => {
const {getAllByRole} = render(
const {getAllByRole, getByText} = render(
_getSidebarComponent({
...mockedProps,
...mockedContentWithVersions,
Expand All @@ -600,7 +600,10 @@ describe('SidebarPanelInfoView', () => {

expect(tabs[0].innerHTML).toContain('details');
expect(tabs[1].innerHTML).toContain('categorization');
expect(tabs[2].innerHTML).toContain('versions');

userEvent.click(getByText('more'));

expect(getByText('versions').innerHTML).toContain('versions');
});

it('renders Details tab active by default', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ exports[`SidebarPanelInfoView renders 1`] = `
class="c-mb-3 sidebar-section"
>
<ul
class="nav nav-tabs d-flex flex-nowrap justify-content-center"
class="nav nav-tabs c-px-3 d-flex flex-nowrap justify-content-start"
role="tablist"
>
<li
Expand Down Expand Up @@ -187,21 +187,36 @@ exports[`SidebarPanelInfoView renders 1`] = `
categorization
</button>
</li>
<li
class="nav-item flex-shrink-0"
role="none"
<div
class="dropdown"
innerprops="[object Object]"
>
<button
aria-controls="versions"
aria-selected="false"
class="nav-link btn btn-unstyled"
role="tab"
tabindex="-1"
type="button"
<li
aria-controls="clay-dropdown-menu-1"
aria-expanded="false"
aria-haspopup="true"
class="nav-item dropdown-toggle"
role="none"
>
versions
</button>
</li>
<button
aria-selected="false"
class="nav-link btn btn-unstyled"
role="tab"
tabindex="-1"
type="button"
>
more
<svg
class="lexicon-icon lexicon-icon-caret-bottom"
role="presentation"
>
<use
xlink:href="#caret-bottom"
/>
</svg>
</button>
</li>
</div>
</ul>
</div>
<div
Expand Down
1 change: 1 addition & 0 deletions modules/apps/document-library/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.component.names ~ "Document Management") AND \
(testray.main.component.name ~ "Upgrades Collaboration")

Expand Down
1 change: 1 addition & 0 deletions modules/apps/dynamic-data-mapping/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(data.archive.type != "data-archive-calendar") AND \
(portal.acceptance == true) AND \
(portal.release != "false") AND \
(testray.main.component.name == "Upgrades Forms")

Expand Down
1 change: 1 addition & 0 deletions modules/apps/fragment/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.main.component.name ~ "Upgrades WEM")

##
Expand Down
1 change: 1 addition & 0 deletions modules/apps/journal/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.main.component.name ~ "Upgrades WEM")

##
Expand Down
1 change: 1 addition & 0 deletions modules/apps/layout/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.main.component.name ~ "Upgrades WEM")

##
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ObjectEntry updateFromInfoItemFieldValues(
try {
return ObjectEntryUtil.toObjectEntry(
objectEntry.getObjectDefinitionId(),
objectEntryManager.updateObjectEntry(
objectEntryManager.partialUpdateObjectEntry(
objectEntry.getCompanyId(),
new DefaultDTOConverterContext(
false, null, null, null, null, themeDisplay.getLocale(),
Expand Down
1 change: 1 addition & 0 deletions modules/apps/organizations/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
)

test.batch.run.property.query[functional-upgrade*-tomcat*-mysql*-jdk8][relevant]=\
(portal.acceptance == true) AND \
(testray.component.names ~ "Users and Organizations") AND \
(testray.main.component.name ~ "Upgrades Foundation")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11400,6 +11400,7 @@ no-files-selected=No files selected.
no-filter-was-created-yet=No filter was created yet.
no-filters=No Filters
no-filters-were-found=No filters were found.
no-folders-were-found-in-x=No folders were found in {0}.
no-forms-were-found=No forms were found.
no-fragment-collection-was-found=No fragment collection was found.
no-fragment-was-found=No fragment was found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11394,6 +11394,7 @@ no-files-selected=لم يتم اختيار أي ملف.
no-filter-was-created-yet=لم يتم إنشاء أي عوامل تصفية بعد.
no-filters=بدون عوامل تصفية
no-filters-were-found=لم يتم العثور على أي عوامل تصفية.
no-folders-were-found-in-x=No folders were found in {0}. (Automatic Copy)
no-forms-were-found=لم يتم العثور على نماذج.
no-fragment-collection-was-found=لم يتم العثور على أي مجموعة أجزاء.
no-fragment-was-found=لم يتم العثور على أي أجزاء.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11394,6 +11394,7 @@ no-files-selected=Няма избрани активи.
no-filter-was-created-yet=No filter was created yet. (Automatic Copy)
no-filters=Без филтри (Automatic Translation)
no-filters-were-found=Не са намерени филтри. (Automatic Translation)
no-folders-were-found-in-x=No folders were found in {0}. (Automatic Copy)
no-forms-were-found=Не са намерени формуляри. (Automatic Translation)
no-fragment-collection-was-found=No fragment collection was found. (Automatic Copy)
no-fragment-was-found=No fragment was found. (Automatic Copy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11396,6 +11396,7 @@ no-files-selected=No s'ha seleccionat cap fitxer.
no-filter-was-created-yet=Encara no s'ha creat cap filtre.
no-filters=Sense filtres
no-filters-were-found=No s'ha trobat cap filtre.
no-folders-were-found-in-x=No folders were found in {0}. (Automatic Copy)
no-forms-were-found=No s'ha trobat cap formulari.
no-fragment-collection-was-found=No s'ha trobat cap col·lecció de fragments.
no-fragment-was-found=No s'ha trobat cap fragment.
Expand Down
Loading

0 comments on commit 01c01ca

Please sign in to comment.