-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from marmelab/openAPI-guessers
Add Guessers based on the OpenAPI Schema
- Loading branch information
Showing
96 changed files
with
3,765 additions
and
5,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { login } from './login'; | ||
|
||
const getPaginationText = () => | ||
cy.findByText(/\d+-\d+ of \d+/, { timeout: 10000 }); | ||
|
||
describe('AdminGuesser', () => { | ||
it('should render one menu item per resource', () => { | ||
cy.visit('/'); | ||
login(); | ||
cy.findByText('Companies').should('exist'); | ||
cy.findByText('Contacts').should('exist'); | ||
cy.findByText('Deals').should('exist'); | ||
cy.findByText('Tags').should('exist'); | ||
cy.findByText('Tasks').should('exist'); | ||
cy.findByText('Dealnotes').should('exist'); | ||
cy.findByText('Contactnotes').should('exist'); | ||
cy.findByText('Sales').should('exist'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,10 @@ | ||
import * as React from 'react'; | ||
import { | ||
Admin, | ||
Resource, | ||
ListGuesser, | ||
defaultTheme, | ||
mergeTranslations, | ||
CustomRoutes, | ||
} from 'react-admin'; | ||
import polyglotI18nProvider from 'ra-i18n-polyglot'; | ||
import englishMessages from 'ra-language-english'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
import { | ||
LoginPage, | ||
raSupabaseEnglishMessages, | ||
SetPasswordPage, | ||
ForgotPasswordPage, | ||
} from 'ra-supabase'; | ||
import { QueryClient } from '@tanstack/react-query'; | ||
import { authProvider } from './authProvider'; | ||
import Layout from './Layout'; | ||
import contacts from './contacts'; | ||
import companies from './companies'; | ||
import deals from './deals'; | ||
import { Dashboard } from './dashboard/Dashboard'; | ||
import { dataProvider } from './dataProvider'; | ||
|
||
const queryClient = new QueryClient(); | ||
const i18nProvider = polyglotI18nProvider(() => { | ||
return mergeTranslations(englishMessages, raSupabaseEnglishMessages); | ||
}, 'en'); | ||
import { AdminGuesser } from 'ra-supabase'; | ||
|
||
const App = () => ( | ||
<BrowserRouter> | ||
<Admin | ||
dataProvider={dataProvider} | ||
authProvider={authProvider} | ||
i18nProvider={i18nProvider} | ||
layout={Layout} | ||
dashboard={Dashboard} | ||
loginPage={LoginPage} | ||
queryClient={queryClient} | ||
theme={{ | ||
...defaultTheme, | ||
palette: { | ||
background: { | ||
default: '#fafafb', | ||
}, | ||
}, | ||
}} | ||
> | ||
<CustomRoutes noLayout> | ||
<Route | ||
path={SetPasswordPage.path} | ||
element={<SetPasswordPage />} | ||
/> | ||
<Route | ||
path={ForgotPasswordPage.path} | ||
element={<ForgotPasswordPage />} | ||
/> | ||
</CustomRoutes> | ||
<Resource name="deals" {...deals} /> | ||
<Resource name="contacts" {...contacts} /> | ||
<Resource name="companies" {...companies} /> | ||
<Resource name="tasks" list={ListGuesser} /> | ||
<Resource | ||
name="sales" | ||
list={ListGuesser} | ||
recordRepresentation={(record: any) => | ||
`${record.first_name} ${record.last_name}` | ||
} | ||
/> | ||
<Resource name="tags" list={ListGuesser} /> | ||
</Admin> | ||
</BrowserRouter> | ||
<AdminGuesser | ||
instanceUrl={import.meta.env.VITE_SUPABASE_URL} | ||
apiKey={import.meta.env.VITE_SUPABASE_ANON_KEY} | ||
/> | ||
); | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.