Skip to content

Commit

Permalink
Merge pull request #2339 from ORCID/lmendoza/batch-of-fixes-29-aug
Browse files Browse the repository at this point in the history
batch-of-fixes-30-aug
  • Loading branch information
leomendoza123 authored Aug 30, 2024
2 parents 26bbb61 + c0b6610 commit 86eff3e
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
DisplayName,
Institutional,
} from '../../../types/institutional.endpoint'
import { path } from '@angular-devkit/core'

@Component({
selector: 'app-institutional',
Expand Down Expand Up @@ -120,9 +121,11 @@ export class InstitutionalComponent implements OnInit {

ngOnInit() {}

onSubmit() {
this.institutionFormControl.markAllAsTouched()
this.institutionFormControl.markAsDirty()
onSubmit(bypassInlineErrors = false) {
if (!bypassInlineErrors) {
this.institutionFormControl.markAllAsTouched()
this.institutionFormControl.markAsDirty()
}
if (this.institutionalForm.valid || this.entityID) {
this.loading = true

Expand Down Expand Up @@ -188,15 +191,11 @@ export class InstitutionalComponent implements OnInit {
institutions.push(btoa(this.entityID))
}
// Encode cookie base 64
this._cookie.set(
'_saml_institutional',
institutions.join('%20'),
dateCookie !== null ? dateCookie : this.cookieExpirationTime
)
localStorage.setItem('_saml_institutional', institutions.join('%20'))
}

retrieveUserSelectedIdPs() {
let cookieValues = this._cookie.get('_saml_institutional')
let cookieValues = localStorage.getItem('_saml_institutional')
if (cookieValues) {
cookieValues = cookieValues.replace(/^\s+|\s+$/g, '')
cookieValues = cookieValues.replace('+', '%20')
Expand All @@ -217,7 +216,7 @@ export class InstitutionalComponent implements OnInit {

selectInstitution(institution: Institutional) {
this.entityID = institution.entityID
this.onSubmit()
this.onSubmit(true)
}

navigateTo(val) {
Expand Down

0 comments on commit 86eff3e

Please sign in to comment.