@@ -282,7 +282,7 @@ export class CubeSymbols {
282282 }
283283
284284 protected prepareIncludes ( cube : CubeDefinition , errorReporter : ErrorReporter , splitViews : SplitViews ) {
285- if ( ! cube . includes && ! cube . cubes ) {
285+ if ( ! cube . cubes ) {
286286 return ;
287287 }
288288
@@ -324,18 +324,8 @@ export class CubeSymbols {
324324 cubeIncludes = this . membersFromCubes ( cube , cubes , type , errorReporter , splitViews , memberSets ) || [ ] ;
325325 }
326326
327- // This is the deprecated approach
328- const includes = cube . includes && this . membersFromIncludeExclude ( cube . includes , cube . name , type ) || [ ] ;
329- const excludes = cube . excludes && this . membersFromIncludeExclude ( cube . excludes , cube . name , type ) || [ ] ;
330-
331- // cube includes will take precedence in case of member clash
332- const finalIncludes = this . diffByMember (
333- this . diffByMember ( includes , cubeIncludes ) . concat ( cubeIncludes ) ,
334- excludes
335- ) ;
336-
337327 if ( type === 'hierarchies' ) {
338- for ( const member of finalIncludes ) {
328+ for ( const member of cubeIncludes ) {
339329 const path = member . member . split ( '.' ) ;
340330 const cubeName = path [ path . length - 2 ] ;
341331 const hierarchyName = path [ path . length - 1 ] ;
@@ -350,10 +340,10 @@ export class CubeSymbols {
350340 }
351341 }
352342
353- const includeMembers = this . generateIncludeMembers ( finalIncludes , cube . name , type ) ;
343+ const includeMembers = this . generateIncludeMembers ( cubeIncludes , cube . name , type ) ;
354344 this . applyIncludeMembers ( includeMembers , cube , type , errorReporter ) ;
355345
356- cube . includedMembers = [ ...( cube . includedMembers || [ ] ) , ...Array . from ( new Set ( finalIncludes . map ( ( it : any ) => {
346+ cube . includedMembers = [ ...( cube . includedMembers || [ ] ) , ...Array . from ( new Set ( cubeIncludes . map ( ( it : any ) => {
357347 const split = it . member . split ( '.' ) ;
358348 const memberPath = this . pathFromArray ( [ split [ split . length - 2 ] , split [ split . length - 1 ] ] ) ;
359349 return {
@@ -465,22 +455,6 @@ export class CubeSymbols {
465455 return includes . filter ( include => ! excludesMap . has ( include . member ) ) ;
466456 }
467457
468- protected membersFromIncludeExclude ( referencesFn : ( ...args : Array < unknown > ) => Array < ToString > , cubeName : string , type : string ) {
469- const references = this . evaluateReferences ( cubeName , referencesFn ) ;
470- return R . unnest ( references . map ( ( ref : string ) => {
471- const path = ref . split ( '.' ) ;
472- if ( path . length === 1 ) {
473- const membersObj = this . symbols [ path [ 0 ] ] ?. cubeObj ( ) ?. [ type ] || { } ;
474- return Object . keys ( membersObj ) . map ( memberName => ( { member : `${ ref } .${ memberName } ` } ) ) ;
475- } else if ( path . length === 2 ) {
476- const resolvedMember = this . getResolvedMember ( type , path [ 0 ] , path [ 1 ] ) ;
477- return resolvedMember ? [ { member : ref } ] : undefined ;
478- } else {
479- throw new Error ( `Unexpected path length ${ path . length } for ${ ref } ` ) ;
480- }
481- } ) ) . filter ( Boolean ) ;
482- }
483-
484458 protected getResolvedMember ( type : string , cubeName : string , memberName : string ) {
485459 return this . symbols [ cubeName ] ?. cubeObj ( ) ?. [ type ] ?. [ memberName ] ;
486460 }
0 commit comments