Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
844ce11
Dialog added.
YegorUdovchenko Mar 26, 2018
602b22b
Add empty book modal dialog to main app.
YegorUdovchenko Mar 26, 2018
c1026e3
Add book dialog styling.
YegorUdovchenko Mar 26, 2018
fb6668d
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Mar 26, 2018
c55486c
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Mar 27, 2018
783d539
Add book dialog open on book tile click.
YegorUdovchenko Mar 27, 2018
cb0fd94
Add book dialog narrow mode support.
YegorUdovchenko Mar 27, 2018
561c358
Add paper-dropdown-menu for categories
YuriiHaidamaka Mar 27, 2018
97486fa
Add paper-dropdown-menu for categories
YuriiHaidamaka Mar 27, 2018
8d216e8
Add full book message to the book dialog.
YegorUdovchenko Mar 27, 2018
eb3aa16
Merge branch 'add_book_grid' into add_category_dropdown
YuriiHaidamaka Mar 27, 2018
481dafb
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Mar 27, 2018
14712da
Add margin-left for drop-down menu.
YuriiHaidamaka Mar 27, 2018
fc7784f
Add custom button to the book dialog.
YegorUdovchenko Mar 27, 2018
78ca524
Change book click handler.
YegorUdovchenko Mar 27, 2018
9005204
Add book-dialog docs, change dialog styles.
YegorUdovchenko Mar 27, 2018
18ca992
Fix lint issues.
YegorUdovchenko Mar 27, 2018
c7ae0f2
Add modal dialog close button.
YegorUdovchenko Mar 28, 2018
509a6be
Merge branch 'add_book_grid' into add_category_dropdown
YuriiHaidamaka Mar 28, 2018
7f005e2
Change redux store for working with dropdown
YuriiHaidamaka Mar 28, 2018
81f6d18
Add specific route for book modal dialog.
YegorUdovchenko Mar 28, 2018
69bd5e7
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Mar 28, 2018
c5b660d
Fix custom button in book modal dialog.
YegorUdovchenko Mar 28, 2018
8c4bc98
Create the custom-search component without any property
YuriiHaidamaka Mar 28, 2018
a7a2c19
Merge branch 'book_modal_dialog' into add_search
YuriiHaidamaka Mar 28, 2018
59099ad
Add "All" item in the category selector.
YuriiHaidamaka Mar 28, 2018
f490daf
Add docs to the book dialog.
YegorUdovchenko Mar 29, 2018
8430d8f
Change search color
YuriiHaidamaka Mar 29, 2018
aacfb83
Merge branch 'add_book_grid' into add_search_and_dropdown
YuriiHaidamaka Mar 29, 2018
b2712ea
Add dialog buttons fire events, complete dialog docs.
YegorUdovchenko Mar 29, 2018
b01c4af
Rename custom-search into book-search
YuriiHaidamaka Mar 29, 2018
1432d12
Rename book dialog events.
YegorUdovchenko Mar 29, 2018
1292472
Add action for the search by query
YuriiHaidamaka Mar 29, 2018
5c5e384
Rename redux action SORT_BY_CATEGORY into SEARCH_BY_CATEGORY
YuriiHaidamaka Mar 29, 2018
3f7ce03
Add category instead of index in the redux action
YuriiHaidamaka Mar 29, 2018
9a6ffdd
Add docs for book-search
YuriiHaidamaka Mar 29, 2018
c7e0283
Merge branch 'book_modal_dialog' into add_search_and_dropdown
YuriiHaidamaka Mar 29, 2018
6006e8f
Add book dialog content tests.
YegorUdovchenko Mar 29, 2018
8a3b05b
Complete book dialog buttons tests.
YegorUdovchenko Mar 29, 2018
a78d9ed
Add one test for book-search that doesn't work
YuriiHaidamaka Mar 29, 2018
9c0282c
Merge branch 'add_book_grid' into add_search_and_dropdown
YuriiHaidamaka Mar 29, 2018
562b4c3
Add placeholder image to the book dialog.
YegorUdovchenko Mar 30, 2018
9126861
Simplify book dialog routing.
YegorUdovchenko Mar 30, 2018
b9418b5
Change test for book-search
YuriiHaidamaka Mar 30, 2018
4322add
Change tests for book-search and add new imports
YuriiHaidamaka Mar 30, 2018
7c264b0
Merge remote-tracking branch 'origin/add_book_grid' into add_search_a…
YuriiHaidamaka Mar 30, 2018
3a163ad
Add app show `view404` on unknown book id.
YegorUdovchenko Mar 30, 2018
15969e7
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Mar 30, 2018
ef6352e
Merge remote-tracking branch 'origin/book_modal_dialog' into add_sear…
YuriiHaidamaka Mar 30, 2018
11a88c3
Merge branch 'book_modal_dialog' into add_search_and_dropdown
YuriiHaidamaka Mar 30, 2018
90a6d88
Merge branch 'polymer_general_tasks' into book_modal_dialog
YegorUdovchenko Apr 3, 2018
21db042
Merge branch 'polymer_general_tasks' into book_modal_dialog
YegorUdovchenko Apr 3, 2018
40a2599
Change book-dialot to book details page.
YegorUdovchenko Apr 3, 2018
18534eb
Create separate web component exlibris-book-dropdown
YuriiHaidamaka Apr 3, 2018
9b7b683
Rename book-search into exlibris-book-search
YuriiHaidamaka Apr 3, 2018
22b142e
Make book details page styles work with mobile screen view.
YegorUdovchenko Apr 3, 2018
fe8c8f0
Refactor category-dropdown
YuriiHaidamaka Apr 4, 2018
082671a
Delete magic numbers from test_values.js
YuriiHaidamaka Apr 4, 2018
957f3e5
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 4, 2018
e10c747
Remove close dialog method.
YegorUdovchenko Apr 4, 2018
209584e
Add book tile click event listener.
YegorUdovchenko Apr 4, 2018
f6fca34
Add redux for book-details component to get selected book.
YegorUdovchenko Apr 4, 2018
223c007
Remove book details buttons fire events to exlibris app.
YegorUdovchenko Apr 4, 2018
58eba4e
Add book-details message calculation depending on book status.
YegorUdovchenko Apr 4, 2018
b6cae57
Refactor book status check methods.
YegorUdovchenko Apr 4, 2018
cb134f5
Remove multiple buttons, add button for narrow screen.
YegorUdovchenko Apr 4, 2018
100968e
Improve book-details styling.
YegorUdovchenko Apr 4, 2018
fa8e1ef
Add button click handler depending on book status.
YegorUdovchenko Apr 5, 2018
2855e23
Add button hidden state, add `reserved by someone` message.
YegorUdovchenko Apr 5, 2018
881938c
Improve book details card styling.
YegorUdovchenko Apr 5, 2018
04e1d20
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 5, 2018
a7c89d9
Change font style property.
YegorUdovchenko Apr 5, 2018
dcaf5c6
Merge branch 'book_modal_dialog' into add_search_and_dropdown
YuriiHaidamaka Apr 5, 2018
30a64f3
Fix problems after merge
YuriiHaidamaka Apr 5, 2018
1787033
Add book details methods jsdocs.
YegorUdovchenko Apr 5, 2018
864bce7
Change some css classes to refer by id.
YegorUdovchenko Apr 6, 2018
f825f4f
Add book property docs.
YegorUdovchenko Apr 6, 2018
dc5a7bd
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 6, 2018
5a34507
Remove unnecessary book tile click handler.
YegorUdovchenko Apr 6, 2018
f7e1f68
Add jsdocs to button identify method.
YegorUdovchenko Apr 6, 2018
ba72ed2
Unite button title and click handler in single button property.
YegorUdovchenko Apr 6, 2018
08a0f4e
Add action dispatch on URL change.
YegorUdovchenko Apr 6, 2018
b2995dd
Add temp action handler to the reducer to find book by id.
YegorUdovchenko Apr 10, 2018
3074f7d
Separate button, status message and action unsupported message comput…
YegorUdovchenko Apr 10, 2018
a0fad93
Add book undefined check to the compute functions.
YegorUdovchenko Apr 10, 2018
861f3ee
Change colors variables in the exlibris-book-search
YuriiHaidamaka Apr 10, 2018
555b33b
Add jsdocs for compute values methods.
YegorUdovchenko Apr 10, 2018
cac2381
Extract book redirect link into custom element.
YegorUdovchenko Apr 10, 2018
60ef5f6
Complete redirect link component docs, extract enums of code matchers…
YegorUdovchenko Apr 10, 2018
9a1626f
Replace on-click handler with link using target property.
YegorUdovchenko Apr 10, 2018
a87801f
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 11, 2018
b18c0a5
Refactor namespace declaration in project.
YegorUdovchenko Apr 11, 2018
8da8727
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 11, 2018
f725bcc
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 11, 2018
3a78d11
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 11, 2018
6221e9b
Fix exlibris-app test store mock issue. Fix test files imports due to…
YegorUdovchenko Apr 11, 2018
0d8e2d3
Merge branch 'add_book_grid' into book_modal_dialog
YegorUdovchenko Apr 11, 2018
21bb4b1
Change color declarations to paper-color values.
YegorUdovchenko Apr 12, 2018
2e739d6
Merge branch 'book_modal_dialog' into add_search_and_dropdown
YuriiHaidamaka Apr 12, 2018
d5c79ec
Move exlibris-category-dropdown into slot of the exlibris-book-grid
YuriiHaidamaka Apr 12, 2018
d185e10
Add book-details work with store tests.
YegorUdovchenko Apr 12, 2018
bdd46d0
Add routing for exlibris-category-dropdown
YuriiHaidamaka Apr 12, 2018
c9ad2f0
Rename redux action SEARCH_BY_CATEGORY into FILTER_BY_CATEGORY
YuriiHaidamaka Apr 12, 2018
30e6f32
Complete book-details store and buttons tests.
YegorUdovchenko Apr 12, 2018
0364f4a
Added routing changes for search
YuriiHaidamaka Apr 12, 2018
027dbc2
Add test implementation in the redux reducer
YuriiHaidamaka Apr 12, 2018
ce0e8e8
Add route check before dispatching the `findBookById` action.
YegorUdovchenko Apr 12, 2018
2dd3c1e
Apply paper-styles to book-details page.
YegorUdovchenko Apr 13, 2018
2659219
Remove icon from the redirect link.
YegorUdovchenko Apr 13, 2018
4cbe117
Simplify redirect-link template and styles.
YegorUdovchenko Apr 13, 2018
47d7c6c
Merge branch 'add_book_grid' into add_search_and_dropdown
YuriiHaidamaka Apr 13, 2018
138558c
Change book-details methods naming.
YegorUdovchenko Apr 13, 2018
cd31bd2
Add message for search without result
YuriiHaidamaka Apr 13, 2018
f762f65
Merge branch 'add_book_grid' into add_search_and_dropdown
YuriiHaidamaka Apr 13, 2018
9ce3923
Move dom-if with message in the top of component in the exlibris-book…
YuriiHaidamaka Apr 13, 2018
d40efc6
Fix details-page tests.
YegorUdovchenko Apr 13, 2018
75ffdcd
Merge branch 'add_book_grid' into book_details_page
YegorUdovchenko Apr 16, 2018
4c0be8c
Resolve import path issues, fix tests to meet IE requirements.
YegorUdovchenko Apr 16, 2018
3349822
Delete commented code
YuriiHaidamaka Apr 16, 2018
b5cee6e
Add debounce in the exlibris-book-search component
YuriiHaidamaka Apr 16, 2018
168cd50
Add reseting filters after click on the all-books
YuriiHaidamaka Apr 16, 2018
836a76c
Add book details loading status.
YegorUdovchenko Apr 16, 2018
0e63862
Create book-details fires event test.
YegorUdovchenko Apr 16, 2018
05a3248
Move book code patterns and redirect link templates to the book_values.
YegorUdovchenko Apr 16, 2018
efe9f9f
Add query params in search
YuriiHaidamaka Apr 16, 2018
16fe5a8
Change links in the exlibris-category-dropdown
YuriiHaidamaka Apr 16, 2018
6608752
Add reseting exlibris-category-dropdown after tap on the all-books
YuriiHaidamaka Apr 16, 2018
e103a88
Replace Array.find() with function to add IE support.
YegorUdovchenko Apr 16, 2018
b9d814f
Remove temporal functions.
YegorUdovchenko Apr 16, 2018
0fa21d5
Merge branch 'add_book_grid' into book_details_page
YegorUdovchenko Apr 16, 2018
24bb392
Change files naming to dash case.
YegorUdovchenko Apr 16, 2018
d32e32e
Remove unnecessary dependencies.
YegorUdovchenko Apr 16, 2018
ed67f4b
Remove idea files.
YegorUdovchenko Apr 16, 2018
6034564
Refactor exlibris-category-dropdown
YuriiHaidamaka Apr 16, 2018
48813a5
Change exlibris-book-search-test after changing components
YuriiHaidamaka Apr 16, 2018
d198beb
Add jsdocs parameter definitions.
YegorUdovchenko Apr 16, 2018
9740c4e
Merge branch 'book-details-page' into add_search_and_dropdown
YuriiHaidamaka Apr 16, 2018
f2e3c6a
Delete test helpers dependency
YuriiHaidamaka Apr 16, 2018
3b116f8
Solve lint issues
YuriiHaidamaka Apr 16, 2018
8d4b540
Move redax actions to ExliprisApp namespace, improve book-details docs.
YegorUdovchenko Apr 16, 2018
a38c1e4
Update docs in the exlibris-book-search and exlibris-category-dropdown
YuriiHaidamaka Apr 16, 2018
3850a5b
Refactor book-details docs.
YegorUdovchenko Apr 16, 2018
79876e5
Merge branch 'book-details-page' into add_search_and_dropdown
YuriiHaidamaka Apr 16, 2018
29ec30b
Add ExlibrisAction into the namespace ExlibrisApp
YuriiHaidamaka Apr 16, 2018
6cf875a
Fix ESLint problems
YuriiHaidamaka Apr 16, 2018
5a52450
Refactor book-details css classes names, fix test query selectors due…
YegorUdovchenko Apr 17, 2018
14be2d7
Merge branch 'add_book_grid' into book_details_page
YegorUdovchenko Apr 17, 2018
9b99760
Refactor import statements.
YegorUdovchenko Apr 17, 2018
27fc865
Add actions dispatch on details-page buttons click, cover with tests.
YegorUdovchenko Apr 18, 2018
1970e5e
Merge branch 'master' into book_details_page
YegorUdovchenko Apr 27, 2018
7daed1f
Merge branch 'master' into add_search_and_dropdown
YuriiHaidamaka May 3, 2018
fab8e4e
Fix issues after merging master
YuriiHaidamaka May 3, 2018
f8e9154
Move book code patterns and link templates to redirect link component.
YegorUdovchenko May 4, 2018
2345bbd
Fix tests due to constants moved from book values.
YegorUdovchenko May 4, 2018
463350d
Fix test constants.
YegorUdovchenko May 4, 2018
805ab83
Improve docs.
YegorUdovchenko May 4, 2018
f01edf8
Merge branch 'master' into book_details_page
YegorUdovchenko May 4, 2018
95a3297
Merge branch 'master' into add_search_and_dropdown
YuriiHaidamaka May 4, 2018
5866fa1
Merge branch 'book-details-page' into add_search_and_dropdown
YuriiHaidamaka May 4, 2018
f245bbd
Add deleted actions
YuriiHaidamaka May 4, 2018
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
7 changes: 6 additions & 1 deletion client-web/bower.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,12 @@
"iron-icons": "PolymerElements/iron-icons#^2.1.1",
"iron-image": "PolymerElements/iron-image#^2.2.0",
"iron-scroll-threshold": "PolymerElements/iron-scroll-threshold#^2.0.0",
"iron-list": "PolymerElements/iron-list#^2.0.13"
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#^2.1.0",
"paper-listbox": "PolymerElements/paper-listbox#^2.1.0",
"web-animations-js": "web-animations/web-animations-js#2.2.2",
"paper-item": "PolymerElements/paper-item#^2.1.0",
"iron-list": "PolymerElements/iron-list#^2.0.13",
"paper-button": "PolymerElements/paper-button#^2.1.0"
},
"devDependencies": {
"web-component-tester": "Polymer/web-component-tester#^6.0.0",
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions client-web/src/exlibris-app/actions/exlibris-actions.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,5 +21,12 @@
<script>
ExlibrisApp.ExlibrisActions = {
FETCH_BOOKS: "FETCH_BOOKS",
FIND_BOOK_BY_ID: "FIND_BOOK_BY_ID",
CANCEL_BOOK_RESERVATION: "CANCEL_BOOK_RESERVATION",
RESERVE_BOOK: "RESERVE_BOOK",
EXTEND_LOAN_PERIOD: "EXTEND_LOAN_PERIOD",
FILTER_BY_CATEGORY: "FILTER_BY_CATEGORY",
SEARCH_BY_QUERY: "SEARCH_BY_QUERY",
RESET_FILTERS: "RESET_FILTERS"
}
</script>
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,6 +19,7 @@
-->

<script>
/* exported BookStatus EmptyArrayMessage BookCodePatterns ExternalLinkTemplates*/

ExlibrisApp.BookStatus = {
OVERDUE: "OVERDUE",
Expand All@@ -31,4 +32,23 @@
READY_TO_PICK_UP: "READY_TO_PICK_UP",
};

ExlibrisApp.EmptyArrayMessage = {
OVERDUE: "You don't have any overdue books yet.",
BORROWED: "You haven't borrowed any books yet.",
SHOULD_RETURN_SOON: "You don't have books that you should return soon",
RESERVED: "You haven't reserved any books yet",
EXPECTED_SOON: "In the near future, the supply of new books to the library is not expected.",
ALL: "There are no books in the library."
};

ExlibrisApp.BookCodePatterns = {
ISBN_10: /^\d{10}$/g,
ISBN_13: /^\d{13}$/g,
ASIN: /^[\d, A-Z]{10}$/g
};

ExlibrisApp.ExternalLinkTemplates = {
AMAZON: 'https://www.amazon.com/%s/dp/%s/',
PLAY_BOOKS: 'https://play.google.com/store/search?q=%s&c=books'
};
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
<!--
~ Copyright 2018, TeamDev Ltd. All rights reserved.
~
~ Redistribution and use in source and/or binary forms, with or without
~ modification, must retain the above copyright notice and the following
~ disclaimer.
~
~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
~ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
~ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
~ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
~ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
~ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
~ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
~ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
~ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
~ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
~ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<link rel="import" href="../../../bower_components/polymer/polymer-element.html">

<dom-module id="exlibris-book-details-redirect-link">
<template>
<style>
:host {
display: flex;
margin: 5px 0 5px 0;
}

#link {
@apply --paper-font-body1;
display: flex;
text-decoration: none;
color: var(--paper-blue-600);
}

#link:hover {
text-decoration: underline;
}
</style>

<a id="link" target="_blank" href="[[reference.value]]">
[[reference.title]]
</a>
</template>

<script>
{
String.prototype.format = function () {
return [...arguments].reduce((p, c) => p.replace(/%s/, c), this);
};

const BookCodePattern = {
ISBN_10: /^\d{10}$/g,
ISBN_13: /^\d{13}$/g,
ASIN: /^[\d, A-Z]{10}$/g
};

const ExternalLinkTemplate = {
AMAZON: 'https://www.amazon.com/%s/dp/%s/',
PLAY_BOOKS: 'https://play.google.com/store/search?q=%s&c=books'
};

/**
* The book external link component.
*
* Generates the link to the one of the global book services to
* open it in the new tab. The external service choice depends
* on the book code format.
*
* @customElement
* @polymer
*/
class ExlibrisBookDetailsRedirectLink extends Polymer.Element {
static get is() {
return 'exlibris-book-details-redirect-link';
}

static get properties() {
return {
/**
* The book unique code.
* Can be presented in the form of ISBN10, ISBN13 or ASIN.
*/
bookCode: String,

/**
* The book title.
*/
bookTitle: String,

/**
* The enum of book code patterns for ISBN10, ISBN13 and ASIN.
*/
bookCodePattern: {
type: Object,
value: BookCodePattern
},

/**
* The enum of external links patterns. Each value is used to
* generate redirect link depending on book code format.
*/
externalLinkTemplate: {
type: Object,
value: ExternalLinkTemplate
},

/**
* The book external link reference and its title.
*
* @property {string} title the reference title.
* @property {string} value the link to open in the new tab.
*/
reference: {
type: Object,
computed: "_calculateReference(bookCode, bookTitle)"
}
};
}

/**
* Checks for the passed book code format.
*
* If the `bookCode` matches the `ISBN10` or `ASIN` pattern, generates
* the Amazon book search link.
*
* If the `bookCode` matches the `ISBN13` pattern, generates the Google Play Books
* search link.
*
* @param {string} bookCode the book unique code (ISBN, ASIN).
* @param {string} bookTitle the book title.
* @returns {Object} the title and the value of link.
* @private
*/
_calculateReference(bookCode, bookTitle) {
if (bookCode && bookTitle) {
if (bookCode.match(this.bookCodePattern.ISBN_10)) {
return {
title: 'ISBN: ' + bookCode,
value: this.externalLinkTemplate.AMAZON.format(bookTitle, bookCode)
}
}
if (bookCode.match(this.bookCodePattern.ISBN_13)) {
return {
title: 'ISBN: ' + bookCode,
value: this.externalLinkTemplate.PLAY_BOOKS.format(bookCode)
}
}
if (bookCode.match(this.bookCodePattern.ASIN)) {
return {
title: 'ASIN: ' + bookCode,
value: this.externalLinkTemplate.AMAZON.format(bookTitle, bookCode)
}
}
}
}
}

window.customElements.define(ExlibrisBookDetailsRedirectLink.is, ExlibrisBookDetailsRedirectLink);
}
</script>
</dom-module>
Loading