GithubHelp home page GithubHelp logo

mozilla-iam / dino-park-front-end Goto Github PK

View Code? Open in Web Editor NEW
35.0 15.0 29.0 11.82 MB

Front-end for Mozillians.org

License: Mozilla Public License 2.0

JavaScript 16.28% HTML 0.45% Vue 77.02% Dockerfile 0.10% Shell 0.04% HCL 1.69% Fluent 4.41%

dino-park-front-end's Introduction

DinoPark front-end

A front-end for the repositioned Mozillians, to display, edit and search for people's profiles.

Setup

To install all resources for this project, please make sure to have Node installed, then run:

npm install

This will install the dependencies the project requires. Then run:

npm run serve

This will start a local server.

Note that this does not give you data. To use the front-end with data, you must point the DP_K8S variable to a URL that serves DinoPark data, for example using dino-park-dev-tools.

export DP_K8S=[url goes here]

Tests

Unit tests are in the tests folder and ran with Jest.

App-wide patterns

Apollo/GraphQL

To transfer profile data between front-end components and the back-end, we use Apollo, a client for GraphQL transactions.

The client is defined in main.js, the queries are in the queries folder and the components that trigger Apollo to get (‘query’) and change (‘mutate’) data can be anywhere in the application.

We use the <ApolloQuery> and <ApolloMutation> components for querying and mutating. They contain a <template> with slot-scope that has the data and error information in it. Within that template, data can be used as usual.

Modal overlay

We use the <Modal> component to describe the contents and behaviour of modal overlays.

To add a modal overlay, we need to parts: something that triggers it, and the overlay itself.

A trigger can be a button that onclick changes the isOpen value of an overlay to true (or a script that does that on whatever event required). The easiest is to link an overlay to its triggering button is to use refs, for example:

<button @click="$refs.myOverlay.isOpen = true">Change info</button>
<Modal ref="myOverlay">
<!-- content goes here -->
</Modal>

Notes:

  • While a modal is open, scroll is prevented and focus is trapped inside the modal.
  • We don't do anything special to make the modal be layered on top of everything else. Increase the z-index if there are elements with a higher z-index.

ShowMore

There is a <ShowMore> component used anywhere you would show more content using a button.

Features:

  • opened/closed state is conveyed to Assistive Technologies (AT) through ARIA
  • focus can be moved to the newly opened content (optional)
  • can use icons for expanded and collapsed state
  • can use (visible or visually hidden) text for expanded and collapsed state

Popover

<Popover> is a component that is shared between tooltips, Contact Me and custom selects. In most cases, it is used as the toggled content of a ShowMore component.

Technical considerations

General front-end practices

  • We ensure our code complies to the Web Content Accessibility Guidelines (WCAG), so that Mozillians is usable by all and we comply with relevant legislation.
    • Example: our autocomplete works well with keyboard, screenreaders and dictation
  • We prefer web platform features to library-specific workarounds
    • Example: we make sure form elements are in a form tag and submitting works (by pressing ENTER in an element, by firing form.submit(), by pressing GO on iOS, etc)
  • We embrace progressive enhancement to make our code more resilient with things like feature detection
    • Examples: if we require geolocation to display something, we build the no-geo view first, make sure that is GOOD then add geo as an enhancement so that it is GREAT. An escalator is still stairs when the power is off.

CSS

  • We embrace the cascade where it makes sense.
  • We write as little CSS as possible.
  • We don't scope CSS with JS, we use ‘naming for scoping’, i.e. by sticking to unique names, we have workable enough ‘scopes’.
  • CSS is included with the highest level component that needs it. For example, styles that work for the whole app, go into the App.vue file. Styles that only apply to a Profile view go to Profile.vue, styles that only apply to tag commponents go to Tag.vue.
  • As a naming convention we follow BEM (block, element, modifier). Quick summary:
    • .block is a component
    • .block--modifier is a variation on the block component
    • .block__element is something inside the block component
  • We make sure components look good (not necessarily the same) in the devices, browsers, platforms our users use.

Deploying

This application will automatically deploy to test/dev from the master branch. To deploy to prod cut a release tag following the pattern in releases with the suffix -prod.

dino-park-front-end's People

Contributors

akatsoulas avatar andrew-sunada avatar april avatar bkochendorfer avatar caugner avatar danielhartnell avatar dennisschagt avatar dividehex avatar duallain avatar fiji-flo avatar floatingatoll avatar frosemond avatar gene1wood avatar gregoor avatar herminac avatar hidde avatar hmitsch avatar izo3 avatar jens1o avatar leomca avatar michaelkohler avatar ryanwarsaw avatar the-smooth-operator avatar zeusintuivo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dino-park-front-end's Issues

Add staff/contributor indicator

in:

  • Profile
  • Profile preview

Across the site of dinopark there are profile pictures which are shown in 3 different sizes. 40x40, 100x100, and 230x230 At a glance to indicate to the user that this person is a staff member or contributor there will be a visual marker symbolizing these two employee status. See below for zeplin designs and in most recent clickthroughs you will start to see these indicators in action.

zeplin design:
https://zpl.io/aBqNB1K

┆Attachments: Screen Shot 2018-10-28 at 9.52.39 PM.png

[Org chart] Page sometimes jumps around when selecting name

ipad pro ios 11 safari - when i press on a person in the orgchart list the scroll window jumps up. see screenshot. i could only get this to replicate on the above device/software.

see i press on name above chase blackburn and it scrolls up.

img_0883
img_0882

Add ContactMe component

Add component that is a Contact Me button that, when expanded, shows a list of contact options: by phone, by email.

To be used in top of profile.

Smarter .dockerignore

The current .dockerignore duplicates basically the .gitignore. Should we be smarter here?

Dockerize

Have a Dockerfile to create an artifact serving the new front-end.

Most likely we should just serve a prod build from nginx.

Cursor reaction is not consistent across all clickable elements

Currently when you mouse over + or - or (contact me) buttons the cursor does not change visual state. Yet when you mouse over a name or title or View Full Profile button the cursor does change into a finger. Can this be consistent for all desktop interaction that are clickable? See attached zip file with video in it.

Archive.zip

[Org chart] Allow list to be collapsed to a specific person

We want it to be possible to link to a specific person in the org chart. In that route, we want the org chart to be collapsed all the way to that person, so that you can see the person's manager/managees.

Specifics:

  • org chart collapses to specific person
  • scroll position is set so that blue background of highlighted person starts where top of profile preview card starts

┆Attachments: image-20181122-114137.png

Configurable app path.

In order to support serving the fron-end from dinopark.mozilla.community/beta we need to support a configurable app path.

Initial feedback for setup

I've tested your fork, looks quite good. Here are a few suggestions and questions.

Ingress

❯ minikube addons enable ingress                                                                                                                                       
minikube is not currently running so the service cannot be accessed

I did a minikube start and then that command above worked. Not sure if that’s how it’s supposed to be..

VirtualBox

On Mac OS the default is VirtualBox and minikube start fails if it is not installed. So I’d suggest to add this as requirement in the README as well. Alternatively

brew install docker-machine-driver-hyperkit
minikube start —vm-driver hyper kit

works as well. You could say that the minikube README mentions this, but it’s way below the brew install command and I’m not sure how many people like me would close the tab after that.

Myke

As far as I can see the download page only contains the binary and no “installer”. So instead of “install” in the README I’d say something along the lines of adding the binary to your PATH. Probably also worth a mention that the binary/symlink/whatever should be renamed if the commands further down should stay copy/paste-able.

Updating Repos

Might be nice to have a section in the README about how to update all repos (maybe with myke?). I think a full script to update everything and deploy it to k8s again would be nice.

General question

As a k8s noob, if I change something in dino-park-front-end it doesn’t automatically deploy it, right? What is the best practise around k8s in terms of development? For some reason if I apply again it still isn’t changed. Again, don’t really know a lot about k8s. 😀

The rest worked well, up and running 😀

Add Home page

Depends on

  • New staff
  • New contributors
  • Spaces
  • Search

k8s'ize

Add k8s config files for a developer preview. This depends on #15.

Create placeholder avatar

If user does not have a profile pic or an image does not load because of an error. Design can supply generic images put in place so website does not feel broken.

screen shot 2018-10-12 at 9 22 25 pm

[Org chart] Add avatars

The orgchart list is missing the small profile pics that are displayed left of names.

See attached image.

screen shot 2018-10-12 at 9 03 39 pm

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.