Skip to content

Commit

Permalink
Merge branch 'develop-6.7.x' into epic/b2b-commerce-quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Larisa-Staroverova committed Nov 10, 2023
2 parents 8a0ec22 + e39f1ff commit 0f8c33a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
<div class="property full-width">
<label>{{ 'orgUser.uid' | cxTranslate }}</label>
<span class="value">
{{ model.uid }}
<ng-container *cxFeatureLevel="'6.7'">
{{ model.displayUid }}
</ng-container>
<ng-container *cxFeatureLevel="'!6.7'">
{{ model.uid }}
</ng-container>
</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { I18nModule, UrlModule } from '@spartacus/core';
import { FeaturesConfigModule, I18nModule, UrlModule } from '@spartacus/core';
import { KeyboardFocusModule } from '@spartacus/storefront';
import { ItemExistsModule } from '../../shared/item-exists.module';
import { CardModule } from '../../shared/card/card.module';
import { DisableInfoModule } from '../../shared/detail/disable-info/disable-info.module';
import { ToggleStatusModule } from '../../shared/detail/toggle-status-action/toggle-status.module';
import { ItemExistsModule } from '../../shared/item-exists.module';
import { UserDetailsComponent } from './user-details.component';
import { DisableInfoModule } from '../../shared/detail/disable-info/disable-info.module';

@NgModule({
imports: [
Expand All @@ -26,6 +26,7 @@ import { DisableInfoModule } from '../../shared/detail/disable-info/disable-info
ItemExistsModule,
DisableInfoModule,
KeyboardFocusModule,
FeaturesConfigModule,
],
declarations: [UserDetailsComponent],
exports: [UserDetailsComponent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import {
UntypedFormArray,
UntypedFormControl,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { B2BUser, B2BUserRole } from '@spartacus/core';
import { B2BUser, B2BUserRole, FeatureConfigService } from '@spartacus/core';
import { CustomFormValidators } from '@spartacus/storefront';
import { FormService } from '../../shared/form/form.service';

@Injectable({
providedIn: 'root',
})
export class UserFormService extends FormService<B2BUser> {
protected readonly featureConfigService = inject(FeatureConfigService, {
optional: true,
});

protected build() {
const form = new UntypedFormGroup({});
form.setControl('customerId', new UntypedFormControl(''));
Expand Down Expand Up @@ -68,6 +72,10 @@ export class UserFormService extends FormService<B2BUser> {
roles.push(new UntypedFormControl(role));
}
});

if (this.featureConfigService?.isLevel('6.7')) {
this.form?.get('email')?.setValue(item?.displayUid);
}
}
}
}

0 comments on commit 0f8c33a

Please sign in to comment.