fix: Git import fails when pages directory contains a file (#27467)
## Description It fixes the Git import failure bug when there's a file in the pages directory. #### PR fixes following issue(s) Fixes #27466
This commit is contained in:
parent
0c8ed66d86
commit
4f1eee48cc
|
|
@ -960,6 +960,7 @@ public class FileUtilsImpl implements FileInterface {
|
|||
// Loop through all the directories and nested directories inside the pages directory to extract
|
||||
// pages, actions and actionCollections from the JSON files
|
||||
for (File page : Objects.requireNonNull(directory.listFiles())) {
|
||||
if (page.isDirectory()) {
|
||||
pageMap.put(page.getName(), readPageMetadata(page.toPath(), gson));
|
||||
|
||||
JSONObject mainContainer = getMainContainer(pageMap.get(page.getName()), gson);
|
||||
|
|
@ -970,7 +971,8 @@ public class FileUtilsImpl implements FileInterface {
|
|||
// Construct the nested DSL from the widgets data
|
||||
Map<String, List<String>> parentDirectories = DSLTransformerHelper.calculateParentDirectories(
|
||||
widgetsData.keySet().stream().toList());
|
||||
JSONObject nestedDSL = DSLTransformerHelper.getNestedDSL(widgetsData, parentDirectories, mainContainer);
|
||||
JSONObject nestedDSL =
|
||||
DSLTransformerHelper.getNestedDSL(widgetsData, parentDirectories, mainContainer);
|
||||
pageDsl.put(page.getName(), nestedDSL.toString());
|
||||
actionMap.putAll(
|
||||
readAction(page.toPath().resolve(ACTION_DIRECTORY), gson, page.getName(), actionBodyMap));
|
||||
|
|
@ -981,6 +983,7 @@ public class FileUtilsImpl implements FileInterface {
|
|||
actionCollectionBodyMap));
|
||||
}
|
||||
}
|
||||
}
|
||||
applicationGitReference.setActions(actionMap);
|
||||
applicationGitReference.setActionBody(actionBodyMap);
|
||||
applicationGitReference.setActionCollections(actionCollectionMap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user