Giter Site home page Giter Site logo

esn-frontend-contacts's Introduction

esn-frontend-contacts

Contacts application for OpenPaaS

Development

Configuration

First, you want to ensure that the application grid component is provided with the necessary information about the apps via the environment variable APP_GRID_ITEMS:

cp .env.example .env
  • APP_GRID_ITEMS: A stringified JSON representation of the apps to show in the application grid. It has the following shape:
    [
      { "name": "Inbox", "url": "http://localhost:9900/#/unifiedinbox/inbox" },
      { "name": "Calendar", "url": "http://localhost:9900/#/calendar" },
      ...
    ]

Then, launch the dev server on http://localhost:9900:

OPENPAAS_URL=https://dev.open-paas.org npm run serve
  • OPENPAAS_URL: The OpenPaaS URL to be used by the current SPA application. Defaults to http://localhost:8080.

The development server can also be used to serve minified SPA to check that everything is OK:

OPENPAAS_URL=https://dev.open-paas.org npm run serve:prod

Authentication

Authentication is provided by a dedicated SPA esn-frontend-login-app which is defined in the project devDependencies. In order to make it work with the webpack-dev-server launched by the npm run serve command, you will have to generate it like this:

cd ./node_modules/esn-frontend-login && npm install && npm run build

Serve

Go to http://localhost:9900/contacts/ to open the SPA

Build

Generates minified SPA in the ./dist folder:

npm run build:prod

Regarding APP_GRID_ITEMS, you can also provide it as a system variable for production purposes, e.g.:

APP_GRID_ITEMS="[{ \"name\": \"Calendar\", \"url\": \"https://dev.open-paas.org/calendar/\" }, { \"name\": \"Contacts\", \"url\": \"https://dev.open-paas.org/contacts/\" }, { \"name\": \"Inbox\", \"url\": \"http://dev.open-paas.org/inbox/\" }, { \"name\": \"Admin\", \"url\": \"https://dev.open-paas.org/admin/\" }, { \"name\": \"LinShare\", \"url\": \"https://user.linshare-4-0.integration-linshare.org/\" }]" npm run build:prod

Running tests

You can run tests by executing the following command:

npm run test

Note that there is a 10000ms timeout by default. If you want to change that, simply pass the TEST_TIMEOUT environment variable:

TEST_TIMEOUT=2000 npm run test

esn-frontend-contacts's People

Contributors

alagane avatar asmanode avatar atan-linagora avatar chamerling avatar fabienmoyon avatar michaelbailly avatar pbson avatar piavgh avatar renaudboyer avatar rezk2ll avatar tanandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esn-frontend-contacts's Issues

Collected contact book isn't valid

Actual Result

Collected contact is a default addressbook. It is displaying with an invalid icon and unable to open its setting.

collected_contact

Expected result

Collected contact addressbook should be valid


DoD:

The Collected contact should have an icon and we can open its Settings

Production bug: unable to update contact

Tested on Chrome/Firefox
Environment: openpaas.linagora.com

Steps:

  1. Create a contact

  2. Edit the above contact

  3. Hit Save

  4. Wait 10 seconds

  5. Reload the page

Expected result:

The contact contains the updated information

Actual result:

The contact does NOT contains the updated information

DAVx5 > Cannot login by using Production account on DAVx5

Actual Result

Returns error message dialog
processed

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:sabredav-version>3.2.2</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
<s:message>Username or password was incorrect. Login was needed for privilege: {DAV:}read on </s:message>
</d:error>

Expected Result

User should be able to login DAVx5 by Production Account

[STORY] Display the address book configuration screen in a dialog

User story summary

  1. Related epic
  2. Definition
  3. Criteria
  4. UI/UX Design
  5. TASKS

Synchronize Contacts' UI/UX with Calendar's

Definition

As a user, I want the address book configuration screen to display in a dialog on desktop.

  • I login and go to Contacts
  • Then I select "Settings" in an address book
  • Then the address book configuration should be displayed in a dialog

Criteria

  • The address book settings screen should display inside a dialog.
  • The dialog should stand out from the rest of the viewport (as seen in the screenshots below).
  • The address book's name and its icon is displayed first in the body of the dialog.
  • The "Save" and "Close" buttons will be at the bottom of the dialog.

UI/UX Design

  1. [Desktop] The main "Address book settings" screen:

Screenshot from 2021-02-24 15-51-19.png

  1. [Desktop] The "Address book settings" dialog:

Screenshot from 2021-02-24 15-51-38.png

TASKS

create/modify the route state for the address-book settings

change the address book configuration template to be a modal

[OPTIONAL]

move the name edit and delete button into the configuration screen

Fix i18n

As explained here, some translations need manual fixings:

In the task changing pug i18n calls __() with angular translate {{ 'thing' | translate }}
The expression
#{__('Address book %s will be deleted along with its contacts.', '{{::$ctrl.addressbookDisplayShell.displayName}}')}
will be replaced by
{{ 'Address book %s will be deleted along with its contacts.' | translate:$ctrl.addressbookDisplayShell.displayName }}

That will not work. The code should be updated to use Angular Translate way of passing arguments
See https://angular-translate.github.io/docs/#/api/pascalprecht.translate.filter:translate
File: /home/mbailly/work/openpaas/git/esn-spa-converter/src/linagora.esn.contact/app/addressbook/delete/addressbook-delete.pug

---------------------------------------------
In the task changing pug i18n calls __() with angular translate {{ 'thing' | translate }}
The expression
#{__('Export your contacts in "%s" to vCard format file (.vcf) that you can import to other applications.', '{{::$ctrl.addressbookDisplayShell.displayName}}')}
will be replaced by
{{ 'Export your contacts in "%s" to vCard format file (.vcf) that you can import to other applications.' | translate:$ctrl.addressbookDisplayShell.displayName }}

That will not work. The code should be updated to use Angular Translate way of passing arguments
See https://angular-translate.github.io/docs/#/api/pascalprecht.translate.filter:translate
File: /home/mbailly/work/openpaas/git/esn-spa-converter/src/linagora.esn.contact/app/addressbook/export/contact-addressbook-export.pug

Followed members address book is not shown

Steps to reproduce:

  1. As admin, enable Followed member address book in adminstration
  2. User go to https://dev.open-paas.org/contacts/
  3. Check if Followed member is shown in the left menu under Directory section

Expected result:
Followed members is listed in Directory. When user clicks on Followed members, the list of followed members is shown on the right panel

Actual result:
Followed member address book is not in the left menu

20200821_2


EDIT:

Screenshot 2020-09-07 17:08:27

So we will need to remove everything related to follow in modules admin, contacts, ...

[STORY] Edit an existing contact in a dialog

User story summary

  1. Related epic
  2. Definition
  3. Criteria
  4. UI/UX Design
  5. Tasks

Synchronize Contacts' UI/UX with Calendar's

Definition

As a user, I want to be able to edit an existing contact in a dialog on desktop.

  • I login and go to Contacts
  • Then I choose to edit an existing contact
  • Then the content used to edit an existing contact should display in a dialog

Criteria

  • The content used to edit an existing contact should display in a dialog
  • The dialog should stand out from the rest of the viewport (as seen in the pictures below).
  • The header of the dialog is named "Edit contact" and has a "X" icon button to close the dialog.
  • The body of the dialog will have the following fields (they will also appear in the following order):
    • Address book selector
    • Avatar, first name, and last name
    • Organization, job title
    • Email, type of email (can add more than one email with a "+" button)
    • Phone, type of phone (can add more than one phone number with a "+" button)
    • Street, type of address, city, city's zip code, country (can add more than one address with a "+" button)
    • Tags
    • Website (collapsible, can add more than one website with a "+" button)
    • Social account, type of social account (collapsible, can add more than one website with a "+" button)
    • Birthday (collapsible)
    • Nickname (collapsible)
    • Comments (collapsible)
  • There are a "More options" button and a "Save" button at the bottom of the dialog.
    • The "More options" button will display all the collapsible fields mentioned above. And afterwards, there will be a "Fewer options" to hide those fields again.
    • The "Save" button is used to save the contact.

UI/UX Design

  1. [Desktop] The main "Edit contact" screen:

Screenshot from 2021-02-25 15-23-15.png

  1. [Desktop] The "Edit contact" dialog:

Screenshot from 2021-02-25 15-23-44.png

  1. [Desktop] The "Edit contact" dialog with the collapsible fields shown:

Screenshot from 2021-02-25 17-01-40.png

Tasks

adapt the contact edit template

adapt or create the route state of the contact edit dialog

When an address book is delegated to a user, it should be automatically be added to the "Shared address books" of that user

Steps to reproduce

As User A:

  • Go to Contacts
  • Delegate one of my address books to User B

As User B:

  • Go to Contacts

Current behaviour

User B still does not see the delegated address book in the "Shared address books" list. He will have to manually add the address book via the "Add shared address book" button.

Expected/Suggested behaviour

The delegated address book is automatically added to the list of "Shared address books" of User B without him having to manually add it.

Fix templates import

As explained here, check that the frontend does not call the backend to get templates.

In the task moving from "templateUrl: string" to "template: require('pugfile')"

The templateUrl has not been changed for path /contact/app/search/contact-search.html. This would break application.
BoxOVerlay system should support "template" attriute before updating this line.

---------------------------------------------
In the task moving from "templateUrl: string" to "template: require('pugfile')"

The templateUrl has not been changed for path /contact/app/search/contact-search.html. This would break application.
BoxOVerlay system should support "template" attriute before updating this line.

CORS issue when SPA and backend API are on different origins

  • If we set withCredentials: true:
Access to XMLHttpRequest at 'http://localhost:8080/dav/api/principals/users/5f2d39943d95095cf22477a5' from origin 'http://localhost:4000' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSNotSupportingCredentials

  • If we don't set withCredentials: true:
GET http://localhost:8080/dav/api/addressbooks/5f2d39943d95095cf22477a6.json?contactsCount=true&inviteStatus=2&personal=true&shared=true&subscribed=true 401 (Unauthorized)

[STORY] Display a contact's details in a dialog

User story summary

  1. Related epic
  2. Definition
  3. Criteria
  4. UI/UX Design
  5. Tasks

Synchronize Contacts' UI/UX with Calendar's

Definition

As a user, I want the details of a contact to display in a dialog on desktop.

  • I login and go to Contacts
  • Then I choose to view the details of a contact
  • Then the details of the contact should be displayed in a dialog

Criteria

  • The details of a contact should display inside a dialog.
  • The dialog should stand out from the rest of the viewport (as seen in the screenshots below).
  • The content of the dialog should follow the UI/UX design below (see Picture 2).

UI/UX Design

  1. [Desktop] The main "Contact details" screen:

Screenshot from 2021-02-24 17-01-33.png

  1. [Desktop] The "Contact details" dialog:

Screenshot from 2021-02-24 17-01-52.png

Tasks

the route state for the contact dialog

create a new display dialog template

Translation > Tabs name are not translated

Actual Result

  1. The tab name for each module should be translated for corresponding languages since it's always English.

  2. Account's tab name is "OpenPaas". It should have specìied name such as account, profile (and should be translated)... and also the tab's icon.

image

Display shared address books with the owner of the address book in the address book selector

Steps to reproduce

  • Go to Contacts
  • Make sure you have a shared address book with write permission
  • Now choose to create a new contact
  • Open the address book selector

Current behaviour

The shared address books in the selector are only dislayed with their names. This makes it confusing for users in case when there are multiple shared address books with the same name.

Suggested behaviour

The shared address books in the selector should be displayed with their names and the names of their owners like this: "My contacts - John Doe1".

A user can still share his address book in the address book settings page although address book sharing is disabled

Steps to reproduce

As a domain admin:

  • Go to the Admin module
  • Disable address book sharing

As a user:

  • Go to the Contacts module
  • Select an address book and open the settings page

Expected behaviour

All the content related to address book sharing/delegation should not be displayed.

Current behaviour

The content related to address book sharing/delegation is still displayed and the user can still share his address book.

Unable to share address book by delegation

Steps to reproduce:

  1. Go to settings of a certain address book
  2. Select Delegation tab

Expected result:
User should be able to input user to share with and select permissions

Actual result:
There is no field to input user to share with

20200821

[TASK][address book configuration screen] change the adressbook configuration template to be a modal

STORY

TODO:

  • wrap the current template into a modal, the modal structure could be:
.modal
  .modal-dialog
    .modal-content
      .modal-header
        button.close
        title
      .modal-body
          content <- this is the old template
      .modal-footer.flex
          button <- some save button
          button <- mayeb a close button?
  • remove the contactAddressbookSettingsSubheader directive and its files ( src/linagora.esn.contact/app/addressbook/settings/contact-addressbook-settings.pug etc ..)
  • handle the dialog close and save button handlers and keeping in mind the previous state of the app:
    • when I click on the close button what should happen and what state should I go back to?
    • same for the save button

[TASK][address book configuration screen] create/modify the route state for the address-book settings

STORY

TODO:

  • update the existing route (contact.addressbooks.settings view main@contact ) or create a new route state ( ie /edit/:addressbookId )
  • inject the settings component with the $modal into the scope when entering the state
  • hide the dialog when leaving the state
  • pass the previous state as params to the state
  • load the addressbook from the $stateParams in the component controller ( ie from $stateParams.addressbookId )
  • make sure that the configuration dialog can be accessed via a URL
  • make the settings button go to the new state $state.go('example'):
    • you can use contactAddressbookActionSettings._goToSettingsPage ( or adapt )

There is no loading indicator when contacts are being loaded

Steps to reproduce

  • Login and go to Contacts
  • Select an address book

Current behaviour

While the contacts in the selected address book are being loaded, a blank page is shown with nothing to indicate that the contacts are being loaded.

Expected behaviour

While the contacts in the selected address book are being loaded, there should be an OpenPaaS loading spinner at the center of the section to display contacts.

DAVx5 cannot synchronize Domain Member Addressbook on Samsung Note

Environment

Production
Samsung Note 9, Note 10 - Androids 10

Actual Result

DAVx5 cannot synchronize the Domain Member Address book on Samsung Note. It displays an error log on Control Center "Authentication failed".

Expected Result

Please investigate.
Domain Member Addressbook should be synced successfully on Samsung Note 9, 10

[STORY] Create a new contact in a dialog

User story summary

  1. Related epic
  2. Definition
  3. Criteria
  4. UI/UX Design
  5. Tasks

Synchronize Contacts' UI/UX with Calendar's

Definition

As a user, I want to be able to create a new contact in a dialog on desktop.

  • I login and go to Contacts
  • Then I choose to create a new contact
  • Then the content used to create a new contact should display in a dialog

Criteria

  • The content used to create a new contact should display in a dialog
  • The dialog should stand out from the rest of the viewport (as seen in the pictures below).
  • The header of the dialog is named "Create new contact" and has a "X" icon button to close the dialog.
  • The body of the dialog will have the following fields (they will also appear in the following order):
    • Address book selector
    • Avatar, first name, and last name
    • Organization, job title
    • Email, type of email (can add more than one email with a "+" button)
    • Phone, type of phone (can add more than one phone number with a "+" button)
    • Street, type of address, city, city's zip code, country (can add more than one address with a "+" button)
    • Tags
    • Website (collapsible, can add more than one website with a "+" button)
    • Social account, type of social account (collapsible, can add more than one website with a "+" button)
    • Birthday (collapsible)
    • Nickname (collapsible)
    • Comments (collapsible)
  • There are a "More options" button and a "Save" button at the bottom of the dialog.
    • The "More options" button will display all the collapsible fields mentioned above. And afterwards, there will be a "Fewer options" to hide those fields again.
    • The "Save" button is used to create the contact.

UI/UX Design

  1. [Desktop] The main "Create new contact" screen:

Screenshot from 2021-02-25 15-15-45.png

  1. [Desktop] The "Create new contact" dialog:

Screenshot from 2021-02-25 15-16-05.png

  1. [Desktop] The "Create new contact" dialog with the collapsible fields shown:

Screenshot from 2021-02-25 16-52-16.png

Tasks

adapt the new create contact template dialog

adapt or create the route state of the new contact dialog

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.