diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6beb5d7c..d884b73c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -5,15 +5,16 @@ name: Continuous Integration on: push: - branches: + branches: - '**' - + pull_request: - branches: + branches: - '**' jobs: build: + runs-on: ubuntu-latest strategy: @@ -21,11 +22,11 @@ jobs: node-version: [14.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn install --frozen-lockfile - - run: yarn build - - run: yarn test + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: npm test diff --git a/.gitignore b/.gitignore index 2c9b1b9d..7e0f7ddc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,3 @@ /.node_modules.ember-try/ /bower.json.ember-try /package.json.ember-try - - - -/package-lock.json \ No newline at end of file diff --git a/.husky/post-checkout b/.husky/post-checkout index 0c7253e9..147db8d3 100755 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -4,7 +4,7 @@ if [[ "$NODE_ENV" != "production" ]]; then echo "\n 🚧 Dependencies are being installed, please wait for a while. ⏳\n" - yarn + npm install echo "\nCongratulations, you are good to go! ⚡⚡⚡\n" fi diff --git a/.husky/pre-commit b/.husky/pre-commit index 2c23e25d..5cc47cd0 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,4 +3,4 @@ echo "Checking for linting problems, please wait⏳\n" -yarn lint +npm run lint diff --git a/.travis.yml b/.travis.yml index eee2721a..5b5ce9da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,4 @@ branches: - master script: - - yarn test + - npm test diff --git a/README.md b/README.md index eda5e654..440600cf 100644 --- a/README.md +++ b/README.md @@ -6,26 +6,23 @@ A personal dashboard website where you can do profile related stuff! You will need the following things properly installed on your computer. -- [Git](https://git-scm.com/) -- [Node.js](https://nodejs.org/) (with npm) -- [Ember CLI](https://ember-cli.com/) -- [Google Chrome](https://google.com/chrome/) +* [Git](https://git-scm.com/) +* [Node.js](https://nodejs.org/) (with npm) +* [Ember CLI](https://ember-cli.com/) +* [Google Chrome](https://google.com/chrome/) ## Installation -We are moving to yarn, to ensure that we use yarn , we are moving ahead with [Volta](https://docs.volta.sh/guide/#why-volta) -To install Volta, please follow the [process](https://docs.volta.sh/guide/getting-started) - -- `git clone ` this repository -- `cd website-my` -- `yarn` +* `git clone ` this repository +* `cd website-my` +* `npm install` ## Running / Development -- `yarn dev` -- (or `ember s`) -- Visit your app at [http://localhost](http://localhost). -- Visit your tests at [http://localhost/tests](http://localhost/tests). +* `npm run dev` +* (or `ember s`) +* Visit your app at [http://localhost](http://localhost). +* Visit your tests at [http://localhost/tests](http://localhost/tests). ### Code Generators @@ -33,34 +30,35 @@ Make use of the many generators for code, try `ember help generate` for more det ### Running Tests -- `yarn test` -- `yarn test:ember` -- `yarn test:ember:server` -- (or `ember test` and `ember test --server`) -- You can also visit the `/tests` route when running dev server +* `npm run test` +* `npm run test:ember` +* `npm run test:ember:server` +* (or `ember test` and `ember test --server`) +* You can also visit the `/tests` route when running dev server ### Available run commands -- `npx ntl` -- (or `yarn run` to see the list) +* `npx ntl` +* (or `npm run` to see the list) ### Linting -- `yarn lint`: To allow the linter to check for problems -- `yarn lint:fix`: To allow linter to fix the auto-fixable problems +* `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: 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 -- `yarn build` (production) -- (or `ember build --environment production`) -- `ember build` (development) +* `npm run build` (production) +* (or `ember build --environment production`) +* `ember build` (development) + ## Further Reading / Useful Links -- [ember.js](https://emberjs.com/) -- [ember-cli](https://ember-cli.com/) -- Development Browser Extensions - - [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) - - [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) +* [ember.js](https://emberjs.com/) +* [ember-cli](https://ember-cli.com/) +* Development Browser Extensions + * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) + * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) diff --git a/app/components/form-input.hbs b/app/components/form-input.hbs index 24caf38d..95b7db54 100644 --- a/app/components/form-input.hbs +++ b/app/components/form-input.hbs @@ -1,6 +1,7 @@
field.type === 'email'); if (pattern.test(email)) { diff --git a/app/controllers/signup.js b/app/controllers/signup.js index a2502117..a21ff4b0 100644 --- a/app/controllers/signup.js +++ b/app/controllers/signup.js @@ -1,17 +1,12 @@ import Controller from '@ember/controller'; import { action, set } from '@ember/object'; -import { inject as service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; import registerUser from '../utils/register-api'; -import { GOTO_URL } from '../constants/signup'; -import { NEW_SIGNUP_FLOW, OLD_SIGNUP_FLOW } from '../constants/analytics'; import ENV from 'website-my/config/environment'; // remove this when new flow goes live const BASE_URL = ENV.BASE_API_URL; // remove this when new flow goes live export default class SignupController extends Controller { - @service analytics; - queryParams = ['state', 'dev']; @tracked isSubmitClicked = false; @@ -259,8 +254,7 @@ export default class SignupController extends Controller { @action emailValidator(email) { if (typeof email !== 'string') return false; - const pattern = - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + const pattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; const index = this.fields.findIndex((field) => field.type === 'email'); if (pattern.test(email)) { @@ -288,7 +282,6 @@ export default class SignupController extends Controller { // submit // https://github.com/Real-Dev-Squad/website-api-contracts/tree/main/users#patch-usersself e.preventDefault(); - this.analytics.trackEvent(OLD_SIGNUP_FLOW.SUBMIT_CLICKED); const cleanReqObject = this.sanitizeRequestObject(this.formData); this.isSubmitClicked = true; @@ -304,15 +297,11 @@ export default class SignupController extends Controller { const { status } = response; if (status === 204) { - this.analytics.identifyUser(); - this.analytics.trackEvent(OLD_SIGNUP_FLOW.USER_REGISTERED); - window.open(GOTO_URL, '_self'); + window.open('https://realdevsquad.com/goto', '_self'); } else { - this.analytics.trackEvent(OLD_SIGNUP_FLOW.UNABLE_TO_SIGNUP); alert('Something went wrong. Please check console errors.'); } } catch (error) { - this.analytics.trackEvent(OLD_SIGNUP_FLOW.UNABLE_TO_REGISTER); console.error('Error : ', error); } finally { this.isSubmitClicked = false; @@ -346,21 +335,14 @@ export default class SignupController extends Controller { registerUser(user) .then((res) => { if (res.status === 204) { - this.analytics.identifyUser(); - this.analytics.trackEvent(NEW_SIGNUP_FLOW.USER_REGISTERED); - window.open(GOTO_URL, '_self'); + window.open('https://realdevsquad.com/goto', '_self'); } else { - this.analytics.trackEvent(NEW_SIGNUP_FLOW.UNABLE_TO_SIGNUP); res.json().then((res) => { - const error = res.errors[0]; - this.errorMessage = error.title; + this.errorMessage = res.errors[0].title; }); } }) - .catch((err) => { - this.errorMessage = err; - this.analytics.trackEvent(NEW_SIGNUP_FLOW.UNABLE_TO_REGISTER); - }) + .catch((err) => (this.errorMessage = err)) .finally(() => { this.isSubmitClicked = false; }); diff --git a/app/routes/signup.js b/app/routes/signup.js index b0445935..df0d9441 100644 --- a/app/routes/signup.js +++ b/app/routes/signup.js @@ -1,13 +1,8 @@ import Route from '@ember/routing/route'; -import { inject as service } from '@ember/service'; import ENV from 'website-my/config/environment'; -import { SIGNUP } from '../constants/analytics'; export default class SignupRoute extends Route { - @service analytics; - async model() { - this.analytics.trackEvent(SIGNUP.PAGE_LOADED); const response = await fetch(`${ENV.BASE_API_URL}/users/self`, { credentials: 'include', }); @@ -20,9 +15,8 @@ export default class SignupRoute extends Route { ); } if (response.status === 200 && !userData.incompleteUserDetails) { - this.analytics.trackEvent(SIGNUP.USER_ALREADY_REGISTERED); alert("You already have filled the up form. You'll now be redirected."); - window.open('https://realdevsquad.com/goto', '_self'); + window.open('https://realdevsquad.com/goto', '_self'); // if user is there => realdevsquad,com => no ---> up } } } diff --git a/app/services/analytics.js b/app/services/analytics.js deleted file mode 100644 index c7c5600c..00000000 --- a/app/services/analytics.js +++ /dev/null @@ -1,18 +0,0 @@ -import Service from '@ember/service'; -import ENV from 'website-my/config/environment'; -import mixpanel from 'mixpanel-browser'; - -export default class AnalyticsService extends Service { - constructor() { - super(...arguments); - mixpanel.init(ENV.MIXPANEL_TOKEN); - } - - trackEvent(event) { - return mixpanel.track(event); - } - - identifyUser() { - return mixpanel.identify(); - } -} diff --git a/app/styles/identity.css b/app/styles/identity.css index 3c32c0db..f226220c 100644 --- a/app/styles/identity.css +++ b/app/styles/identity.css @@ -14,13 +14,13 @@ } .input-div { - width: 30%; + width: 40%; } -.input-url { +input[type=text] { height: 2rem; margin-top: 25px; - width: 60%; + width: 65%; } .chaincode-div { @@ -71,35 +71,26 @@ @media (max-width: 1240px){ .input-div { width: 50%; - margin-left: 10%; - } - .input-url { - width: 55%; - } - .chaincode-div { - margin-left: 20%; } } @media (max-width: 790px){ .input-div { width: 70%; - margin-left: 5%; } - .input-url { - width: 60%; + input[type=text] { + width: 50%; } .chaincode-div{ margin-left: 10%; - width: 60%; } } @media (max-width: 460px){ .input-div { - width: 80%; + width: 70%; } - .input-url { + input[type=text] { width: 50%; } } \ No newline at end of file diff --git a/app/templates/identity.hbs b/app/templates/identity.hbs index b4e1462d..2ec32e68 100644 --- a/app/templates/identity.hbs +++ b/app/templates/identity.hbs @@ -15,7 +15,7 @@ {{/if}}
- +