better naming of default child view

This commit is contained in:
Michael Shanks 2020-04-02 06:29:31 +01:00
parent 87e33c8b99
commit acb49a305b
2 changed files with 6 additions and 1 deletions

View File

@ -198,7 +198,10 @@ export const saveCurrentNode = store => () => {
const defaultIndex = templateApi(state.hierarchy).getNewIndexTemplate(
cloned.parent()
)
defaultIndex.name = `all_${cloned.name}s`
defaultIndex.name = hierarchyFunctions.isTopLevelIndex(cloned)
? `all_${cloned.name}s`
: `${cloned.parent().name}_${cloned.name}s`
defaultIndex.allowedRecordNodeIds = [cloned.nodeId]
}

View File

@ -279,4 +279,6 @@ export default {
fieldReversesReferenceToNode,
fieldReversesReferenceToIndex,
getFlattenedHierarchy,
isTopLevelIndex,
isTopLevelRecord,
}