Skip to content

Commit

Permalink
3046 issues fixed (#836)
Browse files Browse the repository at this point in the history
* 3046 issues fixed

* environment changes updated
  • Loading branch information
ajithmuthukumar-bc authored Nov 2, 2022
1 parent ba30ae3 commit e57c8a1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ <h2 class="govuk-heading-s"> {{ 'BUYER_SUPPLIER_TYPE' | translate }}</h2>
{{ 'SIGN_IN_PROVIDER'| translate }}
</legend>
<div id="signin-hint" class="govuk-hint" style="color: black;">
A sign in provider gives users the option to use a different service to sign in. Sign in providers are set at an
organisational level. Any updates applied here will apply to all of your organisation’s users
{{ idpStatus == false ? 'A sign in provider gives users the option to use a different service to sign in. Sign in providers are set at an
organisational level. Any updates applied here will apply to all of your organisation’s users' : (idpStatus == true ? 'Users can only use a User ID and password to sign in. You may be able to allow additional sign-in methods in the future.' : '')}}
</div>
<span *ngIf="!isValid && submitted" id="group-error" class="govuk-error-message label-detail-text-gap">
<span class="govuk-visually-hidden">{{ 'ERROR_PREFIX' | translate }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class ManageOrganisationProfileComponent extends BaseComponent implements
changedIdpList: { id: number, enabled: boolean, connectionName: string, name: string }[] = [];
ccsContactUrl: string = environment.uri.ccsContactUrl;
schemeData: any[] = [];
public idpStatus = environment.appSetting.hideIDP
public detailsData: any = [
'Send messages to multiple contacts in your organisation. You can also send targeted communications to specific users.',
"Manage information about your organisation's specific business locations. For instance, you can add details about your head office and additional sites to organise deliveries.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
{{ 'SIGN_IN_PROVIDER'| translate }}
</legend>
<span class="sign_in_prov">
A sign in provider gives users the option to use a different service to sign in. Sign in
{{ idpStatus == false ? 'A sign in provider gives users the option to use a different service to sign in. Sign in
providers are set at an organisational level. To update the sign in providers for your
Organisation’s users please go to Manage organisations
Organisation’s users please go to Manage organisations' : (idpStatus == true ? 'You can only use a User ID and password to sign in. You may be able to use additional sign-in methods in the future.' : '')}}
</span>
<span id="group-error" class="govuk-error-message label-detail-text-gap"
*ngIf="submitted && formGroup.hasError('identityProviderRequired')">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { FormBaseComponent } from 'src/app/components/form-base/form-base.compon
import { SessionStorageKey } from 'src/app/constants/constant';
import { PatternService } from 'src/app/shared/pattern.service';
import { WrapperConfigurationService } from 'src/app/services/wrapper/wrapper-configuration.service';
import { environment } from 'src/environments/environment';

@Component({
selector: 'app-manage-user-add-single-user-detail',
Expand All @@ -53,6 +54,7 @@ export class ManageUserAddSingleUserDetailComponent
state: any;
hasGroupViewPermission: boolean = false;
mfaAdminValidationError: boolean = false;
public idpStatus = environment.appSetting.hideIDP
public detailsData: any = [
'Add additional security steps to make an account more secure. Additional security needs to be enabled for all admin users. This can be accessed using a personal or work digital device.',
'Groups allow you to manage large numbers of users all at once. Roles can be applied to groups to organise user’s more efficiently and allow bulk access to relevant services where it is required.',
Expand Down
7 changes: 6 additions & 1 deletion src/app/pages/user-profile/user-profile-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { FormBaseComponent } from 'src/app/components/form-base/form-base.compon
import { SessionStorageKey } from 'src/app/constants/constant';
import { PatternService } from 'src/app/shared/pattern.service';
import { isBoolean } from 'lodash';
import { environment } from 'src/environments/environment';

@Component({
selector: 'app-user-profile',
Expand Down Expand Up @@ -116,10 +117,14 @@ export class UserProfileComponent extends FormBaseComponent implements OnInit {
let user = await this.userService.getUser(this.userName).toPromise();
if (user != null) {
this.canChangePassword = user.detail.canChangePassword;
this.identityProviderDisplayName =
if(!environment.appSetting.hideIDP){
this.identityProviderDisplayName =
user.detail.identityProviders
?.map((idp) => idp.identityProviderDisplayName)
.join(',') || '';
}else {
this.identityProviderDisplayName = 'User ID and password'
}
this.userGroups = user.detail.userGroups || [];
this.userGroups = this.userGroups.filter(
(group, index, self) =>
Expand Down
14 changes: 9 additions & 5 deletions src/app/services/wrapper/wrapper-configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ export class WrapperConfigurationService {
const url = `${this.url}/identity-providers`;
return this.http.get<IdentityProvider[]>(url, this.options).pipe(
map((data: IdentityProvider[]) => {
if(environment.appSetting.hideIDP){
data.map((f: IdentityProvider) => {
if (f.name === 'User ID and password') {
tempData.push(f)
}
})
return tempData;
if (f.name === 'User ID and password') {
tempData.push(f)
}
})
return tempData;
} else {
return data
}
}), catchError(error => {
return throwError(error);
})
Expand Down
4 changes: 3 additions & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@ export const environment = {
__cf_bm : 30
},
},
appSetting: {
hideIDP:true,
},
};

0 comments on commit e57c8a1

Please sign in to comment.