From aaa1b2d6c7dc0b4388c49ea22c15f02ef4f7beb5 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Mon, 3 May 2021 09:03:48 +0200 Subject: [PATCH 1/6] add translation for Japanese Yen --- common/data/sap.common-Currencies_texts.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/data/sap.common-Currencies_texts.csv b/common/data/sap.common-Currencies_texts.csv index 4d2ead51..4c46cefd 100644 --- a/common/data/sap.common-Currencies_texts.csv +++ b/common/data/sap.common-Currencies_texts.csv @@ -5,9 +5,11 @@ CAD;de;Kanadischer Dollar;Kanadischer Dollar AUD;de;Australischer Dollar;Australischer Dollar GBP;de;Pfund;Britische Pfund ILS;de;Schekel;Israelische Schekel +JPY;de;Yen;Japanische Yen EUR;fr;euro;de la Zone euro USD;fr;dollar;dollar des États-Unis CAD;fr;dollar canadien;dollar canadien AUD;fr;dollar australien;dollar australien GBP;fr;livre sterling;pound sterling -ILS;fr;Shekel;shekel israelien \ No newline at end of file +ILS;fr;Shekel;shekel israelien +JPY;fr;Yen;Yen japonais \ No newline at end of file From 1b10bbbfe41f6b2ca082e7c922bb8f8ead2002b2 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Mon, 3 May 2021 09:04:13 +0200 Subject: [PATCH 2/6] switch currency of a book --- bookshop/db/data/sap.capire.bookshop-Books.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookshop/db/data/sap.capire.bookshop-Books.csv b/bookshop/db/data/sap.capire.bookshop-Books.csv index cb3044aa..702375bb 100644 --- a/bookshop/db/data/sap.capire.bookshop-Books.csv +++ b/bookshop/db/data/sap.capire.bookshop-Books.csv @@ -3,4 +3,4 @@ ID;title;descr;author_ID;stock;price;currency_code;genre_ID 207;Jane Eyre;"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.";107;11;12.34;GBP;11 251;The Raven;"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.";150;333;13.13;USD;16 252;Eleonora;"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.";150;555;14;USD;16 -271;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;170;22;15;EUR;13 \ No newline at end of file +271;Catweazle;Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.;170;22;150;JPY;13 \ No newline at end of file From a6ec296129711455df3e802f915095c2f1ee3737 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Mon, 3 May 2021 09:04:38 +0200 Subject: [PATCH 3/6] add annotation for ISOCurrency --- fiori/app/common.cds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fiori/app/common.cds b/fiori/app/common.cds index 614f03b3..b609498d 100644 --- a/fiori/app/common.cds +++ b/fiori/app/common.cds @@ -54,7 +54,7 @@ annotate my.Books with { title @title:'{i18n>Title}'; genre @title:'{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly }; author @title:'{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly }; - price @title:'{i18n>Price}'; + price @title:'{i18n>Price}' @Measures.ISOCurrency: currency_code; stock @title:'{i18n>Stock}'; descr @UI.MultiLineText; } From ad417ec06198df9009631e2515e93569d85f82c1 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Mon, 3 May 2021 09:33:05 +0200 Subject: [PATCH 4/6] fix test for Yen --- fiori/test/requests.http | 4 ++++ test/localized-data.test.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fiori/test/requests.http b/fiori/test/requests.http index badacbfe..d8392583 100644 --- a/fiori/test/requests.http +++ b/fiori/test/requests.http @@ -38,7 +38,11 @@ GET {{bookshop}}/browse/Books(201)? &$select=ID,title,rating &$expand=reviews +### +GET {{bookshop}}/browse/Books? + &$select=title,author&$expand=currency +Accept-Language: de ################################################# # diff --git a/test/localized-data.test.js b/test/localized-data.test.js index bfa3411f..5ba9bd19 100644 --- a/test/localized-data.test.js +++ b/test/localized-data.test.js @@ -43,7 +43,7 @@ describe('Localized Data', () => { { title: 'Jane Eyre', author: 'Charlotte Brontë', currency: { name: 'Pfund' } }, { title: 'The Raven', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, { title: 'Eleonora', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } }, - { title: 'Catweazle', author: 'Richard Carpenter', currency: { name: 'Euro' } }, + { title: 'Catweazle', author: 'Richard Carpenter', currency: { name: 'Yen' } }, ]) }) @@ -85,7 +85,7 @@ describe('Localized Data', () => { { title: 'Jane Eyre', currency: { name: 'British Pound' } }, { title: 'The Raven', currency: { name: 'US Dollar' } }, { title: 'Eleonora', currency: { name: 'US Dollar' } }, - { title: 'Catweazle', currency: { name: 'Euro' } }, + { title: 'Catweazle', currency: { name: 'Yen' } }, ]) }) }) From 3117df12825e99765c8f1f4509cddcafc71789ca Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Fri, 28 May 2021 14:54:43 +0200 Subject: [PATCH 5/6] Test with Jest 26 `cds.test` seems to have issues w/ Jest 27. To be investigated... --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d8b32c62..1eae7227 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "fiori": "cds watch fiori", "media": "cds watch media", "mocha": "npx mocha || echo", - "jest": "npx jest", + "jest": "npx jest@^26", "test": "npm run jest --silent" }, "mocha": { From be87f5617aea2d710401c7dfcbadb4caf98d8ae5 Mon Sep 17 00:00:00 2001 From: Pierre Fritsch Date: Fri, 28 May 2021 12:02:11 +0200 Subject: [PATCH 6/6] Fix typo orderd -> ordered --- bookshop/app/vue/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookshop/app/vue/app.js b/bookshop/app/vue/app.js index 78bd342b..f99d87a8 100644 --- a/bookshop/app/vue/app.js +++ b/bookshop/app/vue/app.js @@ -35,7 +35,7 @@ const books = new Vue ({ try { const res = await POST(`/submitOrder`, { amount, book: book.ID }) book.stock = res.data.stock - books.order = { amount, succeeded: `Successfully orderd ${amount} item(s).` } + books.order = { amount, succeeded: `Successfully ordered ${amount} item(s).` } } catch (e) { books.order = { amount, failed: e.response.data.error.message } }