Skip to content

Commit

Permalink
Revert "Removed the feature flag from identity page (#551)"
Browse files Browse the repository at this point in the history
This reverts commit fe497ae.
  • Loading branch information
lakshayman authored Feb 6, 2024
1 parent 222dbdb commit d9d76ec
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 38 deletions.
7 changes: 7 additions & 0 deletions app/controllers/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export default class IdentityController extends Controller {
return 'getStarted';
}

get isDev() {
if (this.router.currentRoute) {
return this.router.currentRoute.queryParams.dev;
}
return false;
}

@tracked state = this.intialState;

@action setState(value) {
Expand Down
173 changes: 135 additions & 38 deletions app/templates/identity.hbs
Original file line number Diff line number Diff line change
@@ -1,43 +1,140 @@
{{page-title 'Identity'}}

<div class='identity-page'>
<img alt='header' class='identity-header' src='identity/header.svg' />
<img alt='hero' class='identity-hero' src='identity/hero.svg' />
<img alt='rds' class='identity-rds-logo' src='identity/logo.svg' />
{{#if (eq this.state 'getStarted')}}
<div class='identity-heading'>Connect your Profile Service with Identity
Service</div>
{{/if}}
<div class='identity-box'>
{{#if this.isDev}}
<div class='identity-page'>
<img alt="header" class='identity-header' src='identity/header.svg' />
<img alt="hero" class='identity-hero' src='identity/hero.svg' />
<img alt="rds" class='identity-rds-logo' src='identity/logo.svg' />
{{#if (eq this.state 'getStarted')}}
<Identity::GetStarted @setState={{this.setState}} />
{{else if (eq this.state 'step1')}}
<Identity::Step1 @setState={{this.setState}} />
{{else if (eq this.state 'step2')}}
<Identity::Step2
@setState={{this.setState}}
@profileURL={{@model.profileURL}}
/>
{{else if (eq this.state 'step3')}}
<Identity::Step3 @setState={{this.setState}} />
{{else if (eq this.state 'reload')}}
<Identity::Reload />
{{else if (eq this.state 'verified')}}
<Identity::Verified />
{{else if (eq this.state 'blocked')}}
<Identity::Blocked @setState={{this.setState}} />
<div class='identity-heading'>Connect your Profile Service with Identity
Service</div>
{{/if}}
<div class='identity-box'>
{{#if (eq this.state 'getStarted')}}
<Identity::GetStarted @setState={{this.setState}} />
{{else if (eq this.state 'step1')}}
<Identity::Step1 @setState={{this.setState}} />
{{else if (eq this.state 'step2')}}
<Identity::Step2
@setState={{this.setState}}
@profileURL={{@model.profileURL}}
/>
{{else if (eq this.state 'step3')}}
<Identity::Step3 @setState={{this.setState}} />
{{else if (eq this.state 'reload')}}
<Identity::Reload />
{{else if (eq this.state 'verified')}}
<Identity::Verified />
{{else if (eq this.state 'blocked')}}
<Identity::Blocked @setState={{this.setState}} />
{{/if}}
</div>
<img
alt="header-hero"
class='identity-header-hero'
src='identity/header-hero.svg'
width='10%'
/>
<img alt="footer" class='identity-footer' src='identity/footer.svg' width='100%' />
</div>
<img
alt='header-hero'
class='identity-header-hero'
src='identity/header-hero.svg'
width='10%'
/>
<img
alt='footer'
class='identity-footer'
src='identity/footer.svg'
width='100%'
/>
</div>
{{else}}
<h1 class='identity-heading'>
Identity Service Verification
</h1>
<div class='identity-container'>
{{#if (eq @model.profileStatus 'PENDING')}}
<p>Verification process is Pending!</p>
<button
type='button'
{{on 'click' (fn this.handleRefresh)}}
>Refresh</button>
{{else if (eq @model.profileStatus 'VERIFIED')}}
<p>Verification Done!</p>
{{else}}
{{#if (eq @model.profileStatus 'BLOCKED')}}
<p>Your previous chaincode is blocked for some reason. Please generate a
new chaincode.</p>
{{/if}}
<div class='chaincode-div'>
<label class='identity-label'>
{{#if this.isChaincodeClicked}}
<label class='chaincode'>{{this.Chaincode}}</label>

<Input
class='copy-button'
type='button'
@value='Copy'
{{on 'click' (fn this.handleCopy)}}
/>

{{else}}
<div class='btn-container'>
<Input
class='identity-Buttons'
type='button'
@value={{this.Chaincode}}
{{on 'click' (fn this.handleGenerateChaincode)}}
disabled={{this.generateChainCodeDisabled}}
/>
</div>
{{/if}}
</label>
</div>

<div class='input-div'>
<div class='identity__input-container'>
<label
class={{if this.profileURL 'identity__profileURL-filled'}}
>Profile URL</label>
<Input
class='input-url'
@value={{this.profileURL}}
type='text'
onkeyup={{this.changeSaveDisabled}}
/>
</div>
<div class='btn-container'>
<button
disabled={{this.saveDisabled}}
{{on 'mouseenter' (fn this.setError 'SAVE_BUTTON')}}
{{on 'mouseleave' this.resetError}}
type='submit'
class='identity-Buttons edit'
{{on 'click' (fn this.handleEdit)}}
>
{{#if this.isEditClicked}}
<i class='fa fa-spinner fa-spin'></i>
{{/if}}
Save
</button>
</div>
</div>

<label class='identity-check-label'>
I have saved my profile URL, generated a chaincode<br />and successfully
added that to my service.
<Input
@type='checkbox'
@checked={{this.isChecked}}
disabled={{this.checkboxDisabled}}
{{on 'mouseenter' (fn this.setError 'CHECKBOX')}}
{{on 'mouseleave' this.resetError}}
/>
</label>
<button
type='submit'
class='identity-verify-btn'
disabled={{not this.isChecked}}
{{on 'click' (fn this.handleVerify)}}
{{on 'mouseenter' (fn this.setError 'VERIFY_BUTTON')}}
{{on 'mouseleave' this.resetError}}
>
{{#if this.isVerifyClicked}}
<i class='fa fa-spinner fa-spin'></i>
{{/if}}
Link Chaincode
</button>
<p class='identity-error-message'>{{this.identityError}}</p>
{{/if}}
</div>
{{/if}}

0 comments on commit d9d76ec

Please sign in to comment.