From 661c770df35511c8cec13affd0ee99939567ca3d Mon Sep 17 00:00:00 2001 From: Shubham Sharma <68867418+skv93-coder@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:02:56 +0530 Subject: [PATCH 1/6] Feature/task details page linking (#553) * Added links for task card to direct to task details page * Added test case and added env * Change the class name * Added title for the anchor tag. * Changed the title --------- Co-authored-by: Shubham Sharma --- app/components/task-details.hbs | 6 +++++- app/components/task/holder.hbs | 1 + app/components/task/holder.js | 7 ++++++- app/styles/tasks.css | 4 ++++ config/environment.js | 3 +++ tests/integration/components/tasks/holder-test.js | 6 ++++++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/components/task-details.hbs b/app/components/task-details.hbs index cc3c345d..7b666d7a 100644 --- a/app/components/task-details.hbs +++ b/app/components/task-details.hbs @@ -1,6 +1,10 @@
-

{{@task.title}}

+

{{@task.title}}

diff --git a/app/components/task/holder.js b/app/components/task/holder.js index a25b3f3b..1f908ec8 100644 --- a/app/components/task/holder.js +++ b/app/components/task/holder.js @@ -3,6 +3,9 @@ import { action } from '@ember/object'; import { TASK_KEYS, TASK_STATUS_LIST } from 'website-my/constants/tasks'; import { tracked } from '@glimmer/tracking'; import { TASK_PERCENTAGE } from '../../constants/tasks'; +import ENV from 'website-my/config/environment'; + +const STATUS_SITE = ENV.STATUS_SITE; export default class TasksHolderComponent extends Component { @tracked percentCompleted = this.args.task.percentCompleted; @@ -101,7 +104,9 @@ export default class TasksHolderComponent extends Component { get isProgressBarDisabled() { return this.status !== TASK_KEYS.IN_PROGRESS; } - + get taskDetailsURL() { + return `${STATUS_SITE}/tasks/${this.args.task.id}`; + } @action async onPercentageChange(e) { const { value } = e.target; diff --git a/app/styles/tasks.css b/app/styles/tasks.css index 2ada6933..22788c88 100644 --- a/app/styles/tasks.css +++ b/app/styles/tasks.css @@ -544,6 +544,10 @@ margin: 10px; } +.task-details__status-site-link { + text-decoration: none; +} + @media screen and (max-width: 720px) { .task-card { width: 90%; diff --git a/config/environment.js b/config/environment.js index 798a2d1a..3a402a68 100644 --- a/config/environment.js +++ b/config/environment.js @@ -32,6 +32,7 @@ module.exports = function (environment) { if (environment === 'development') { ENV.BASE_API_URL = 'http://localhost:3000'; + ENV.STATUS_SITE = 'https://staging-status.realdevsquad.com'; ENV.MIXPANEL_TOKEN = 'TEST_TOKEN'; ENV['ember-cli-mirage'] = { enabled: false, @@ -57,6 +58,7 @@ module.exports = function (environment) { ENV.APP.autoboot = false; //mock server url ENV.BASE_API_URL = '/mock-api'; + ENV.STATUS_SITE = 'http://localhost:3000'; } if (environment === 'staging') { @@ -66,6 +68,7 @@ module.exports = function (environment) { if (environment === 'production') { // here you can enable a production-specific feature ENV.BASE_API_URL = 'https://api.realdevsquad.com'; + ENV.STATUS_SITE = 'https://status.realdevsquad.com'; } return ENV; diff --git a/tests/integration/components/tasks/holder-test.js b/tests/integration/components/tasks/holder-test.js index 1a7f6ddb..95bd7560 100644 --- a/tests/integration/components/tasks/holder-test.js +++ b/tests/integration/components/tasks/holder-test.js @@ -39,6 +39,12 @@ module('Integration | Component | Tasks Holder', function (hooks) { .innerText, 'Extension Status' ); + assert.equal( + this.element + .querySelector('.task-details__status-site-link') + .getAttribute('href'), + 'http://localhost:3000/tasks/t4' + ); }); test('Render Task holder and check wether it has progress bar', async function (assert) { From fe497aee425321e36141a1261d2533175b7cfc69 Mon Sep 17 00:00:00 2001 From: Lakshay Manchanda <45519620+lakshayman@users.noreply.github.com> Date: Thu, 1 Feb 2024 00:08:00 +0530 Subject: [PATCH 2/6] Removed the feature flag from identity page (#551) --- app/controllers/identity.js | 7 -- app/templates/identity.hbs | 173 ++++++++---------------------------- 2 files changed, 38 insertions(+), 142 deletions(-) diff --git a/app/controllers/identity.js b/app/controllers/identity.js index 7af80206..4497d190 100644 --- a/app/controllers/identity.js +++ b/app/controllers/identity.js @@ -37,13 +37,6 @@ 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) { diff --git a/app/templates/identity.hbs b/app/templates/identity.hbs index 2a6e1883..4167f53c 100644 --- a/app/templates/identity.hbs +++ b/app/templates/identity.hbs @@ -1,140 +1,43 @@ {{page-title 'Identity'}} -{{#if this.isDev}} -
- header - hero - +
+ header + hero + + {{#if (eq this.state 'getStarted')}} +
Connect your Profile Service with Identity + Service
+ {{/if}} +
{{#if (eq this.state 'getStarted')}} -
Connect your Profile Service with Identity - Service
+ + {{else if (eq this.state 'step1')}} + + {{else if (eq this.state 'step2')}} + + {{else if (eq this.state 'step3')}} + + {{else if (eq this.state 'reload')}} + + {{else if (eq this.state 'verified')}} + + {{else if (eq this.state 'blocked')}} + {{/if}} -
- {{#if (eq this.state 'getStarted')}} - - {{else if (eq this.state 'step1')}} - - {{else if (eq this.state 'step2')}} - - {{else if (eq this.state 'step3')}} - - {{else if (eq this.state 'reload')}} - - {{else if (eq this.state 'verified')}} - - {{else if (eq this.state 'blocked')}} - - {{/if}} -
- header-hero - footer
-{{else}} -

- Identity Service Verification -

-
- {{#if (eq @model.profileStatus 'PENDING')}} -

Verification process is Pending!

- - {{else if (eq @model.profileStatus 'VERIFIED')}} -

Verification Done!

- {{else}} - {{#if (eq @model.profileStatus 'BLOCKED')}} -

Your previous chaincode is blocked for some reason. Please generate a - new chaincode.

- {{/if}} -
- -
- -
-
- - -
-
- -
-
- - - -

{{this.identityError}}

- {{/if}} -
-{{/if}} \ No newline at end of file + header-hero + footer +
\ No newline at end of file From 9f1b2711493e4c288e01e752d78b8db6d2aaaf6a Mon Sep 17 00:00:00 2001 From: Joy <56365512+ardourApeX@users.noreply.github.com> Date: Fri, 2 Feb 2024 01:53:37 +0530 Subject: [PATCH 3/6] Chore : Hard coded ETA time for extension requests to 5:30AM (#556) --- app/components/task/multiple-extension-form.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/task/multiple-extension-form.js b/app/components/task/multiple-extension-form.js index ffdaeb0f..6079a8d5 100644 --- a/app/components/task/multiple-extension-form.js +++ b/app/components/task/multiple-extension-form.js @@ -93,7 +93,11 @@ export default class ExtensionFormComponent extends Component { this.createExtensionRequestError = null; this.isSubmitButtonDisabled = true; const formData = new FormData(e.target); - const extensionTime = new Date(formData.get('newEndsOn')).getTime() / 1000; + const newEndsOn = new Date(formData.get('newEndsOn')); + newEndsOn.setHours(5); + newEndsOn.setMinutes(30); + newEndsOn.setSeconds(0); + const extensionTime = newEndsOn.getTime() / 1000; const json = {}; formData.forEach(function (value, key) { json[key] = value; From 4cd68b1f65cd73e1fd426f1c93652e30a0ebb4d6 Mon Sep 17 00:00:00 2001 From: Shubham Sharma Date: Sat, 3 Feb 2024 09:28:57 +0530 Subject: [PATCH 4/6] Added STATUS_SITE env var for staging --- config/environment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environment.js b/config/environment.js index 3a402a68..7292d216 100644 --- a/config/environment.js +++ b/config/environment.js @@ -63,6 +63,7 @@ module.exports = function (environment) { if (environment === 'staging') { ENV.BASE_API_URL = 'https://staging-api.realdevsquad.com'; + ENV.STATUS_SITE = 'https://staging-status.realdevsquad.com'; } if (environment === 'production') { From 222dbdbce4bf39fab972c5cafa87dcc2eb04e56b Mon Sep 17 00:00:00 2001 From: Joy <56365512+ardourApeX@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:10:05 +0530 Subject: [PATCH 5/6] Chore : Removed feature flag from extension request (#564) * Chore : Removed feature flag from extension request * Style : Fixed progress bar issue * Style : Converted % into rem --- app/components/task/extension-form.hbs | 78 ----- app/components/task/extension-form.js | 160 ----------- app/components/task/holder.hbs | 21 +- app/styles/tasks.css | 18 ++ .../components/tasks/extension-form-test.js | 267 ------------------ .../tasks/multiple-extension-form-test.js | 72 +---- 6 files changed, 27 insertions(+), 589 deletions(-) delete mode 100644 app/components/task/extension-form.hbs delete mode 100644 app/components/task/extension-form.js delete mode 100644 tests/integration/components/tasks/extension-form-test.js diff --git a/app/components/task/extension-form.hbs b/app/components/task/extension-form.hbs deleted file mode 100644 index 0f32dce7..00000000 --- a/app/components/task/extension-form.hbs +++ /dev/null @@ -1,78 +0,0 @@ -
-
-
-

{{@title}}

- {{#if this.createExtensionRequest}} -
-

Create Extension Request!!!

-
- {{#if this.createExtensionRequestError}} -

Error: {{this.createExtensionRequestError}}

- {{/if}} - - - -

Old ETA - {{this.oldETA}}

- - - - -
-
- {{else}} -
- {{#if this.extensionData.value}} -
- {{#each this.extensionData.value as |extension|}} - - {{/each}} -
- {{else if this.extensionData.isLoading}} -
- -
- {{else if this.extensionData.error}} -

{{this.extensionData.error}}

- - {{/if}} -
- {{/if}} - -
-
\ No newline at end of file diff --git a/app/components/task/extension-form.js b/app/components/task/extension-form.js deleted file mode 100644 index c9867b83..00000000 --- a/app/components/task/extension-form.js +++ /dev/null @@ -1,160 +0,0 @@ -import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import { resource, use } from 'ember-resources'; -import { TrackedMap } from 'tracked-maps-and-sets'; -import ENV from 'website-my/config/environment'; -import { action } from '@ember/object'; -import { WARNING_INVALID_NEW_ETA } from '../../constants/user-status'; -import { toastNotificationTimeoutOptions } from '../../constants/toast-notification'; -import { inject as service } from '@ember/service'; - -export default class ExtensionFormComponent extends Component { - @tracked createExtensionRequest = false; - @tracked createExtensionRequestError = null; - @tracked disableExtensionRequestClose = false; - @service toast; - @service userState; - - oldETA = new Date(this.args.task.endsOn * 1000).toLocaleString(); - - @use load = resource(({ on }) => { - const state = new TrackedMap(); - const controller = new AbortController(); - - on.cleanup(() => controller.abort()); - (async () => { - if (this.args.task) { - state.set('isLoading', true); - try { - const response = await fetch( - `${ENV.BASE_API_URL}/extension-requests/self/?taskId=${this.args.task.id}`, - { - credentials: 'include', - signal: controller.signal, - } - ); - if (response.status === 200) { - const data = await response.json(); - if (!data.allExtensionRequests.length) { - throw Error( - 'No extension request found for this task, want to create one?' - ); - } - state.set('value', data.allExtensionRequests); - state.set('isLoading', false); - return; - } - this.toast.error('Something went wrong!', '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - } catch (error) { - state.set('error', error.message); - state.set('isLoading', false); - console.error(error); - this.toast.error(error.message, '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - } - } - })(); - - return state; - }); - - get extensionData() { - const result = {}; - result['isLoading'] = this.load.get('isLoading'); - result['value'] = this.load.get('value'); - result['error'] = this.load.get('error'); - return result; - } - - @action - createExtensionRequestToggle(e) { - e.stopPropagation(); - this.createExtensionRequest = !this.createExtensionRequest; - } - - @action - async submitExtensionRequest(e) { - e.preventDefault(); - this.disableExtensionRequestClose = true; - this.createExtensionRequestError = null; - //submit button - e.submitter.disabled = true; - const formData = new FormData(e.target); - const extensionTime = new Date(formData.get('newEndsOn')).getTime() / 1000; - const json = {}; - formData.forEach(function (value, key) { - json[key] = value; - }); - - if (extensionTime < this.args.task.endsOn) { - this.toast.error(WARNING_INVALID_NEW_ETA, '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - e.submitter.disabled = false; - this.disableExtensionRequestClose = false; - this.createExtensionRequestError = - 'The newEndsOn value cannot be smaller than the oldEndsOn value'; - return; - } - json['newEndsOn'] = extensionTime; - //setting default values - json['taskId'] = this.args.task.id; - json['assignee'] = this.userState.get('id'); - json['oldEndsOn'] = this.args.task.endsOn; - json['status'] = 'PENDING'; - - try { - const response = await fetch(`${ENV.BASE_API_URL}/extension-requests`, { - credentials: 'include', - method: 'POST', - body: JSON.stringify(json), - headers: { - 'Content-Type': 'application/json', - }, - }); - const data = await response.json(); - if (data.message === 'Extension Request created successfully!') { - this.disableExtensionRequestClose = false; - this.toast.success(data.message, '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - setTimeout(this.args.closeModel, 2000); - return; - } - this.toast.error('Something went wrong!', '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - e.submitter.disabled = false; - } catch (error) { - this.toast.error(error.message, '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - setTimeout(this.args.closeModel, 2000); - } - } - - @action - changeExtensionRequestETA(e) { - const extensionTime = new Date(e.target.value).getTime() / 1000; - - if (extensionTime < this.args.task.endsOn) { - this.toast.error(WARNING_INVALID_NEW_ETA, '', { - ...toastNotificationTimeoutOptions, - timeOut: '3000', - }); - e.target.value = ''; - this.createExtensionRequestError = - 'The newEndsOn value cannot be smaller than the oldEndsOn value'; - return; - } else this.createExtensionRequestError = null; - } -} diff --git a/app/components/task/holder.hbs b/app/components/task/holder.hbs index f4cb4708..56adab52 100644 --- a/app/components/task/holder.hbs +++ b/app/components/task/holder.hbs @@ -15,21 +15,12 @@
{{#if this.extensionFormOpened}} - {{#if @dev}} - - {{else}} - - {{/if}} + {{/if}} {{#if (not-eq this.status this.TASK_KEYS.VERIFIED)}} diff --git a/app/styles/tasks.css b/app/styles/tasks.css index 22788c88..09a86c65 100644 --- a/app/styles/tasks.css +++ b/app/styles/tasks.css @@ -182,6 +182,24 @@ justify-content: space-between; align-items: center; } +.task-details__title-container a { + max-width: 18.5rem; +} +@media screen and (min-width: 900px) { + .task-details__title-container a { + max-width: 18.3rem; + } +} +@media screen and ((max-width: 900px) and (min-width: 720px)) { + .task-details__title-container a { + max-width: 18.3rem; + } +} +@media screen and (max-width: 720px) { + .task-details__title-container a { + max-width: 100%; + } +} #task-update { border: 1px solid var(--tasks-page--text); diff --git a/tests/integration/components/tasks/extension-form-test.js b/tests/integration/components/tasks/extension-form-test.js deleted file mode 100644 index f63b8a31..00000000 --- a/tests/integration/components/tasks/extension-form-test.js +++ /dev/null @@ -1,267 +0,0 @@ -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { tasks } from 'website-my/tests/fixtures/tasks'; -import { extensionRequests } from 'website-my/tests/fixtures/extension-requests'; -import { render, click, fillIn, waitFor } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; -import makeServer from 'website-my/mirage/config'; - -module('Integration | Component | Extension Request Form', function (hooks) { - setupRenderingTest(hooks); - let tasksData, extensionFormOpened, server; - - hooks.after(function () { - server.shutdown(); - }); - - hooks.before(function () { - tasksData = tasks; - extensionFormOpened = true; - server = makeServer({ environment: 'test' }); - extensionRequests.forEach((obj) => { - server.create('extensionRequest', obj); - }); - }); - - const toggleExtensionForm = (setter, name) => { - extensionFormOpened = !extensionFormOpened; - if (setter) { - setter(name, extensionFormOpened); - } - }; - - const closeExtensionForm = (setter, name) => () => { - extensionFormOpened = false; - if (setter) { - setter(name, false); - } - }; - - const closeExtensionModel = (setter, name) => (e) => { - if (!e) { - toggleExtensionForm(setter, name); - return; - } - e.stopPropagation(); - if (e.target.classList.contains('extension-form__container-back')) { - toggleExtensionForm(setter, name); - } - }; - - test('When Clicked /"Close Form/" button or background task extension form should unmount', async function (assert) { - this.set('task', tasksData[0]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - this.set('extensionFormOpened', extensionFormOpened); - - await render( - hbs` - {{#if this.extensionFormOpened}} - - {{/if}}` - ); - assert - .dom(this.element.querySelector('[data-test-title]')) - .hasText('Form for extension Request'); - await click( - this.element.querySelector('[data-test-extension-form-container-close]') - ); - assert.dom(this.element.querySelector('[data-test-title]')).doesNotExist(); - - extensionFormOpened = true; - this.set('extensionFormOpened', extensionFormOpened); - assert - .dom(this.element.querySelector('[data-test-title]')) - .hasText('Form for extension Request'); - await click( - this.element.querySelector('[data-test-extension-form-container-back]') - ); - assert.dom(this.element.querySelector('[data-test-title]')).doesNotExist(); - }); - - test('When no extension requests found, the option to create extension request should show and then later open form', async function (assert) { - this.set('task', tasksData[3]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - - await render( - hbs`` - ); - await waitFor('[data-test-create-extension-button]'); - assert - .dom(this.element.querySelector('[data-test-create-extension-button]')) - .hasText('Create an extension request'); - - await click( - this.element.querySelector('[data-test-create-extension-button]') - ); - assert - .dom( - this.element - .querySelector('[data-test-extension-from-content]') - .querySelector('button[type=submit]') - ) - .exists(); - }); - - test('When creating extension request, if the newEndsOn is smaller than the oldEndsOn then should throw error', async function (assert) { - this.set('task', tasksData[3]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - - await render( - hbs`` - ); - await waitFor('[data-test-create-extension-button]'); - assert - .dom(this.element.querySelector('[data-test-create-extension-button]')) - .hasText('Create an extension request'); - - await click( - this.element.querySelector('[data-test-create-extension-button]') - ); - assert - .dom( - this.element - .querySelector('[data-test-extension-from-content]') - .querySelector('button[type=submit]') - ) - .exists(); - - await fillIn( - '[data-test-extension-form-newEndsOn-input]', - '2022-09-09T09:45' - ); - assert - .dom(this.element.querySelector('[data-test-extension-from-error]')) - .hasText( - 'Error: The newEndsOn value cannot be smaller than the oldEndsOn value' - ); - - // if filled valid time then remove the error - await fillIn( - '[data-test-extension-form-newEndsOn-input]', - '2023-09-09T09:45' - ); - assert - .dom(this.element.querySelector('[data-test-extension-from-error]')) - .doesNotExist(); - }); - - test('When no extension requests found, we should be able to create one', async function (assert) { - this.set('task', tasksData[3]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - - await render( - hbs`` - ); - await waitFor('[data-test-create-extension-button]'); - assert - .dom(this.element.querySelector('[data-test-create-extension-button]')) - .hasText('Create an extension request'); - - await click( - this.element.querySelector('[data-test-create-extension-button]') - ); - assert - .dom( - this.element - .querySelector('[data-test-extension-from-content]') - .querySelector('button[type=submit]') - ) - .exists(); - - //create extension request - await fillIn('[data-test-extension-form-reason-input]', 'Testing'); - await fillIn( - '[data-test-extension-form-newEndsOn-input]', - '2030-12-31T02:43' - ); - await fillIn('[data-test-extension-form-title-input]', 'TestingAgain'); - await click(this.element.querySelector('button[type=submit]')); - - // rendering the component again to check the new data - await render( - hbs`` - ); - await waitFor('[data-test-extension-info-content]'); - assert - .dom(this.element.querySelector('[data-test-extension-info-content]')) - .containsText('Testing') - .containsText('TestingAgain') - .containsText('PENDING'); - }); - - test('When extension requests found, it should display the data', async function (assert) { - let extensionRequestData = extensionRequests[0]; - this.set('task', tasksData[0]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - - await render( - hbs`` - ); - await waitFor('[data-test-extension-info-content]'); - assert - .dom(this.element.querySelector('[data-test-extension-info-content]')) - .containsText(extensionRequestData['title']) - .containsText(extensionRequestData['reason']) - .containsText(extensionRequestData['status']); - }); -}); diff --git a/tests/integration/components/tasks/multiple-extension-form-test.js b/tests/integration/components/tasks/multiple-extension-form-test.js index 9e101ae2..913d557d 100644 --- a/tests/integration/components/tasks/multiple-extension-form-test.js +++ b/tests/integration/components/tasks/multiple-extension-form-test.js @@ -134,17 +134,13 @@ module('Integration | Component | Multiple Extension Form', function (hooks) { ); await render( - hbs`` ); await waitFor('[data-test-create-extension-button]'); - assert - .dom(this.element.querySelector('[data-test-create-extension-button]')) - .hasText('Create an extension request'); - await click( this.element.querySelector('[data-test-create-extension-button]') ); @@ -162,9 +158,7 @@ module('Integration | Component | Multiple Extension Form', function (hooks) { ); assert .dom(this.element.querySelector('[data-test-extension-from-error]')) - .hasText( - 'Error: The newEndsOn value cannot be smaller than the oldEndsOn value' - ); + .hasText('New ETA must be greater than Old ETA'); await settled(); // if filled valid time then remove the error @@ -174,67 +168,7 @@ module('Integration | Component | Multiple Extension Form', function (hooks) { ); assert .dom(this.element.querySelector('[data-test-extension-from-error]')) - .doesNotExist(); - }); - - test('When no extension requests found, we should be able to create one', async function (assert) { - this.set('task', tasksData[3]); - this.set( - 'closeExtensionModel', - closeExtensionModel(this.set, 'extensionFormOpened') - ); - this.set( - 'closeExtensionForm', - closeExtensionForm(this.set, 'extensionFormOpened') - ); - - await render( - hbs`` - ); - await waitFor('[data-test-create-extension-button]'); - assert - .dom(this.element.querySelector('[data-test-create-extension-button]')) - .hasText('Create an extension request'); - - await click( - this.element.querySelector('[data-test-create-extension-button]') - ); - assert - .dom( - this.element - .querySelector('[data-test-extension-from-content]') - .querySelector('button[type=submit]') - ) - .exists(); - - //create extension request - await fillIn('[data-test-extension-form-reason-input]', 'Testing'); - await fillIn( - '[data-test-extension-form-newEndsOn-input]', - '2030-12-31T02:43' - ); - await fillIn('[data-test-extension-form-title-input]', 'TestingAgain'); - await click(this.element.querySelector('button[type=submit]')); - - // rendering the component again to check the new data - await render( - hbs`` - ); - await waitFor('[data-test-extension-info-content]'); - assert - .dom(this.element.querySelector('[data-test-extension-info-content]')) - .containsText('Testing') - .containsText('TestingAgain') - .containsText('PENDING') - .containsText('1'); + .doesNotContainText(); }); test('When previous extension request is approved, the button to create extension request should be there', async function (assert) { From b5b1bae9258db0365c21c6a9c68f5667a8bd9490 Mon Sep 17 00:00:00 2001 From: Lakshay Manchanda <45519620+lakshayman@users.noreply.github.com> Date: Wed, 7 Feb 2024 23:57:22 +0530 Subject: [PATCH 6/6] Revert "Removed the feature flag from identity page (#551)" (#566) This reverts commit fe497aee425321e36141a1261d2533175b7cfc69. --- app/controllers/identity.js | 7 ++ app/templates/identity.hbs | 173 ++++++++++++++++++++++++++++-------- 2 files changed, 142 insertions(+), 38 deletions(-) diff --git a/app/controllers/identity.js b/app/controllers/identity.js index 4497d190..7af80206 100644 --- a/app/controllers/identity.js +++ b/app/controllers/identity.js @@ -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) { diff --git a/app/templates/identity.hbs b/app/templates/identity.hbs index 4167f53c..2a6e1883 100644 --- a/app/templates/identity.hbs +++ b/app/templates/identity.hbs @@ -1,43 +1,140 @@ {{page-title 'Identity'}} -
- header - hero - - {{#if (eq this.state 'getStarted')}} -
Connect your Profile Service with Identity - Service
- {{/if}} -
+{{#if this.isDev}} +
+ header + hero + {{#if (eq this.state 'getStarted')}} - - {{else if (eq this.state 'step1')}} - - {{else if (eq this.state 'step2')}} - - {{else if (eq this.state 'step3')}} - - {{else if (eq this.state 'reload')}} - - {{else if (eq this.state 'verified')}} - - {{else if (eq this.state 'blocked')}} - +
Connect your Profile Service with Identity + Service
{{/if}} +
+ {{#if (eq this.state 'getStarted')}} + + {{else if (eq this.state 'step1')}} + + {{else if (eq this.state 'step2')}} + + {{else if (eq this.state 'step3')}} + + {{else if (eq this.state 'reload')}} + + {{else if (eq this.state 'verified')}} + + {{else if (eq this.state 'blocked')}} + + {{/if}} +
+ header-hero + footer
- header-hero - footer -
\ No newline at end of file +{{else}} +

+ Identity Service Verification +

+
+ {{#if (eq @model.profileStatus 'PENDING')}} +

Verification process is Pending!

+ + {{else if (eq @model.profileStatus 'VERIFIED')}} +

Verification Done!

+ {{else}} + {{#if (eq @model.profileStatus 'BLOCKED')}} +

Your previous chaincode is blocked for some reason. Please generate a + new chaincode.

+ {{/if}} +
+ +
+ +
+
+ + +
+
+ +
+
+ + + +

{{this.identityError}}

+ {{/if}} +
+{{/if}} \ No newline at end of file