Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
joschne committed Jul 28, 2023
1 parent 007f671 commit 6d0e8dd
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,6 @@ export class ConfigurationPipesService extends PipeCache<ConfigurationPipesServi
// console.log('pipeFields(' + pkClass + ',' + noNesting + ')');

const obs$ = combineLatest([
// pipe source class
this.s.dfh$.class$.by_pk_class$.key(pkClass),
// freezing bug log
// .pipe(tap(x => console.log('aaa this.s.dfh$.class$.by_pk_class$$'))),
// pipe outgoing properties
this.s.dfh$.property$.by_has_domain$.key(pkClass).pipe(map(indexed => values(indexed))),
// freezing bug log
// .pipe(tap(x => console.log('aaa this.s.dfh$.property$.by_has_domain$$'))),
Expand All @@ -140,20 +135,24 @@ export class ConfigurationPipesService extends PipeCache<ConfigurationPipesServi
// freezing bug log
// .pipe(tap(x => console.log('aaa pipeProfilesEnabledByProject$'))),
]).pipe(
switchMap(([sourceKlass, outgoingProps, ingoingProps, sysConfig, enabledProfiles]) => {
switchMap(([outgoingProps, ingoingProps, sysConfig, enabledProfiles]) => {

// console.log('aaa is it crazy?') // freezing bug log



const platformVocabularyClasses = sysConfig.platformVocabularies ?
sysConfig.platformVocabularies.map(c => c.parentOrAncestorClassId) : [];

const isEnabled = (prop: DfhProperty): boolean => enabledProfiles.some(
(enabled) => prop.profiles.map(p => p.fk_profile).includes(enabled)
);
const outP = outgoingProps.filter((prop) => isEnabled(prop))
const inP = ingoingProps.filter((prop) => isEnabled(prop))

const removedFromAllProfilesLast = (a: DfhProperty, b: DfhProperty) => {
// if this property is not removed from all profiles, return a negative number to sort it first
return a.profiles?.some(p => !p?.removed_from_api) ? -1 : 1;
}

const outP = outgoingProps.filter((prop) => isEnabled(prop)).sort(removedFromAllProfilesLast)
const inP = ingoingProps.filter((prop) => isEnabled(prop)).sort(removedFromAllProfilesLast)

return combineLatest([
this.pipePropertiesToSubfields(outP, true, enabledProfiles, platformVocabularyClasses, noNesting),
Expand Down

0 comments on commit 6d0e8dd

Please sign in to comment.