Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update demo #59

Merged
merged 33 commits into from
Jun 28, 2024
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4891a5d
Update demo -> WIP
erwanMarmelab Jun 7, 2024
0a5fcaf
fix seed and schema definition
adguernier Jun 17, 2024
37cd222
fix login process
adguernier Jun 17, 2024
8f98a40
update demo and fix errors
adguernier Jun 20, 2024
5f92ee1
fix postpone task
adguernier Jun 20, 2024
c1462fd
fix dashboard test
adguernier Jun 20, 2024
b346d7f
fix lists test
adguernier Jun 20, 2024
7d8bb02
remove nb_task and nb_notes, fetch in database instead
adguernier Jun 20, 2024
7fe510c
remove useless change
adguernier Jun 24, 2024
36d7435
fix db-seed ts errors
slax57 Jun 28, 2024
809692d
revert loginPage change
slax57 Jun 28, 2024
247a28f
reintroduce fts
slax57 Jun 28, 2024
4acb363
reintroduce changes from #47
slax57 Jun 28, 2024
5c1059e
reintroduce tags@cs
slax57 Jun 28, 2024
2b3fc21
fix at least 1/3rd of companies for Jane Doe
slax57 Jun 28, 2024
1b27d07
fix React 18 syntax
slax57 Jun 28, 2024
3bf02ea
fix import from react-admin instead of ra-core
slax57 Jun 28, 2024
d4881f2
remove console.log
slax57 Jun 28, 2024
f4e8b6f
remove useless update in Note
slax57 Jun 28, 2024
7a90bab
update changelog to mention removal of useRedirectIfAuthenticated
slax57 Jun 28, 2024
b4ffb95
Merge remote-tracking branch 'origin/main' into update-demo
slax57 Jun 28, 2024
e838caf
fix erroneous deprecation warning about faker.random.number
slax57 Jun 28, 2024
1bfa013
fix Jane Doe sales id
slax57 Jun 28, 2024
3e9476a
fix validateDOMNesting in ContactList
slax57 Jun 28, 2024
9f93ad1
fix company selection in contact create
slax57 Jun 28, 2024
da4d01b
fix contact create should set a status
slax57 Jun 28, 2024
ca39b10
fix nb_contacts and nb_deals in company show
slax57 Jun 28, 2024
5b5f7bc
introduce useNbRelations and fix nb_contacts and nb_deals in company …
slax57 Jun 28, 2024
42a82e1
fix unused import in LoginPage
slax57 Jun 28, 2024
0c1f799
fix adding a new deal note throws a dataProvider error
slax57 Jun 28, 2024
019877e
Merge remote-tracking branch 'origin/main' into update-demo
slax57 Jun 28, 2024
56bae46
fix import from react-query
slax57 Jun 28, 2024
c1a124a
fix e2e tests (slow because of the numerous calls to getManyReference)
slax57 Jun 28, 2024
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
Prev Previous commit
fix e2e tests (slow because of the numerous calls to getManyReference)
slax57 committed Jun 28, 2024
commit c1a124ab491ec019a527bcee5348b20001045062
27 changes: 19 additions & 8 deletions cypress/e2e/lists.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { login } from './login';

const getPaginationText = () => cy.findByText(/\d+-\d+ of \d+/);
const getPaginationText = () =>
cy.findByText(/\d+-\d+ of \d+/, { timeout: 10000 });

describe('Lists', () => {
it('should render a list', () => {
@@ -17,7 +18,7 @@ describe('Lists', () => {
getPaginationText().then(el => {
const count = parseInt(el.text().split('of')[1].trim());

cy.findByText('Before last month').click();
cy.findByText('Earlier').click();
// Use should here to allow built-in retry as it may take a few ms for the list to update
getPaginationText().should(el => {
const countFiltered = parseInt(el.text().split('of')[1].trim());
@@ -65,8 +66,6 @@ describe('Lists', () => {
cy.visit('/');
login();
cy.findByText('Contacts').click();
cy.findByRole('button', { name: /rows per page/i }).click();
cy.findByRole('option', { name: '10' }).click();
getPaginationText().then(el => {
const page = parseInt(el.text().split('-')[0].trim());
cy.findByLabelText('Go to page 4').click();
@@ -93,11 +92,23 @@ describe('Lists', () => {
cy.visit('/');
login();
cy.findByText('Contacts').click();
cy.findAllByText(/\d+ days? ago/).should('have.length.greaterThan', 0);
cy.findAllByText(/\d+ years? ago/).should('have.length', 0);
cy.findAllByText(/\d+ days? ago/, { timeout: 10000 }).should(
'have.length.greaterThan',
0
);
cy.findAllByText(/\d+ years? ago/, { timeout: 10000 }).should(
'have.length',
0
);
cy.findByText('Sort by Last seen descending').click();
cy.findByText('Last seen ascending').click();
cy.findAllByText(/\d+ days? ago/).should('have.length', 0);
cy.findAllByText(/\d+ years? ago/).should('have.length.greaterThan', 0);
cy.findAllByText(/\d+ days? ago/, { timeout: 10000 }).should(
'have.length',
0
);
cy.findAllByText(/\d+ years? ago/, { timeout: 10000 }).should(
'have.length.greaterThan',
0
);
});
});
2 changes: 1 addition & 1 deletion packages/demo/src/contacts/ContactList.tsx
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ export const ContactList = () => {
<RaList
actions={<ContactListActions />}
aside={<ContactListFilter />}
perPage={25}
perPage={10}
pagination={<Pagination rowsPerPageOptions={[10, 25, 50, 100]} />}
filterDefaultValues={{ sales_id: identity?.id }}
sort={{ field: 'last_seen', order: 'DESC' }}