diff --git a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.html b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.html
index cbdec3485..8fea6ffe6 100644
--- a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.html
+++ b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.html
@@ -3,17 +3,23 @@
[disabled]="!enabledFeature(feature)">
- {{ feature.name }}
+ {{ 'PAC.Feature.Features.' + feature.code + '.Name' | translate: {Default: feature.name } }}
- {{ feature.description }}
+ {{ 'PAC.Feature.Features.' + feature.code + '.Description' | translate: {Default: feature.description } }}
-
+
+
0" displayDensity="cosy">
- {{ child?.name }}
+
+
+ {{ 'PAC.Feature.Features.' + child.code + '.Name' | translate: {Default: child.name } }}
+ {{ 'PAC.Feature.Features.' + child.code + '.Description' | translate: {Default: child.description } }}
+
+
diff --git a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.scss b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.scss
index 38f3ef31e..bdb16be2a 100644
--- a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.scss
+++ b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.scss
@@ -1,3 +1,7 @@
:host {
@apply w-full;
+}
+
+.mat-mdc-slide-toggle {
+ @apply inline-flex;
}
\ No newline at end of file
diff --git a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.ts b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.ts
index e415705e6..9e49618d7 100644
--- a/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.ts
+++ b/apps/cloud/src/app/@shared/feature-toggle/feature-toggle.component.ts
@@ -1,31 +1,30 @@
-import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core'
+import { Component, OnInit, inject } from '@angular/core'
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
import { MatDialog } from '@angular/material/dialog'
import { ActivatedRoute } from '@angular/router'
+import { CountdownConfirmationComponent } from '@metad/components/confirm'
import { IFeature, IFeatureOrganization, IFeatureToggle } from '@metad/contracts'
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'
-import { TranslateService } from '@ngx-translate/core'
-import { CountdownConfirmationComponent } from '@metad/components/confirm'
import { combineLatest, firstValueFrom, of } from 'rxjs'
-import {
- distinctUntilChanged,
- map,
- shareReplay,
- startWith,
- switchMap,
- tap,
- withLatestFrom
-} from 'rxjs/operators'
+import { distinctUntilChanged, map, shareReplay, startWith, switchMap, tap, withLatestFrom } from 'rxjs/operators'
import { environment } from '../../../environments/environment'
import { FeatureService, FeatureStoreService, Store } from '../../@core/services'
import { TranslationBaseComponent } from '../language/translation-base.component'
+
@UntilDestroy({ checkProperties: true })
@Component({
selector: 'pac-feature-toggle',
templateUrl: './feature-toggle.component.html',
styleUrls: ['./feature-toggle.component.scss']
})
-export class FeatureToggleComponent extends TranslationBaseComponent implements OnInit, OnChanges {
+export class FeatureToggleComponent extends TranslationBaseComponent implements OnInit {
+ private readonly _activatedRoute = inject(ActivatedRoute)
+ private readonly _featureService = inject(FeatureService)
+ private readonly _featureStoreService = inject(FeatureStoreService)
+ private readonly _storeService = inject(Store)
+ private readonly _matDialog = inject(MatDialog)
+
loading = false
featureToggles = []
featureTogglesDefinitions: IFeatureToggle[] = []
@@ -34,7 +33,7 @@ export class FeatureToggleComponent extends TranslationBaseComponent implements
startWith(this._activatedRoute.snapshot.data),
map((data) => data?.isOrganization),
distinctUntilChanged(),
- untilDestroyed(this),
+ takeUntilDestroyed(),
shareReplay(1)
)
public readonly organization$ = this._storeService.selectedOrganization$
@@ -52,21 +51,10 @@ export class FeatureToggleComponent extends TranslationBaseComponent implements
}
return this._featureStoreService.loadFeatureOrganizations(['feature'], request).pipe(map(({ items }) => items))
}),
- untilDestroyed(this),
+ takeUntilDestroyed(),
shareReplay(1)
)
- constructor(
- private readonly _activatedRoute: ActivatedRoute,
- private readonly _featureService: FeatureService,
- private readonly _featureStoreService: FeatureStoreService,
- private readonly _storeService: Store,
- public readonly translationService: TranslateService,
- private readonly _matDialog: MatDialog
- ) {
- super()
- }
-
ngOnInit(): void {
combineLatest([this.featureTenant$, this.featureOrganizations$])
.pipe(withLatestFrom(combineLatest([this.isOrganization$, this.organization$])), untilDestroyed(this))
@@ -99,26 +87,24 @@ export class FeatureToggleComponent extends TranslationBaseComponent implements
.subscribe()
}
- ngOnChanges(change: SimpleChanges): void {}
-
getFeatures() {
this._featureStoreService.loadFeatures(['children']).pipe(untilDestroyed(this)).subscribe()
}
- async featureChanged(event: boolean, feature: IFeature) {
+ async featureChanged(isEnabled: boolean, feature: IFeature) {
const result = await firstValueFrom(
this._matDialog
.open(CountdownConfirmationComponent, {
- // context: {
- // recordType: feature.description,
- // isEnabled: isEnabled
- // },
+ data: {
+ recordType: feature.description,
+ isEnabled: isEnabled
+ },
})
.afterClosed()
)
if (result) {
- await this.emitFeatureToggle({ feature, isEnabled: !!event })
+ await this.emitFeatureToggle({ feature, isEnabled: !!isEnabled })
} else {
if (!environment.IS_ELECTRON) {
window.location.reload()
@@ -126,18 +112,18 @@ export class FeatureToggleComponent extends TranslationBaseComponent implements
}
}
- async emitFeatureToggle({feature, isEnabled}: { feature: IFeature; isEnabled: boolean }) {
+ async emitFeatureToggle({ feature, isEnabled }: { feature: IFeature; isEnabled: boolean }) {
const isOrganization = await firstValueFrom(this.isOrganization$)
const organization = await firstValueFrom(this.organization$)
const { id: featureId } = feature
- const request = {
- featureId,
- isEnabled
- }
- if (organization && isOrganization) {
- const { id: organizationId } = organization
- request['organizationId'] = organizationId
- }
+ const request = {
+ featureId,
+ isEnabled
+ }
+ if (organization && isOrganization) {
+ const { id: organizationId } = organization
+ request['organizationId'] = organizationId
+ }
await firstValueFrom(this._featureStoreService.changedFeature(request))
if (!environment.IS_ELECTRON) {
window.location.reload()
diff --git a/apps/cloud/src/app/@theme/header/organization-selector/organization-selector.component.ts b/apps/cloud/src/app/@theme/header/organization-selector/organization-selector.component.ts
index 5b24dafab..698e96333 100644
--- a/apps/cloud/src/app/@theme/header/organization-selector/organization-selector.component.ts
+++ b/apps/cloud/src/app/@theme/header/organization-selector/organization-selector.component.ts
@@ -1,10 +1,10 @@
import { CommonModule } from '@angular/common'
-import { Component, OnInit, inject } from '@angular/core'
+import { Component, DestroyRef, OnInit, inject } from '@angular/core'
+import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
import { MatIconModule } from '@angular/material/icon'
import { MatMenuModule } from '@angular/material/menu'
import { MatTooltipModule } from '@angular/material/tooltip'
import { Ability } from '@casl/ability'
-import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'
import { nonNullable } from '@metad/core'
import { uniqBy } from 'lodash-es'
import { filter, map, shareReplay, switchMap, tap } from 'rxjs'
@@ -12,7 +12,7 @@ import { AbilityActions, IOrganization, Store, UsersOrganizationsService } from
import { OrgAvatarComponent } from '../../../@shared'
import { TranslationBaseComponent } from '../../../@shared/language/translation-base.component'
-@UntilDestroy()
+
@Component({
standalone: true,
selector: 'pac-organization-selector',
@@ -23,6 +23,7 @@ export class OrganizationSelectorComponent extends TranslationBaseComponent impl
private readonly store = inject(Store)
private readonly userOrganizationService = inject(UsersOrganizationsService)
private readonly ability = inject(Ability)
+ private readonly destroyRef = inject(DestroyRef)
selectedOrganization: IOrganization
@@ -76,7 +77,7 @@ export class OrganizationSelectorComponent extends TranslationBaseComponent impl
]
: organizations
),
- untilDestroyed(this),
+ takeUntilDestroyed(),
shareReplay(1)
)
@@ -94,7 +95,7 @@ export class OrganizationSelectorComponent extends TranslationBaseComponent impl
this.selectedOrganization = organization
this.store.featureOrganizations = organization.featureOrganizations ?? []
}),
- untilDestroyed(this)
+ takeUntilDestroyed(this.destroyRef)
)
.subscribe()
}
@@ -108,7 +109,10 @@ export class OrganizationSelectorComponent extends TranslationBaseComponent impl
this.store.selectedOrganization = null
this.store.organizationId = null
this.store.selectedEmployee = null
- this.selectedOrganization = { name: 'All Org', id: null } as IOrganization
+ this.selectedOrganization = {
+ name: this.getTranslation('PAC.Header.Organization.AllOrg', { Default: 'All Org' }),
+ id: null
+ } as IOrganization
}
}
}
diff --git a/apps/cloud/src/app/app.component.ts b/apps/cloud/src/app/app.component.ts
index e6afe46bb..5c1922f14 100644
--- a/apps/cloud/src/app/app.component.ts
+++ b/apps/cloud/src/app/app.component.ts
@@ -67,7 +67,7 @@ export class AppComponent implements OnInit {
ngOnInit() {
combineLatest([this.appService.isMobile$, this.store.preferredTheme$])
.subscribe(([isMobile, preferredTheme]) => {
- const [primaryTheme, primaryColor] = preferredTheme.split('-')
+ const [primaryTheme, primaryColor] = (preferredTheme ?? '').split('-')
preferredTheme = preferredTheme ?? ThemesEnum.default
const theme = `ngm-theme-${preferredTheme} ${primaryTheme} ${preferredTheme}`
// for body
diff --git a/apps/cloud/src/app/features/features.module.ts b/apps/cloud/src/app/features/features.module.ts
index df8496f7a..2bc2ab352 100644
--- a/apps/cloud/src/app/features/features.module.ts
+++ b/apps/cloud/src/app/features/features.module.ts
@@ -12,6 +12,7 @@ import { DataSource, Type } from '@metad/ocap-core'
import { LetDirective } from '@ngrx/component'
import { PacAuthModule } from '@metad/cloud/auth'
import { NxTableModule } from '@metad/components/table'
+import { NgmFormlyModule } from '@metad/formly'
import { NgmCopilotService } from '@metad/core'
import { PACMaterialThemeModule } from '@metad/material-theme'
import { NX_STORY_FEED, NX_STORY_MODEL, NX_STORY_STORE } from '@metad/story/core'
@@ -50,7 +51,10 @@ import { FeaturesComponent } from './features.component'
CopilotChatComponent,
NxTableModule.forRoot(),
DensityDirective,
- CopilotGlobalComponent
+ CopilotGlobalComponent,
+
+ // Formly
+ NgmFormlyModule.forRoot({}),
],
providers: [
DirtyCheckGuard,
diff --git a/apps/cloud/src/app/features/home/_home-theme.scss b/apps/cloud/src/app/features/home/_home-theme.scss
index 7f7f32e62..448cae153 100644
--- a/apps/cloud/src/app/features/home/_home-theme.scss
+++ b/apps/cloud/src/app/features/home/_home-theme.scss
@@ -1,21 +1,17 @@
@use 'sass:map';
@use 'sass:color';
@use '@angular/material' as mat;
-@use './insight/insight-theme' as insight;
@use './dashboard/dashboard-theme' as dashboard;
@mixin color($theme) {
- @include insight.color($theme);
@include dashboard.color($theme);
}
@mixin typography($theme) {
- @include insight.typography($theme);
@include dashboard.typography($theme);
}
@mixin density($theme) {
- @include insight.density($theme);
@include dashboard.density($theme);
}
diff --git a/apps/cloud/src/app/features/home/_home.scss b/apps/cloud/src/app/features/home/_home.scss
index 2a65f5447..bddfc43a2 100644
--- a/apps/cloud/src/app/features/home/_home.scss
+++ b/apps/cloud/src/app/features/home/_home.scss
@@ -1,3 +1,5 @@
+@import './insight/_insight.component';
+
.pac-home__content {
.pac-home__gridster-item {
background: transparent;
diff --git a/apps/cloud/src/app/features/home/home.component.ts b/apps/cloud/src/app/features/home/home.component.ts
index 1e43e3b73..c077d577f 100644
--- a/apps/cloud/src/app/features/home/home.component.ts
+++ b/apps/cloud/src/app/features/home/home.component.ts
@@ -1,6 +1,7 @@
import { DragDropModule } from '@angular/cdk/drag-drop'
import { CommonModule } from '@angular/common'
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
+import { toSignal } from '@angular/core/rxjs-interop'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { MatButtonModule } from '@angular/material/button'
import { MatDialogModule } from '@angular/material/dialog'
@@ -14,12 +15,11 @@ import { MatTabsModule } from '@angular/material/tabs'
import { RouterModule } from '@angular/router'
import { NgmCommonModule } from '@metad/ocap-angular/common'
import { AppearanceDirective, ButtonGroupDirective, DensityDirective } from '@metad/ocap-angular/core'
-import { UntilDestroy } from '@ngneat/until-destroy'
import { TranslateModule } from '@ngx-translate/core'
+import { AnalyticsFeatures, FeatureEnum, Store, routeAnimations } from '../../@core'
import { AppService } from '../../app.service'
-import { routeAnimations } from '../../@core'
-@UntilDestroy({ checkProperties: true })
+
@Component({
standalone: true,
imports: [
@@ -47,51 +47,66 @@ import { routeAnimations } from '../../@core'
],
selector: 'pac-home',
template: `
-
-
-
-
+
+
+
+
`,
styles: [
`
@@ -109,6 +124,13 @@ import { routeAnimations } from '../../@core'
})
export class HomeComponent {
private readonly appService = inject(AppService)
+ private readonly store = inject(Store)
+ public readonly copilotEnabled = toSignal(this.appService.copilotEnabled$)
+
+ FeatureEnum = FeatureEnum
+ AnalyticsFeatures = AnalyticsFeatures
- public readonly copilotEnabled$ = this.appService.copilotEnabled$
+ hasFeatureEnabled(featureKey: FeatureEnum | AnalyticsFeatures) {
+ return this.store.hasFeatureEnabled(featureKey)
+ }
}
diff --git a/apps/cloud/src/app/features/home/insight/_insight-theme.scss b/apps/cloud/src/app/features/home/insight/_insight-theme.scss
deleted file mode 100644
index 448ba88ee..000000000
--- a/apps/cloud/src/app/features/home/insight/_insight-theme.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-@use 'sass:map';
-@use 'sass:color';
-@use '@angular/material' as mat;
-
-@mixin color($theme) {
- $config: mat.get-color-config($theme);
-
- $primary: map.get($config, 'primary');
- $accent: map.get($config, accent);
- $background: map.get($config, background);
- $foreground: map.get($config, foreground);
-
- .mat-autocomplete-panel.pac-insight__autocomplete {
- @apply mb-4;
- }
-
- .pac-indight__answer-panel .mat-expansion-panel-body {
- padding: 0;
- }
-}
-
-@mixin typography($theme) {
-}
-
-@mixin density($theme) {
-}
-
-@mixin theme($theme) {
- $color: mat.get-color-config($theme);
- $density: mat.get-density-config($theme);
- $typography: mat.get-typography-config($theme);
-
- @if $color != null {
- @include color($color);
- }
- @if $density != null {
- @include density($density);
- }
- @if $typography != null {
- @include typography($typography);
- }
-}
diff --git a/apps/cloud/src/app/features/home/insight/_insight.component.scss b/apps/cloud/src/app/features/home/insight/_insight.component.scss
new file mode 100644
index 000000000..4fa22d755
--- /dev/null
+++ b/apps/cloud/src/app/features/home/insight/_insight.component.scss
@@ -0,0 +1,7 @@
+.mat-autocomplete-panel.pac-insight__autocomplete {
+ @apply mb-4;
+}
+
+.pac-indight__answer-panel .mat-expansion-panel-body {
+ padding: 0;
+}
\ No newline at end of file
diff --git a/apps/cloud/src/app/features/home/insight/insight.component.html b/apps/cloud/src/app/features/home/insight/insight.component.html
index 0851e4857..65346af5f 100644
--- a/apps/cloud/src/app/features/home/insight/insight.component.html
+++ b/apps/cloud/src/app/features/home/insight/insight.component.html
@@ -1,6 +1,6 @@
-
-
+
{{ 'PAC.MENU.CALCULATED_MEMBERS' | translate: {Default: "Calculated Members"} }}
diff --git a/apps/cloud/src/app/features/semantic-model/model/entity/cube-structure/cube-structure.component.scss b/apps/cloud/src/app/features/semantic-model/model/entity/cube-structure/cube-structure.component.scss
index ae406193d..5518a0d59 100644
--- a/apps/cloud/src/app/features/semantic-model/model/entity/cube-structure/cube-structure.component.scss
+++ b/apps/cloud/src/app/features/semantic-model/model/entity/cube-structure/cube-structure.component.scss
@@ -1,3 +1,7 @@
+:host {
+ @apply bg-white rounded-lg overflow-hidden shadow-lg border border-solid border-slate-200 m-1;
+}
+
.pac-cdk-drop__placeholder {
@apply bg-gray-200 border-dashed border-2 border-gray-400 min-h-[60px] transition-transform;
}
\ No newline at end of file
diff --git a/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.html b/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.html
index 6ef7ac5af..db7a6ea73 100644
--- a/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.html
+++ b/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.html
@@ -1,4 +1,4 @@
-
+
@@ -42,7 +42,7 @@
{{ 'PAC.MENU.Attributes' | translate: {Default: "Attributes"} }}
-
+
-
diff --git a/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.scss b/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.scss
index 8a346d3c7..ea6e3a5b3 100644
--- a/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.scss
+++ b/apps/cloud/src/app/features/semantic-model/model/entity/entity.component.scss
@@ -1,9 +1,7 @@
:host {
- flex: 1;
- height: 100%;
- display: flex;
- flex-direction: column;
- position: relative;
+ @apply relative h-full flex-1 flex flex-col bg-white;
+
+ --mat-sidenav-content-background-color: theme(colors.white);
&.pac-fullscreen {
position: fixed;
@@ -14,13 +12,11 @@
}
.pac-model-entity__workspace {
- display: flex;
- flex-direction: column;
+ @apply flex flex-col;
}
+
.pac-model-entity__workspace-router {
- display: flex;
- flex-direction: column;
- overflow: hidden;
+ @apply flex flex-col bg-white rounded-lg overflow-hidden shadow-lg border border-solid border-slate-200 m-1;
}
.ngm-property-modeling {
@@ -33,6 +29,10 @@
margin: 5px 0;
}
-// .pac-model__settings-container {
-// width: 300px;
-// }
\ No newline at end of file
+.mat-drawer.mat-drawer-side {
+ @apply border-0;
+}
+
+.pac-model__settings-container {
+ @apply bg-white rounded-lg overflow-hidden shadow-lg border border-solid border-slate-200 m-1;
+}
\ No newline at end of file
diff --git a/apps/cloud/src/app/features/semantic-model/model/entity/structure/structure.component.html b/apps/cloud/src/app/features/semantic-model/model/entity/structure/structure.component.html
index 49ea79b1c..8de561f43 100644
--- a/apps/cloud/src/app/features/semantic-model/model/entity/structure/structure.component.html
+++ b/apps/cloud/src/app/features/semantic-model/model/entity/structure/structure.component.html
@@ -1,8 +1,8 @@
-
+
@@ -111,7 +111,7 @@
- item.visible) || this.measures.find((item) => item.visible)) && this.allVisible
+ return (
+ !!(this.dimensions.find((item) => item.visible) || this.measures.find((item) => item.visible)) && this.allVisible
+ )
}
get visibleEmpty() {
return !(this.dimensions.find((item) => item.visible) || this.measures.find((item) => item.visible))
@@ -68,12 +78,13 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
shareReplay(1)
)
public readonly fectTableFieldOptions$ = this.fectTableFields$.pipe(
- map((properties) => properties.map((property) => ({
- key: property.name,
- value: property,
- caption: property.caption,
-
- })))
+ map((properties) =>
+ properties.map((property) => ({
+ key: property.name,
+ value: property,
+ caption: property.caption
+ }))
+ )
)
options$ = combineLatest([this.modelService.wordWrap$, this.coreService.onThemeChange()]).pipe(
@@ -84,7 +95,7 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
tap((options) => console.debug(`[pac-model-structure] editor options`, options))
)
- public readonly expression$ = this.entityService.cube$.pipe(map((cube) => cube?.expression))
+ public readonly expression = toSignal(this.entityService.cube$.pipe(map((cube) => cube?.expression)))
private _tableJoins = {}
private _tableTypes = {}
@@ -119,7 +130,7 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
this.entityService.select((state) => state.measures)
),
filter(([properties, dimensions, measures]) => isEmpty(this.dimensions) && isEmpty(this.measures)),
- untilDestroyed(this)
+ takeUntilDestroyed(this._destroyRef)
)
.subscribe(([properties, dimensions, measures]) => {
this.dimensions =
@@ -129,7 +140,9 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
)
this.measures =
measures ??
- properties.filter((item) => item.role === AggregationRole.measure || item.dataType?.toLowerCase() === 'numeric')
+ properties.filter(
+ (item) => item.role === AggregationRole.measure || item.dataType?.toLowerCase() === 'numeric'
+ )
this._cdr.detectChanges()
})
}
@@ -158,19 +171,24 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
}
async confirmOverwriteCube() {
- if (!this.dimensions.filter((item) => item.visible).length && !this.measures.filter((item) => item.visible).length) {
- this._toastrService.warning('PAC.MODEL.ENTITY.PleaseSelectFields', {Default: 'Please select fields!'})
+ if (
+ !this.dimensions.filter((item) => item.visible).length &&
+ !this.measures.filter((item) => item.visible).length
+ ) {
+ this._toastrService.warning('PAC.MODEL.ENTITY.PleaseSelectFields', { Default: 'Please select fields!' })
return false
}
const cube = await firstValueFrom(this.entityService.cube$)
if (cube.dimensions?.length || cube.measures?.length) {
- return await firstValueFrom(this._toastrService.confirm({
- code: 'PAC.MODEL.ENTITY.ConfirmOverwriteCube',
- params: {
- Default: 'The cube configured. Confirm overwrite?'
- }
- }))
+ return await firstValueFrom(
+ this._toastrService.confirm({
+ code: 'PAC.MODEL.ENTITY.ConfirmOverwriteCube',
+ params: {
+ Default: 'The cube configured. Confirm overwrite?'
+ }
+ })
+ )
}
return true
@@ -189,7 +207,11 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
const dimensions = this.dimensions
.filter((item) => item.visible)
// Xmla 数据源的直接同步,sql 数据源的 1 生成 olap 维度 2 生成 sql 维度
- .map((item) => modelType === MODEL_TYPE.XMLA ? {...item, __id__: uuid(),} : newDimensionFromColumn(item, modelType === MODEL_TYPE.OLAP))
+ .map((item) =>
+ modelType === MODEL_TYPE.XMLA
+ ? { ...item, __id__: uuid() }
+ : newDimensionFromColumn(item, modelType === MODEL_TYPE.OLAP)
+ )
const measures = this.measures
.filter((item) => item.visible)
@@ -219,8 +241,7 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
}
async createDimension() {
- const levels = this.dimensions
- .filter((item) => item.visible)
+ const levels = this.dimensions.filter((item) => item.visible)
this.entityService.addDimension({
__id__: uuid(),
name: '',
@@ -233,7 +254,7 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
__id__: uuid(),
name: property.name,
caption: property.caption,
- column: property.name,
+ column: property.name
}))
}
]
@@ -302,7 +323,7 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
if (!this._tableJoins[table.__id__]) {
this._tableJoins[table.__id__] = this.tables$.pipe(
map((tables) => tables.find(({ __id__ }) => __id__ === table.__id__)?.join),
- untilDestroyed(this),
+ takeUntilDestroyed(this._destroyRef),
shareReplay(1)
)
}
@@ -312,24 +333,20 @@ export class ModelEntityStructureComponent extends TranslationBaseComponent impl
selectTableType(table: Table) {
if (!this._tableTypes[table?.name]) {
this._tableTypes[table?.name] = this.modelService.selectOriginalEntityType(table?.name).pipe(
- map((entityType) => values(entityType?.properties).map((property) => ({
- value: property,
- key: property.name,
- caption: property.caption
- }))),
- untilDestroyed(this),
+ map((entityType) =>
+ values(entityType?.properties).map((property) => ({
+ value: property,
+ key: property.name,
+ caption: property.caption
+ }))
+ ),
+ takeUntilDestroyed(this._destroyRef),
shareReplay(1)
)
}
return this._tableTypes[table?.name]
}
- setModel(event) {
- // 不再从编辑器修改模型
- // this.entityService.setCube(event.cube)
- // this.entityService.setEntityType(event.entityType)
- }
-
changeExpression(value) {
this.entityService.setExpression(value)
}
diff --git a/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.html b/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.html
index 44c3699cb..e4351a5a2 100644
--- a/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.html
+++ b/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.html
@@ -9,7 +9,7 @@
(modelChange)="onFormChange(model)">
-
+
diff --git a/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.ts b/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.ts
index 57c80511f..9250c5384 100644
--- a/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.ts
+++ b/apps/cloud/src/app/features/semantic-model/model/preferences/preferences.component.ts
@@ -7,7 +7,7 @@ import { FORMLY_ROW, FORMLY_W_1_2 } from '@metad/story/designer'
import { cloneDeep, merge } from 'lodash-es'
import { firstValueFrom, map } from 'rxjs'
import { LANGUAGES, Visibility } from '../../../../@core/types'
-import { TranslationBaseComponent } from 'apps/cloud/src/app/@shared/language/translation-base.component'
+import { TranslationBaseComponent } from '../../../../@shared'
@Component({
selector: 'pac-model-preferences',
@@ -152,7 +152,8 @@ export class ModelPreferencesComponent extends TranslationBaseComponent implemen
key: 'exposeXmla',
type: 'toggle',
props: {
- label: TRANSLATE?.EnableExposeXMLA ?? 'Expose XMLA Service'
+ label: TRANSLATE?.EnableExposeXMLA ?? 'Expose XMLA Service',
+ placeholder: TRANSLATE?.EnableExposeXMLA ?? 'Expose XMLA Service',
}
}
]
diff --git a/apps/cloud/src/app/features/setting/account/account.component.html b/apps/cloud/src/app/features/setting/account/account.component.html
index 9b6839d93..7e913d9fe 100644
--- a/apps/cloud/src/app/features/setting/account/account.component.html
+++ b/apps/cloud/src/app/features/setting/account/account.component.html
@@ -8,7 +8,8 @@
{{user()?.email}}
-
-
+
+
+