diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/post-checkout b/.husky/post-checkout new file mode 100755 index 00000000..147db8d3 --- /dev/null +++ b/.husky/post-checkout @@ -0,0 +1,10 @@ +#!/bin/sh +if [[ "$NODE_ENV" != "production" ]]; then + . "$(dirname "$0")/_/husky.sh" + + echo "\n 🚧 Dependencies are being installed, please wait for a while. ⏳\n" + + npm install + + echo "\nCongratulations, you are good to go! ⚡⚡⚡\n" +fi diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..5cc47cd0 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +echo "Checking for linting problems, please wait⏳\n" + +npm run lint diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..3e86e09d --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +echo "Pushing your changes to remote repository 🚀✨" diff --git a/README.md b/README.md index da1cc24a..440600cf 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Make use of the many generators for code, try `ember help generate` for more det * `npm run lint`: To allow the linter to check for problems * `npm run lint:fix`: To allow linter to fix the auto-fixable problems -### Note: If you get CORS error for API calls during development, please consider reading [this](https://github.com/Real-Dev-Squad/website-code-docs/tree/main/docs/dev/https-dev-url-cors) documentation. +### Note: For solving CORS errors while making API calls during development, please make sure to follow step 1 from [this](https://github.com/Real-Dev-Squad/website-code-docs/tree/main/docs/dev/https-dev-url-cors) documentation . This project has taken care of step 2 in itself. ### Building diff --git a/app/components/form-input.hbs b/app/components/form-input.hbs index f20b3ddc..24caf38d 100644 --- a/app/components/form-input.hbs +++ b/app/components/form-input.hbs @@ -5,6 +5,7 @@ @type={{@type}} @value={{@value}} @placeholder={{@placeholder}} + @disabled={{@disabled}} @class={{if @showError 'input errorBorder' 'input'}} {{on 'input' (fn this.inputFieldChanged)}} /> diff --git a/app/components/local-navbar.hbs b/app/components/local-navbar.hbs new file mode 100644 index 00000000..cd1294d9 --- /dev/null +++ b/app/components/local-navbar.hbs @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/app/components/sign-up/button.hbs b/app/components/sign-up/button.hbs new file mode 100644 index 00000000..02dc7c16 --- /dev/null +++ b/app/components/sign-up/button.hbs @@ -0,0 +1,12 @@ + diff --git a/app/components/sign-up/button.js b/app/components/sign-up/button.js new file mode 100644 index 00000000..9fbf5327 --- /dev/null +++ b/app/components/sign-up/button.js @@ -0,0 +1,26 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; + +export default class ButtonComponent extends Component { + @action + buttonClickHandler() { + const { state, clickHandler, disabled } = this.args; + + switch (state) { + case 'get-started': + !disabled ? clickHandler('firstName') : ''; + break; + case 'firstName': + !disabled ? clickHandler('lastName') : ''; + break; + case 'lastName': + !disabled ? clickHandler('username') : ''; + break; + case 'username': + !disabled ? clickHandler() : ''; + break; + default: + return; + } + } +} diff --git a/app/components/sign-up/form.hbs b/app/components/sign-up/form.hbs new file mode 100644 index 00000000..92b9dff0 --- /dev/null +++ b/app/components/sign-up/form.hbs @@ -0,0 +1,20 @@ +
+

+ {{this.label}} +

+
+ +
+ +
+ + Next + +
+
diff --git a/app/components/sign-up/form.js b/app/components/sign-up/form.js new file mode 100644 index 00000000..b1ba6c48 --- /dev/null +++ b/app/components/sign-up/form.js @@ -0,0 +1,16 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { LABEL_TEXT } from '../../constants/signup'; + +export default class SignupComponent extends Component { + get label() { + const { state } = this.args; + + return LABEL_TEXT[state]; + } + + @action inputFieldChanged({ target: { value } }) { + const { onChange, state } = this.args; + onChange(state, value); + } +} diff --git a/app/components/sign-up/get-started.hbs b/app/components/sign-up/get-started.hbs new file mode 100644 index 00000000..e736fada --- /dev/null +++ b/app/components/sign-up/get-started.hbs @@ -0,0 +1,25 @@ + +
+

+ {{this.mainHeading}} +

+

+ {{this.subHeading}} +

+ {{#if (eq @state "get-started")}} + + {{/if}} + +
+ + {{if (eq @state "get-started") "Get Started" "Let's Go"}} + +
+
diff --git a/app/components/sign-up/get-started.js b/app/components/sign-up/get-started.js new file mode 100644 index 00000000..90cf28ff --- /dev/null +++ b/app/components/sign-up/get-started.js @@ -0,0 +1,25 @@ +import Component from '@glimmer/component'; +import { + GET_STARTED_MAIN_HEADING, + GET_STARTED_SUB_HEADING, + THANK_YOU_MAIN_HEADING, + THANK_YOU_SUB_HEADING, +} from '../../constants/signup'; + +export default class GetStartedComponent extends Component { + get mainHeading() { + const { state } = this.args; + + return state === 'get-started' + ? GET_STARTED_MAIN_HEADING + : THANK_YOU_MAIN_HEADING; + } + + get subHeading() { + const { state } = this.args; + + return state === 'get-started' + ? GET_STARTED_SUB_HEADING + : THANK_YOU_SUB_HEADING; + } +} diff --git a/app/components/task-details.hbs b/app/components/task-details.hbs index cf886684..d336e992 100644 --- a/app/components/task-details.hbs +++ b/app/components/task-details.hbs @@ -3,10 +3,10 @@

Purpose: {{@task.purpose}}

-

Ends On: {{@task.endsOn}}

+

Deadline: {{convertDate @task.endsOn end_date=1}}

-

Started On: {{@task.startedOn}}

+

Started: {{convertDate @task.startedOn end_date=0}}

\ No newline at end of file diff --git a/app/components/upload-image.hbs b/app/components/upload-image.hbs index e0ba9e0c..3cd094d3 100644 --- a/app/components/upload-image.hbs +++ b/app/components/upload-image.hbs @@ -9,12 +9,9 @@

{{#if this.isImageSelected}} - You have selected{{this.imageFileName}} + You have selected {{this.imageFileName}} {{else}} - Drag and drop file here - - or - + Drag and drop file here or {{/if}}