From 0ef653d12e5e194d8139577d77999f6b5c309ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Wed, 8 Dec 2021 13:26:42 -0600 Subject: [PATCH] Abacus BO: print list of cats --- src/abacus-backoffice/pages/cats.js | 14 ++ src/abacus-backoffice/src/Navigation.js | 3 + src/abacus-backoffice/src/cats/CatsPage.js | 62 +++++++++ .../src/cats/CatsPageLayout.js | 18 +++ .../__generated__/CatsPageQuery.graphql.js | 124 ++++++++++++++++++ .../__generated__/IndexPageQuery.graphql.js | 15 +-- .../translations/out/es_MX.json | 9 +- .../translations/source_strings.json | 124 ++++++++++++++++-- .../translations/src_manifest.json | 2 +- 9 files changed, 344 insertions(+), 27 deletions(-) create mode 100644 src/abacus-backoffice/pages/cats.js create mode 100644 src/abacus-backoffice/src/cats/CatsPage.js create mode 100644 src/abacus-backoffice/src/cats/CatsPageLayout.js create mode 100644 src/abacus-backoffice/src/cats/__generated__/CatsPageQuery.graphql.js diff --git a/src/abacus-backoffice/pages/cats.js b/src/abacus-backoffice/pages/cats.js new file mode 100644 index 0000000000..d12be829e2 --- /dev/null +++ b/src/abacus-backoffice/pages/cats.js @@ -0,0 +1,14 @@ +// @flow + +import React, { type Element, type Node } from 'react'; + +import CatsPageLayout from '../src/cats/CatsPageLayout'; +import LayoutApp from '../src/LayoutApp'; + +export default function CatsPage(): Node { + return ; +} + +CatsPage.getLayout = (page: Element): Element => ( + {page} +); diff --git a/src/abacus-backoffice/src/Navigation.js b/src/abacus-backoffice/src/Navigation.js index 4f0c047206..29c70acb76 100644 --- a/src/abacus-backoffice/src/Navigation.js +++ b/src/abacus-backoffice/src/Navigation.js @@ -40,6 +40,9 @@ export default function Navigation(): React.Node { Employees + + Our cats + POS sessions diff --git a/src/abacus-backoffice/src/cats/CatsPage.js b/src/abacus-backoffice/src/cats/CatsPage.js new file mode 100644 index 0000000000..b4d22f30e9 --- /dev/null +++ b/src/abacus-backoffice/src/cats/CatsPage.js @@ -0,0 +1,62 @@ +// @flow + +import { Table } from '@adeira/sx-design'; +import * as React from 'react'; +import { graphql, useLazyLoadQuery } from '@adeira/relay'; +import fbt from 'fbt'; + +import type { CatsPageQuery } from './__generated__/CatsPageQuery.graphql'; + +export default function CatsPage(): React.Node { + const data = useLazyLoadQuery(graphql` + query CatsPageQuery { + cats { + listAllCats { + name + } + } + } + `); + + return ( + Order, + accessor: 'col1', + }, + { + Header: Name of the cat, + accessor: 'col2', + }, + { + Header: ( + + Date of castration + + ), + accessor: 'col3', + }, + { + Header: ( + Date of last deworming + ), + accessor: 'col4', + }, + { + Header: Date of adoption, + accessor: 'col5', + }, + ]} + data={data.cats.listAllCats.map((cat) => { + return { + col1: todo, + col2: cat.name, + col3: todo, + col4: todo, + col5: todo, + }; + })} + /> + ); +} diff --git a/src/abacus-backoffice/src/cats/CatsPageLayout.js b/src/abacus-backoffice/src/cats/CatsPageLayout.js new file mode 100644 index 0000000000..59435ffab9 --- /dev/null +++ b/src/abacus-backoffice/src/cats/CatsPageLayout.js @@ -0,0 +1,18 @@ +// @flow + +import fbt from 'fbt'; +import * as React from 'react'; + +import LayoutPage from '../LayoutPage'; +import CatsPage from './CatsPage'; + +export default function CatsPageLayout(): React.Node { + return ( + List of all our cats} + > + + + ); +} diff --git a/src/abacus-backoffice/src/cats/__generated__/CatsPageQuery.graphql.js b/src/abacus-backoffice/src/cats/__generated__/CatsPageQuery.graphql.js new file mode 100644 index 0000000000..dd96b02495 --- /dev/null +++ b/src/abacus-backoffice/src/cats/__generated__/CatsPageQuery.graphql.js @@ -0,0 +1,124 @@ +/** + * @flow + */ + +/* eslint-disable */ + +import type { ConcreteRequest } from 'relay-runtime'; +export type CatsPageQueryVariables = {||}; +export type CatsPageQueryResponse = {| + +cats: {| + +listAllCats: $ReadOnlyArray<{| + +name: string + |}> + |} +|}; +export type CatsPageQuery = {| + variables: CatsPageQueryVariables, + response: CatsPageQueryResponse, +|}; + +/* +query CatsPageQuery { + cats { + listAllCats { + name + id + } + } +} +*/ + +const node: ConcreteRequest = (function(){ +var v0 = { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "name", + "storageKey": null +}; +return { + "fragment": { + "argumentDefinitions": [], + "kind": "Fragment", + "metadata": null, + "name": "CatsPageQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "CatsQuery", + "kind": "LinkedField", + "name": "cats", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "CatInfo", + "kind": "LinkedField", + "name": "listAllCats", + "plural": true, + "selections": [ + (v0/*: any*/) + ], + "storageKey": null + } + ], + "storageKey": null + } + ], + "type": "Query", + "abstractKey": null + }, + "kind": "Request", + "operation": { + "argumentDefinitions": [], + "kind": "Operation", + "name": "CatsPageQuery", + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "CatsQuery", + "kind": "LinkedField", + "name": "cats", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "concreteType": "CatInfo", + "kind": "LinkedField", + "name": "listAllCats", + "plural": true, + "selections": [ + (v0/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "id", + "storageKey": null + } + ], + "storageKey": null + } + ], + "storageKey": null + } + ] + }, + "params": { + "cacheID": "9c0005dd399342688b3850fc3a1e94f9", + "id": null, + "metadata": {}, + "name": "CatsPageQuery", + "operationKind": "query", + "text": "query CatsPageQuery {\n cats {\n listAllCats {\n name\n id\n }\n }\n}\n" + } +}; +})(); +// prettier-ignore +(node: any).hash = '8522ee9b8aa954cc59e3622673c0c1ee'; +export default node; diff --git a/src/abacus-backoffice/src/index/__generated__/IndexPageQuery.graphql.js b/src/abacus-backoffice/src/index/__generated__/IndexPageQuery.graphql.js index 6945ec31c6..2e78453385 100644 --- a/src/abacus-backoffice/src/index/__generated__/IndexPageQuery.graphql.js +++ b/src/abacus-backoffice/src/index/__generated__/IndexPageQuery.graphql.js @@ -10,7 +10,6 @@ export type IndexPageQueryVariables = {||}; export type IndexPageQueryResponse = {| +analytics: {| +mostSoldProducts: $ReadOnlyArray<{| - +productId: string, +productName: string, +productUnits: number, |}>, @@ -36,7 +35,6 @@ export type IndexPageQuery = {| query IndexPageQuery { analytics { mostSoldProducts { - productId productName productUnits } @@ -80,13 +78,6 @@ v1 = [ "name": "mostSoldProducts", "plural": true, "selections": [ - { - "alias": null, - "args": null, - "kind": "ScalarField", - "name": "productId", - "storageKey": null - }, (v0/*: any*/), { "alias": null, @@ -182,15 +173,15 @@ return { "selections": (v1/*: any*/) }, "params": { - "cacheID": "cba0d6da1c0de65056ee74eaf8e16121", + "cacheID": "d0c1422b3a90132cbcbe5781905be80e", "id": null, "metadata": {}, "name": "IndexPageQuery", "operationKind": "query", - "text": "query IndexPageQuery {\n analytics {\n mostSoldProducts {\n productId\n productName\n productUnits\n }\n dailyReports {\n dateDay\n total {\n unitAmount\n unitAmountCurrency\n }\n productsSummary {\n productName\n totalUnits\n }\n }\n }\n}\n" + "text": "query IndexPageQuery {\n analytics {\n mostSoldProducts {\n productName\n productUnits\n }\n dailyReports {\n dateDay\n total {\n unitAmount\n unitAmountCurrency\n }\n productsSummary {\n productName\n totalUnits\n }\n }\n }\n}\n" } }; })(); // prettier-ignore -(node: any).hash = '26006a0434014fd58ad629cda4fdc5ce'; +(node: any).hash = '6aa30f95e3533d8110a8f321ec5104a7'; export default node; diff --git a/src/abacus-backoffice/translations/out/es_MX.json b/src/abacus-backoffice/translations/out/es_MX.json index b6ed55e674..14d0b93c33 100644 --- a/src/abacus-backoffice/translations/out/es_MX.json +++ b/src/abacus-backoffice/translations/out/es_MX.json @@ -13,6 +13,12 @@ "3JkX8r": "Ha ocurrido un error desconocido", "3m81kH": "Login with Google", "eiaXU": "Cerrar sesiĆ³n", + "45KnjW": "Order", + "2ZEsha": "Name of the cat", + "1CTaXS": "Date of castration", + "qb7pS": "Date of last deworming", + "4fmUFn": "Date of adoption", + "13fb44": "List of all our cats", "28BiKm": "Status", "1W8aDx": "Name", "U9uFf": "activo", @@ -46,6 +52,7 @@ "2bLMT1": "Product add-ons", "1drf7n": "Eshop orders", "1RC251": "Empleados", + "4dPJaM": "Our cats", "kNzNr": "Sesiones de TPV", "36grCr": "Analytics: redirects", "3Eos2U": "Status", @@ -128,4 +135,4 @@ "4jOEjB": "All products available across all our services are here.", "TeM0w": "Crear un nuevo producto" } -} \ No newline at end of file +} diff --git a/src/abacus-backoffice/translations/source_strings.json b/src/abacus-backoffice/translations/source_strings.json index d2cf4e4902..179f8f9aad 100644 --- a/src/abacus-backoffice/translations/source_strings.json +++ b/src/abacus-backoffice/translations/source_strings.json @@ -153,6 +153,90 @@ "type": "text", "jsfbt": "Logout" }, + { + "hashToText": { + "s4htMawiaPZXaxWElrK25A==": "Order" + }, + "filepath": "src/cats/CatsPage.js", + "line_beg": 25, + "col_beg": 18, + "line_end": 25, + "col_end": 73, + "desc": "order of the cat (table header)", + "project": "", + "type": "text", + "jsfbt": "Order" + }, + { + "hashToText": { + "TS5eOvI9j7ryhkifltRJwQ==": "Name of the cat" + }, + "filepath": "src/cats/CatsPage.js", + "line_beg": 29, + "col_beg": 18, + "line_end": 29, + "col_end": 82, + "desc": "name of the cat (table header)", + "project": "", + "type": "text", + "jsfbt": "Name of the cat" + }, + { + "hashToText": { + "dnySRGk7SfYD+/xGMik0yg==": "Date of castration" + }, + "filepath": "src/cats/CatsPage.js", + "line_beg": 34, + "col_beg": 12, + "line_end": 36, + "col_end": 18, + "desc": "date when the cat castration was performed (table header)", + "project": "", + "type": "text", + "jsfbt": "Date of castration" + }, + { + "hashToText": { + "0uUQp4khMrJzUvN+BEbRBA==": "Date of last deworming" + }, + "filepath": "src/cats/CatsPage.js", + "line_beg": 42, + "col_beg": 12, + "line_end": 42, + "col_end": 94, + "desc": "date of the last deworming (table header)", + "project": "", + "type": "text", + "jsfbt": "Date of last deworming" + }, + { + "hashToText": { + "BL5tZ7CN41VT6AJQuPPNQw==": "Date of adoption" + }, + "filepath": "src/cats/CatsPage.js", + "line_beg": 47, + "col_beg": 18, + "line_end": 47, + "col_end": 92, + "desc": "date of the cat adoption (table header)", + "project": "", + "type": "text", + "jsfbt": "Date of adoption" + }, + { + "hashToText": { + "TOmKk3DR+VXp59Mr7ax/3A==": "List of all our cats" + }, + "filepath": "src/cats/CatsPageLayout.js", + "line_beg": 13, + "col_beg": 15, + "line_end": 13, + "col_end": 80, + "desc": "list of all our cats title", + "project": "", + "type": "text", + "jsfbt": "List of all our cats" + }, { "hashToText": { "wXxqr4P+NzW6b6NUHmNH/A==": "Status" @@ -396,9 +480,9 @@ "kPOwV1MB9dDJi19OhD0BzA==": "Most sold products" }, "filepath": "src/index/IndexPage.js", - "line_beg": 43, + "line_beg": 42, "col_beg": 10, - "line_end": 43, + "line_end": 42, "col_end": 73, "desc": "most sold products heading", "project": "", @@ -410,9 +494,9 @@ "1Wn4zgyl6icIpNtS9VnEdw==": "Daily reports (last 30 days)" }, "filepath": "src/index/IndexPage.js", - "line_beg": 57, + "line_beg": 56, "col_beg": 10, - "line_end": 57, + "line_end": 56, "col_end": 78, "desc": "daily reports heading", "project": "", @@ -424,9 +508,9 @@ "1TMUbU1qDkIV9x8K1A4k2w==": "Date" }, "filepath": "src/index/IndexPage.js", - "line_beg": 63, + "line_beg": 62, "col_beg": 20, - "line_end": 63, + "line_end": 62, "col_end": 73, "desc": "date of the day (table header)", "project": "", @@ -438,9 +522,9 @@ "+1D7paVJZl2JPO0FT5DJCw==": "Total income per day" }, "filepath": "src/index/IndexPage.js", - "line_beg": 65, + "line_beg": 64, "col_beg": 20, - "line_end": 65, + "line_end": 64, "col_end": 93, "desc": "total icome per day (table header)", "project": "", @@ -452,9 +536,9 @@ "PisqJ55xLTHotmYtdWHpxg==": "Sold products" }, "filepath": "src/index/IndexPage.js", - "line_beg": 70, + "line_beg": 69, "col_beg": 14, - "line_end": 70, + "line_end": 69, "col_end": 96, "desc": "details about sold products per day (table header)", "project": "", @@ -617,12 +701,26 @@ }, { "hashToText": { - "ApP0zU/Dspzx3JgCH6R9Iw==": "POS sessions" + "kTEIDnRDTeVEDtUWiDW4tQ==": "Our cats" }, "filepath": "src/Navigation.js", "line_beg": 44, "col_beg": 8, "line_end": 44, + "col_end": 74, + "desc": "navigation link to the list of our cats", + "project": "", + "type": "text", + "jsfbt": "Our cats" + }, + { + "hashToText": { + "ApP0zU/Dspzx3JgCH6R9Iw==": "POS sessions" + }, + "filepath": "src/Navigation.js", + "line_beg": 47, + "col_beg": 8, + "line_end": 47, "col_end": 81, "desc": "navigation link to point of sales sessions", "project": "", @@ -634,9 +732,9 @@ "dXbjUn5J6dQ6yVdAlIYEXQ==": "Analytics: redirects" }, "filepath": "src/Navigation.js", - "line_beg": 47, + "line_beg": 50, "col_beg": 8, - "line_end": 47, + "line_end": 50, "col_end": 85, "desc": "navigation link to analytics redirects", "project": "", diff --git a/src/abacus-backoffice/translations/src_manifest.json b/src/abacus-backoffice/translations/src_manifest.json index 9e5496430d..b64fdc33f1 100644 --- a/src/abacus-backoffice/translations/src_manifest.json +++ b/src/abacus-backoffice/translations/src_manifest.json @@ -1 +1 @@ -{"translations/enum_manifest.json":["src/analytics/AnalyticsRedirectsPage.js","src/analytics/AnalyticsRedirectsPageLayout.js","src/AuthButtons.js","src/employees/EmployeesPage.js","src/employees/EmployeesPageLayout.js","src/forms/__tests__/FormCheckboxList.test.js","src/forms/__tests__/FormMultiSelect.test.js","src/forms/__tests__/FormMultiUpload.test.js","src/forms/__tests__/FormNumber.test.js","src/forms/__tests__/FormSelect.test.js","src/forms/__tests__/FormText.test.js","src/forms/__tests__/FormTextArea.test.js","src/forms/FormSelect.js","src/forms/FormSubmit.js","src/forms/private/BaseInputWrapper.js","src/forms/private/getValidityStateMessage.js","src/index/IndexPage.js","src/index/IndexPageLayout.js","src/LayoutPage.js","src/LoginPage.js","src/Navigation.js","src/orders/OrdersPageLayout.js","src/pos/CheckoutReceipt.js","src/pos/POSAllSessionsPageLayout.js","src/pos/POSCheckoutFailurePageLayout.js","src/pos/POSCheckoutPageLayout.js","src/pos/POSCheckoutSuccessPageLayout.js","src/pos/ProductsGrid.js","src/pos/ProductsGridModal.js","src/pos/ProductsGridModalBody.js","src/pos/ProductsSelected.js","src/pos/ProductsSelectedRows.js","src/products/ProductAddons.js","src/products/ProductAddonsLayout.js","src/products/ProductCategoriesLayout.js","src/products/ProductCreateForm.js","src/products/ProductEditForm.js","src/products/ProductEditHeading.js","src/products/ProductEditHeadingPublishUnpublish.js","src/products/ProductForm.js","src/products/ProductsCards.js","src/products/ProductsCardsInCategory.js","src/products/ProductsCategories.js","src/products/ProductsCreateLayout.js","src/products/ProductsEditLayout.js","src/products/ProductsPageLayout.js"]} \ No newline at end of file +{"translations/enum_manifest.json":["src/analytics/AnalyticsRedirectsPage.js","src/analytics/AnalyticsRedirectsPageLayout.js","src/AuthButtons.js","src/cats/CatsPage.js","src/cats/CatsPageLayout.js","src/employees/EmployeesPage.js","src/employees/EmployeesPageLayout.js","src/forms/__tests__/FormCheckboxList.test.js","src/forms/__tests__/FormMultiSelect.test.js","src/forms/__tests__/FormMultiUpload.test.js","src/forms/__tests__/FormNumber.test.js","src/forms/__tests__/FormSelect.test.js","src/forms/__tests__/FormText.test.js","src/forms/__tests__/FormTextArea.test.js","src/forms/FormSelect.js","src/forms/FormSubmit.js","src/forms/private/BaseInputWrapper.js","src/forms/private/getValidityStateMessage.js","src/index/IndexPage.js","src/index/IndexPageLayout.js","src/LayoutPage.js","src/LoginPage.js","src/Navigation.js","src/orders/OrdersPageLayout.js","src/pos/CheckoutReceipt.js","src/pos/POSAllSessionsPageLayout.js","src/pos/POSCheckoutFailurePageLayout.js","src/pos/POSCheckoutPageLayout.js","src/pos/POSCheckoutSuccessPageLayout.js","src/pos/ProductsGrid.js","src/pos/ProductsGridModal.js","src/pos/ProductsGridModalBody.js","src/pos/ProductsSelected.js","src/pos/ProductsSelectedRows.js","src/products/ProductAddons.js","src/products/ProductAddonsLayout.js","src/products/ProductCategoriesLayout.js","src/products/ProductCreateForm.js","src/products/ProductEditForm.js","src/products/ProductEditHeading.js","src/products/ProductEditHeadingPublishUnpublish.js","src/products/ProductForm.js","src/products/ProductsCards.js","src/products/ProductsCardsInCategory.js","src/products/ProductsCategories.js","src/products/ProductsCreateLayout.js","src/products/ProductsEditLayout.js","src/products/ProductsPageLayout.js"]}