Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend Challenge Unbabel #33

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
env: {
node: true,
},
extends: ["eslint:recommended", "plugin:vue/vue3-recommended"],
rules: {
// override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error'
},
};
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
108 changes: 29 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,29 @@
# Frontend Challenge

Our goal is to understand:
- How knowledgeable you are
- How well you structure your app
- How well can you visually reproduce a mockup

Some restrictions:
- Use the Vue javascript framework and its Component system
- Don't use a UI framework like Bootstrap

Your challenge will consist of the following:

You'll have to build a small web app that is able to **fetch data** from an endpoint we provide, **list the data** from the endpoint, allow **editing the data**, **adding and removing** rows, and then **pushing the data** to another endpoint.

Please fork this repo and commit your changes to the fork.

Here is a preview of what we are expecting:

![Sample](_README_assets/sample.png)

Keep in mind that we may ask you about some of the decisions you made while building the app.

## Important information to complete the challenge

### Data source

Fetch the data from this endpoint [http://www.mocky.io/v2/5ae1c5792d00004d009d7e5c](http://www.mocky.io/v2/5ae1c5792d00004d009d7e5c)

Using Mocky should produce no cross origin errors and should work fine for this challenge. If you do find issues, it's OK to copy the JSON into your preferred method to then provide the data to the app.

### Assets, measurements, and other details

Inside this repository you'll find a folder named `assets-for-challenge`. Inside this folder you can find all the icons we expect you to use, in multiple formats, use what you think is best.

## Detailed comments on each element

![Elements Numbered](_README_assets/challenge-elements-numbered.png)

**Functionality**

The app should let the user do the following:

- **1** - _Get data_ button. When the user **clicks on this button**, your app will **get the data from the URL** in [Data source](#Data source) and fill the list
- **2** - _Upload data_ button. When the user **clicks on this button**, your app will **make a POST request to the same url** as the _Get data_ button. You should send the latest information on the list using the same structure as you have received it.
- **3** - _Custom checkbox_. When the user **clicks on the checkbox**, it will become checked. It will not have any other functionality.
- **4** - _Add line_ button. When the user **clicks on this button**, a **new row will be added to the list** and the user should be able to **write text in both fields**.
- **5** - _Delete row_ button. This button should be **visible only when hovering** each row item. When the user **clicks on this button**, your app will **remove that row** from the list.
- **6** - List _item title_ **This title should be editable**.
- **7** - List _item content_. **This content should be editable**.
- **8** - _App title_. No functionality.
- **9** - _Person icon_ linked to each row. No functionality.

Notes:

- Don't worry about the blank state before loading the content.

**Style Attributes**

These are some and useful details about some of the elements

- **3** - The checkbox is 16px wide and 16px high. The purple color is `#859EFF`
- **6** - The font-family of the _item title_ is `Montserrat`, the weight is `SemiBold`, the size is `16px`, and the color is `#566074`
- **7** - The font-family of the _item content_ is `Open Sans`, the weight is `Regular`, the size is `16px`, and the color is `#778195`
- **8** - The font-family of the _app title_ is `Montserrat`, the weight is `Medium`, the size is `18px`, and the color is `#414C5E`

The data above is enough to complete challenge. We also include the source Sketch file in the repository, in case you want to check the original file. You can find it in `_README_assets/Challenge.sketch`

## Typography

- You can find [Montserrat on Google Fonts](https://fonts.google.com/specimen/Montserrat)
- You can find [Open Sans on Google Fonts](https://fonts.google.com/specimen/Open+Sans)

## Bonus points:

- Keeping in mind accessibility
- Adding tests to your components and app
- Using a store (Vuex) to manage the application data
- Using vue-router to prepare the app for a future where it would have multiple routes
# Frontend Challenge Unbabel

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Run your unit tests
```
yarn test:unit
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
Binary file removed _README_assets/Challenge.sketch
Binary file not shown.
Binary file removed _README_assets/challenge-elements-numbered.png
Binary file not shown.
Binary file removed _README_assets/sample.png
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
Binary file removed assets-for-challenge/[email protected]
Binary file not shown.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};
12 changes: 12 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": ["src/*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
}
}
73 changes: 73 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "frontend-challenge-unbabel",
"version": "1.0.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.3.4",
"core-js": "^3.8.3",
"vue": "^3.2.13",
"vue-router": "4",
"vuex": "^4.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-unit-jest": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"@vue/compiler-sfc": "^3.2.47",
"@vue/test-utils": "^2.0.0-0",
"@vue/vue3-jest": "^29.2.3",
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^8.0.3",
"jest": "^27.0.5",
"prettier": "^2.8.4",
"sass": "^1.58.3",
"sass-loader": "^13.2.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"prettier"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {},
"overrides": [
{
"files": [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)"
],
"env": {
"jest": true
}
}
]
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
],
"jest": {
"preset": "@vue/cli-plugin-unit-jest"
}
}
Binary file added public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
24 changes: 24 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<router-view />
</template>

<script>
export default {
name: "App",
};
</script>

<style lang="scss">
#app {
width: 100vw;
height: 100vh;
}

body {
margin: 0;
max-width: 100vw;
max-height:100vh;
background-color: $concrete;
overflow-x: hidden;
}
</style>
Binary file added src/assets/fonts/Montserrat-Medium.ttf
Binary file not shown.
Binary file added src/assets/fonts/Montserrat-SemiBold.ttf
Binary file not shown.
Binary file added src/assets/fonts/OpenSans-Regular.ttf
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
24 changes: 24 additions & 0 deletions src/components/common/AppButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<button class="app-button">
<slot />
</button>
</template>
<script>
export default {
name: 'AppButton'
}
</script>
<style lang="scss" scoped>
.app-button {
border-radius: 8px;
cursor: pointer;
background-color: $purple;
font-family: OpenSansRegular;
font-size: $default-size;

&:hover {
background-color: $white;
color: $purple;
}
}
</style>
40 changes: 40 additions & 0 deletions src/components/common/AppCheckbox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<div class="app-checkbox">
<input
v-model="checked"
class="app-checkbox__transcription"
type="checkbox"
>
</div>
</template>
<script>
export default {
name: "AppCheckbox",

data () {
return {
checked: false
}
}

};
</script>

<style lang="scss" scoped>

.app-checkbox {
padding-left: $default-size;
padding-right: $default-size;
}

input[type="checkbox"] {
width: $default-size;
height: $default-size;
}

.app-checkbox__transcription:before {
accent-color: $purple;
}

</style>

39 changes: 39 additions & 0 deletions src/components/common/AppIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template>
<div
class="app-icon"
@click="executeMethod"
>
<img :src="getImgSrc(icon)">
</div>
</template>
<script>
export default {
name: "AppIcon",

props: {
icon: {
type: String,
required: true,
},
},

emits: ["execute-method"],
methods: {
getImgSrc(icon) {
if (icon) {
var images = require.context("@/assets/images/svg/", false, /\.svg$/);
return images("./" + icon + ".svg");
}
},
executeMethod() {
this.$emit("execute-method");
},
},
};
</script>
<style lang="scss" scoped>
.app-icon {
padding-right: $default-size;
cursor: pointer;
}
</style>
Loading