Git Product home page Git Product logo

intranet's Introduction

Intranet

Description

The engine for building an intranet site of the company. At the current stage, you can display the map of the office with the search for employees on it. You can search by name, surname, workplace number and team. You can also search for meeting rooms. Information about employees is exported from Office 365 and a special file with a list of seats.

Preparation

  1. Register Office 365 app. Good article about it: https://docs.microsoft.com/en-us/outlook/rest/node-tutorial. You should set redirect URI: https://localhost:8443/sync.
  2. Create config/production.json and fill it in as default.json
    {
    	"o365": {
    		"id": 		"YOUR APP ID HERE",
    		"secret": 	"YOUR APP PASSWORD HERE"
    	},
    	"company": {
    		"name": 	"YOUR COMPANY NAME HERE",
    		"location": "YOUR OFFICE LOCATION HERE"
    	},
    	"files": {
    		"seats": "EXCEL FILE WITH USERS SEATS"
    	}
    }
  3. Create in directory 'data' file from field 'files.seats'. File should contains fields "Last Name", "First Name", "Seat". Format seat: 1.001.

  1. Add a description of the office floor scheme to the file data/mapTemplate.js

  2. Add SSL certificates: sslcert/cert.pem и sslcert/key.pem. You can generate self-signed certificates for development: http://blog.mgechev.com/2014/02/19/create-https-tls-ssl-application-with-express-nodejs/

Run

  1. Install process manager for Node.js: https://www.npmjs.com/package/pm2
  2. pm2 start pm2-config.json
  3. Open in browser https://localhost:8443/sync and login to Office 365.
  4. If everything went well, then you should see the text 'Synced'.
  5. Open localhost. You should see a map of your office. Congratulations!

intranet's People

Contributors

burashka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

intranet's Issues

Support direct link

Use case: user find some data about person in intranet and want sent it to someone.

Поддержка упраления с клавиатуры

У пользователя должна быть возможность взаимодействовать с сайтом без мыши.

Что видно сразу:

  1. Комбинации клавиш чтобы выбрать input для поиска.
  2. Возможности выбирать результат поиска.
  3. Шаг назад при назатии кнопки ESC.

Добавить аватарки

В O365 у людей есть аватарки, нужно добавить их отображение на карту

Текущая идея:
Аватарка не входит в стандартный набор данных о пользователе, ее нужно запрашивать отдельно. O365 отдает аватарки как Binary Data. Нужно получать данные и мета-описание для каждого пользователя и сохранять как файл соответствующего формата.

Promise.all([ client .api(/users/1b6ae57e-903c-415c-8927-fa8e29a86058/photo/$value) .header('X-AnchorMailbox', email) .get(), client .api(/users/1b6ae57e-903c-415c-8927-fa8e29a86058/photo) .header('X-AnchorMailbox', email) .get() ]).then( ([ data, metaData ]) => { fs.writeFileSync(dzachesov.${metaData['@odata.mediaContentType'].split('/').pop()}, data);

Прямо сейчас добавить аватарки нельзя, т.к. весь HTML генерируется сразу и при загрузке карты будут скачиватся аватарки всех пользователей. Без отображения добавить получение аватарок в sync только замедлит работу синхронизации.

Ссылки на соответствующие API O365:
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/profilephoto_get

Usability issues

  1. Alphabetically sorting function (toogler in right sidebar) should return default state after reuse.

  2. When opened any floor level on the map (an example L2) and you searching some body from L1 or L3 — search result should shown this item same as if you did this search on main screen (when not opened any level). So, when you click to item from L3 when seen L2 projection — map should start animate same as if you click to UP/DOWN arrows and next should be shown pin on the L3 which you selected in the search result.

Добавить HTTPS

O365 API не позволяет обращение с не-HTTPS страниц, если это не localhost/127.0.0.1

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.