diff --git a/app/components/profile-field.hbs b/app/components/profile-field.hbs
index e1c00879..ca4060e5 100644
--- a/app/components/profile-field.hbs
+++ b/app/components/profile-field.hbs
@@ -10,6 +10,7 @@
placeholder={{@placeholder}}
class="profile-field-input"
required={{@required}}
+ disabled={{@isDeveloper}}
{{on 'input' (fn this.inputFieldChanged)}}
{{on 'blur' (fn this.checkInputValidation)}}
/>
diff --git a/app/components/progress-bar.hbs b/app/components/progress-bar.hbs
index e9220e79..a60ef1db 100644
--- a/app/components/progress-bar.hbs
+++ b/app/components/progress-bar.hbs
@@ -12,40 +12,15 @@
step='10'
{{on 'change' this.onChange}}
{{on 'input' this.onInput}}
- disabled={{not this.isEditable}}
/>
- {{#if this.isEditable}}
- {{@value}}
- {{else}}
-
-
-
-
- {{/if}}
+ {{@value}}
+
\ No newline at end of file
diff --git a/app/components/progress-bar.js b/app/components/progress-bar.js
index 6aea892e..356ec898 100644
--- a/app/components/progress-bar.js
+++ b/app/components/progress-bar.js
@@ -4,29 +4,9 @@ import { action } from '@ember/object';
import { debounce } from '@ember/runloop';
export default class ProgressBarComponent extends Component {
- @tracked isEditable = false;
@tracked value = this.args.value;
- lastEditTime = null;
-
- @action turnEditModeOn() {
- this.isEditable = true;
- this.lastEditTime = Date.now();
- this.setEditableToFalse();
- }
-
- setEditableToFalse() {
- setTimeout(() => {
- const timeDelta = Date.now() - this.lastEditTime;
- if (this.isEditable && timeDelta >= 5000) {
- this.isEditable = false;
- } else if (this.isEditable) {
- this.setEditableToFalse();
- }
- }, 5000);
- }
@action onInput(e) {
- this.lastEditTime = Date.now();
this.value = e.target.value;
if (this.args.onInput) {
this.args.onInput(this.value);
@@ -34,7 +14,6 @@ export default class ProgressBarComponent extends Component {
}
@action onChange(e) {
- this.lastEditTime = Date.now();
if (this.args.onChange) {
debounce(this, this.debouncedChange, e, 600);
}
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 @@
-
\ 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/components/task/modal.hbs b/app/components/task/modal.hbs
index 63814ce2..b7a2ce67 100644
--- a/app/components/task/modal.hbs
+++ b/app/components/task/modal.hbs
@@ -1,24 +1,39 @@
{{#if @showModal}}
-
-
-
-
-
-
{{@message}}
- {{#if @isUpdating}}
-
- {{/if}}
- {{#if @buttonRequired}}
-
- {{if (eq @dev true) "Don't assign task" "Proceed" }}
-
- {{#if @dev}}
-
- Assign task
-
- {{/if}}
- {{/if}}
+
+
+
+
+
+
{{@message}}
+ {{#if @isUpdating}}
+
+ {{/if}}
+ {{#if @buttonRequired}}
+
+ Proceed
+
+ {{#if @dev}}
+
+ Assign task
+
+ {{/if}}
+ {{/if}}
+
-
{{/if}}
\ No newline at end of file
diff --git a/app/components/tasks.hbs b/app/components/tasks.hbs
index f7329a3b..43bd28e1 100644
--- a/app/components/tasks.hbs
+++ b/app/components/tasks.hbs
@@ -1,7 +1,7 @@
{{#if @dev}}
{{#if @noInProgressTask}}
-
+
You have no task in progress! click below to fetch tasks
-