Giter Club home page Giter Club logo

tree-traversal's Introduction

Exercise: Build an Explorer

This exercise is to build a folder and file explorer (or a tree control).

Your implementation will be evaluated technically, but also by a designer, so CSS fidelity is important.

You can use any tools or libraries you'd like. Except an off-the-shelf tree control :)

Requirements

Application

    • You will create a new file index.html that renders an interactive file explorer shown in mockup.png
    • You will use the data from data.json to render the actual folders & files.
    • You may make the data in data.json a global variable in your scripts (ie, so that you won't need to make an AJAX request to retrieve it)
    • Provided code should be runnable by simply opening up index.html. No server should be needed.
    • Lay good groundwork and infrastructure for adding more advanced features. See below for more details.

Appearance

    • What you build should look like a modal but doesn't need to function like one. i.e. opening/closing and dragging it around are not necessary
    • Visually has the same colors, alignment, sizing, and shading as mockup.png
    • Make private folders have the red icon appearance.

Minimum Features

    • Folders should be able to expand or collapse by clicking anywhere on the row (not just the icon or label itself)
    • Folders and files should have a basic selection and hover appearance (such as highlighting the row blue).
    • Folders and files are selected/deselected by clicking anywhere on the row.
    • Text should truncate with ellipsis if too wide

Advanced Features (Not Required!)

Below are advanced features you do NOT need to implement, but need to plan for. In later interviews, you will be asked exactly how you would implement all of these into your app. If you do have the time, try to implement some of these for bonus points!

    • Change the "Done" button to "Upload". When the user clicks on it, they should be able to upload a new JSON file with the same structure as data.json. When it is uploaded, the file explorer should re-render with the same data (including potentially having some folders already open). Assume all uploaded JSON files are valid and have the structure you expect (meaning you don't need account for dealing with invalid structures).
    • Add another button "Save". This should save the exact state & configuration of your app. In a real app this might be done by saving the state to the server, a cookie, or local storage. In this app, you can simply export some file that would be uploaded via the above feature.
    • Change the "Link" button to "Add". When the user clicks on it, it should pop up with a modal where the user can add either a new folder or file into the tree. If a folder was selected before clicking "Add", it's inserted into the end of that folder. If a file was selected, it is inserted after the file. If nothing was selected, it is inserted at the highest level (i.e. same level as "Main Folder")
    • Add the ability to move a file or folder by dragging it to another location. You'll want to use a dragging library for this.

Evaluation Criteria (all equally important)

  1. Minimum features met
  2. DRY, reusable, well-thought-out code that lays good infrastructure for implementing all of the Advanced Features
  3. Pixel-perfectness of CSS matching mockup.png in Chrome

tree-traversal's People

Contributors

eanzalone avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.