├── .editorconfig ├── .eslintignore ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── lock.yml ├── .gitignore ├── .ncurc.js ├── .npmignore ├── .npmrc ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE.md ├── README.md ├── babel.config.js ├── docs ├── commands.md ├── configuration.md ├── contribute.md ├── faq.md ├── getting-started.md ├── installation.md ├── introduction.md ├── js │ └── jsdoc.md ├── prerequisite.md ├── release.md └── ui.md ├── internals └── testing │ └── test-bundler.js ├── package.json ├── sonar-project.properties ├── src ├── Admin.js ├── AdminRouter.js ├── index.js └── tests │ ├── Admin.test.js │ ├── AdminRouter.test.js │ └── index.test.js ├── styleguide.config.js └── styleguide ├── jsdoc.sh ├── prepare.sh └── styleguide.ext.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_size = 2 6 | end_of_line = lf 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | lib/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to `react-admin` 2 | 3 | Love react-admin and want to help? Thanks so much, there's something to do for everybody! 4 | 5 | Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved. 6 | 7 | Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features. 8 | 9 | ## Using the issue tracker 10 | 11 | The [issue tracker](https://github.com/bootstrap-styled/react-admin/issues) is 12 | the preferred channel for [bug reports](#bugs), [features requests](#features) 13 | and [submitting pull requests](#pull-requests). 14 | 15 | 16 | ## Bug reports 17 | 18 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 19 | Good bug reports are extremely helpful - thank you! 20 | 21 | Guidelines for bug reports: 22 | 23 | 1. **Use the GitHub issue search** — check if the issue has already been reported. 24 | 25 | 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository. 26 | 27 | 3. **Isolate the problem** — ideally create a reduced test case and a live example. 28 | 29 | A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS 30 | experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs. 31 | 32 | Example: 33 | 34 | > Short and descriptive example bug report title 35 | > 36 | > A summary of the issue and the browser/OS environment in which it occurs. If 37 | > suitable, include the steps required to reproduce the bug. 38 | > 39 | > 1. This is the first step 40 | > 2. This is the second step 41 | > 3. Further steps, etc. 42 | > 43 | > `` - a link to the reduced test case 44 | > 45 | > Any other information you want to share that is relevant to the issue being 46 | > reported. This might include the lines of code that you have identified as 47 | > causing the bug, and potential solutions (and your opinions on their 48 | > merits). 49 | 50 | 51 | 52 | ## Feature requests 53 | 54 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. 55 | 56 | 57 | 58 | ## Pull requests 59 | 60 | Good pull requests - patches, improvements, new features - are a fantastic 61 | help. They should remain focused in scope and avoid containing unrelated 62 | commits. 63 | 64 | **Please ask first** before embarking on any significant pull request (e.g. 65 | implementing features, refactoring code, porting to a different language), 66 | otherwise you risk spending a lot of time working on something that the 67 | project's developers might not want to merge into the project. 68 | 69 | Please adhere to the coding conventions used throughout a project (indentation, 70 | accurate comments, etc.) and any other requirements (such as test coverage). 71 | 72 | Since the `master` branch is what people actually use in production, we have a 73 | `dev` branch that unstable changes get merged into first. Only when we 74 | consider that stable we merge it into the `master` branch and release the 75 | changes for real. 76 | 77 | Adhering to the following process is the best way to get your work 78 | included in the project: 79 | 80 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes: 81 | 82 | ```bash 83 | # Clone your fork of the repo into the current directory 84 | git clone https://github.com//react-admin.git 85 | # Navigate to the newly cloned directory 86 | cd react-admin 87 | # Assign the original repo to a remote called "upstream" 88 | git remote add upstream https://github.com/kopax/react-admin.git 89 | ``` 90 | 91 | 2. If you cloned a while ago, get the latest changes from upstream: 92 | 93 | ```bash 94 | git checkout dev 95 | git pull upstream dev 96 | ``` 97 | 98 | 3. Create a new topic branch (off the `dev` branch) to contain your feature, change, or fix: 99 | 100 | ```bash 101 | git checkout -b 102 | ``` 103 | 104 | 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public. 105 | 106 | 5. Locally merge (or rebase) the upstream dev branch into your topic branch: 107 | 108 | ```bash 109 | git pull [--rebase] upstream dev 110 | ``` 111 | 112 | 6. Push your topic branch up to your fork: 113 | 114 | ```bash 115 | git push origin 116 | ``` 117 | 118 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 119 | with a clear title and description. 120 | 121 | **IMPORTANT**: By submitting a patch, you agree to allow the project 122 | owners to license your work under the terms of the [MIT License](https://github.com/bootstrap-styled/react-admin/blob/master/LICENSE.md). 123 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # react-admin 2 | 3 | Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved. 4 | 5 | **Before opening a new issue, you may find an answer in already closed issues**: 6 | https://github.com/bootstrap-styled/react-admin/issues?q=is%3Aissue+is%3Aclosed 7 | 8 | ## Issue Type 9 | 10 | - [ ] [Bug](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md#bug-reports) 11 | - [ ] [Feature](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md#feature-requests) 12 | 13 | ## Description 14 | 15 | (Add images if possible) 16 | 17 | ## Steps to reproduce 18 | 19 | (Add link to a demo on https://jsfiddle.net or similar if possible) 20 | 21 | # Versions 22 | 23 | - Node/NPM: 24 | - OS: 25 | - react-admin: 26 | 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## react-admin 2 | 3 | Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md) 4 | to make the process easy and effective for everyone involved. 5 | 6 | **Please open an issue** before embarking on any significant pull request, especially those that 7 | add a new library or change existing tests, otherwise you risk spending a lot of time working 8 | on something that might not end up being merged into the project. 9 | 10 | Before opening a pull request, please ensure: 11 | 12 | - [ ] You have followed our [**contributing guidelines**](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md) 13 | - [ ] Double-check your branch is based on `dev` and targets `dev` 14 | - [ ] Your are doing semantic commit message using [commitizen](https://github.com/commitizen/cz-cli) and our [commit message convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) 15 | - [ ] Pull request has tests (we are going for 100% coverage!) 16 | - [ ] Code is well-commented, linted and follows project conventions 17 | - [ ] Documentation is updated (if necessary) 18 | - [ ] Description explains the issue/use-case resolved and auto-closes related issues 19 | 20 | Be kind to code reviewers, please try to keep pull requests as small and focused as possible :) 21 | 22 | **IMPORTANT**: By submitting a patch, you agree to allow the project 23 | owners to license your work under the terms of the [MIT License](https://github.com/bootstrap-styled/react-admin/blob/master/LICENSE.md). 24 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | # Configuration for lock-threads - https://github.com/dessant/lock-threads 2 | 3 | # Number of days of inactivity before a closed issue or pull request is locked 4 | daysUntilLock: 365 5 | 6 | # Skip issues and pull requests created before a given timestamp. Timestamp must 7 | # follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable 8 | skipCreatedBefore: false 9 | 10 | # Issues and pull requests with these labels will not be locked. Set to `[]` to disable 11 | exemptLabels: [] 12 | 13 | # Label to add before locking, such as `outdated`. Set to `false` to disable 14 | lockLabel: false 15 | 16 | # Comment to post before locking. Set to `false` to disable 17 | lockComment: > 18 | This thread has been automatically locked since there has not been 19 | any recent activity after it was closed. Please open a new issue for 20 | related bugs. 21 | 22 | # Assign `resolved` as the reason for locking. Set to `false` to disable 23 | setLockReason: true 24 | 25 | # Limit to only `issues` or `pulls` 26 | # only: issues 27 | 28 | # Optionally, specify configuration settings just for `issues` or `pulls` 29 | # issues: 30 | # exemptLabels: 31 | # - help-wanted 32 | # lockLabel: outdated 33 | 34 | # pulls: 35 | # daysUntilLock: 30 36 | 37 | # Repository to extend settings from 38 | # _extends: repo 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | tmp.json 4 | .DS_Store 5 | bundle-stats.html 6 | .idea/ 7 | coverage/ 8 | /reports 9 | /test-report.xml 10 | jest_0 11 | lib 12 | dist 13 | /public 14 | /docs/cli 15 | /docs/declinations 16 | /docs/translation.md 17 | .git-credentials 18 | package-lock.json 19 | /*.tgz 20 | .iml 21 | -------------------------------------------------------------------------------- /.ncurc.js: -------------------------------------------------------------------------------- 1 | const { createConfig } = require('@rollup-umd/ncu'); 2 | module.exports = createConfig(); 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | tmp.json 4 | .DS_Store 5 | /test-report.xml 6 | /jest_0 7 | .npmrc 8 | .idea 9 | .babelrc 10 | babel.config.js 11 | babel.ext.json 12 | .gitlab-ci.yml 13 | .github 14 | .gitlab 15 | .travis.yml 16 | .eslintignore 17 | .editorconfig 18 | /coverage 19 | /src 20 | /docs 21 | /public 22 | /bundle-stats.html 23 | /CODE_OF_CONDUCT.md 24 | /CONTRIBUTING.md 25 | /CHANGELOG.md 26 | sonar-project.properties 27 | declination.json 28 | rollup.config.js 29 | /styleguide.config.js 30 | /styleguide 31 | /reports 32 | /*.tgz 33 | /lib/**/*.md 34 | internals 35 | **/tests/*.test.js 36 | .ncurc.js 37 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: required 3 | dist: trusty 4 | 5 | # Blocklist 6 | branches: 7 | except: 8 | - gh-pages # will be deployed to, no need to build it 9 | 10 | #cache: 11 | # directories: 12 | # - node_modules 13 | 14 | before_install: 15 | - npm install -g npm 16 | # const 17 | - export PACKAGE_NAME=$(node -p "require('./package.json').name") 18 | - export PACKAGE_VERSION=$(node -p "require('./package.json').version") 19 | - export SONAR_VERSION=${PACKAGE_VERSION}-b${TRAVIS_BUILD_ID}-${TRAVIS_BRANCH} 20 | - export NODE_VERSION=$(node --version) 21 | - export NPM_VERSION=$(npm --version) 22 | 23 | # logging 24 | - npm --version || echo npm not installed 25 | - node --version || echo node not installed 26 | - echo "package version $PACKAGE_VERSION" 27 | 28 | stages: 29 | - build 30 | - test 31 | - release 32 | - deploy 33 | 34 | jobs: 35 | include: 36 | 37 | # Job: Build 38 | - stage: build 39 | node_js: 40 | - 'lts/*' 41 | - '10' 42 | - '8' 43 | script: 44 | - npm run build 45 | # Job: Test 46 | - stage: test 47 | node_js: 48 | - 'lts/*' 49 | - '10' 50 | - '8' 51 | addons: 52 | sonarcloud: 53 | organization: $(echo $TRAVIS_REPO_SLUG | awk -F '/' '{print $1}') 54 | script: 55 | - npm run test 56 | - if [[ "$TRAVIS_BRANCH" != greenkeeper* && -n "$SONAR_TOKEN" ]]; then sonar-scanner -Dsonar.projectVersion=${SONAR_VERSION}; fi 57 | 58 | # Job: Release 59 | - stage: release 60 | if: branch = master AND type = push AND fork = false 61 | node_js: 62 | - 'lts/*' 63 | skip_cleanup: true 64 | script: 65 | - npx semantic-release 66 | 67 | # Job: Page 68 | - stage: deploy 69 | if: branch = master AND type = push AND fork = false 70 | node_js: 71 | - 'lts/*' 72 | script: 73 | - targetVersion=$(git describe --tags `git rev-list --tags --max-count=1`) 74 | - npx @rollup-umd/deploy --target-version "${targetVersion}" 75 | deploy: 76 | - provider: pages 77 | skip_cleanup: true 78 | github_token: $GH_TOKEN # Set in the settings page of your repository, as a secure variable 79 | keep_history: true 80 | local_dir: public/ 81 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.4](https://github.com/bootstrap-styled/react-admin/compare/v1.0.3...v1.0.4) (2019-03-11) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **dependencies:** upgrade all dependencies ([c1ae668](https://github.com/bootstrap-styled/react-admin/commit/c1ae668)) 7 | 8 | ## [1.0.3](https://github.com/bootstrap-styled/react-admin/compare/v1.0.2...v1.0.3) (2019-03-04) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * **dependencies:** upgrade all dependencies ([3cc4118](https://github.com/bootstrap-styled/react-admin/commit/3cc4118)) 14 | 15 | ## [1.0.2](https://github.com/bootstrap-styled/react-admin/compare/v1.0.1...v1.0.2) (2019-02-14) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **doc:** added [@bootstrap-styled](https://github.com/bootstrap-styled)/documentation layout ([c6dcf74](https://github.com/bootstrap-styled/react-admin/commit/c6dcf74)) 21 | 22 | ## [1.0.1](https://github.com/bootstrap-styled/react-admin/compare/v1.0.0...v1.0.1) (2019-02-14) 23 | 24 | 25 | ### Bug Fixes 26 | 27 | * **release:** GitHub release https://github.com/bootstrap-styled/react-admin ([dd49933](https://github.com/bootstrap-styled/react-admin/commit/dd49933)) 28 | 29 | # 1.0.0 (2019-02-14) 30 | 31 | 32 | ### Bug Fixes 33 | 34 | * **dependencies:** Upgrade [@bootstrap-styled](https://module.kopaxgroup.com/bootstrap-styled)/ra-ui to v1.0.13 ([5afee10](https://module.kopaxgroup.com/bootstrap-styled/react-admin/commit/5afee10)) 35 | 36 | 37 | ### Features 38 | 39 | * **Admin:** added Admin and AdminRouter ([12a52c3](https://module.kopaxgroup.com/bootstrap-styled/react-admin/commit/12a52c3)) 40 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | nationality, personal appearance, race, religion, or sexual identity and 10 | orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at contact@yeutech.vn. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at [here][version] 72 | 73 | [homepage]: http://contributor-covenant.org 74 | [version]: http://contributor-covenant.org/version/1/4/ 75 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2019 Yeutech Company Limited 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-admin 2 | 3 | [![Build Status](https://travis-ci.org/bootstrap-styled/react-admin.svg?branch=master)](https://travis-ci.org/bootstrap-styled/react-admin) 4 | [![npm Version](https://img.shields.io/npm/v/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 5 | [![License](https://img.shields.io/npm/l/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 6 | [![NPM monthly downloads](https://img.shields.io/npm/dm/@bootstrap-styled/react-admin.svg?style=flat)](https://npmjs.org/package/@bootstrap-styled/react-admin) 7 | [![NPM total downloads](https://img.shields.io/npm/dt/@bootstrap-styled/react-admin.svg?style=flat)](https://npmjs.org/package/@bootstrap-styled/react-admin) 8 | [![npm Version](https://img.shields.io/node/v/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 9 | [![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 10 | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.bootstrap-styled.react-admin&metric=coverage)](https://sonarcloud.io/dashboard?id=com.github.bootstrap-styled.react-admin) [![Quality gate status](https://sonarcloud.io/api/project_badges/measure?project=com.github.bootstrap-styled.react-admin&metric=alert_status)](https://sonarcloud.io/dashboard?id=com.github.bootstrap-styled.react-admin) 11 | [![gitter](https://badges.gitter.im/bootstrap-styled/bootstrap-styled.svg)](https://gitter.im/bootstrap-styled) 12 | 13 | React Admin component for Bootstrap-Styled. It use UI from @bootstrap-styled/ra-ui 14 | 15 | 16 | ## Table of Contents 17 | 18 | - [Documentation](#documentation) 19 | - [Contributing](#contributing) 20 | - [License MIT](#license-mit) 21 | 22 | --- 23 | 24 | ## Documentation 25 | 26 | Read [react-admin documentation](https://bootstrap-styled.github.io/react-admin). 27 | 28 | 29 | ## Contributing 30 | 31 | If you want to contribute to react-admin please see our [contributing and community guidelines](https://github.com/bootstrap-styled/react-admin/blob/master/.github/CONTRIBUTING.md), they\'ll help you get set up locally and explain the whole process. 32 | 33 | Please also note that all repositories under the bootstrap-styled organization follow our [Code of Conduct](https://github.com/bootstrap-styled/react-admin/blob/master/CODE_OF_CONDUCT.md), make sure to review and follow it. 34 | 35 | ## License MIT 36 | 37 | Copyright 2019 Yeutech Company Limited 38 | 39 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 44 | 45 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const merge = require('babel-merge'); 3 | const ext = `${__dirname}/babel.ext.json`; 4 | 5 | module.exports = merge({ 6 | only: [ 7 | 'src', 8 | 'styleguide', 9 | ], 10 | comments: false, 11 | presets: [ 12 | [ 13 | '@babel/preset-env', 14 | { 15 | modules: false, 16 | }, 17 | ], 18 | '@babel/preset-react', 19 | ], 20 | plugins: [ 21 | 'babel-plugin-array-includes', 22 | 'babel-plugin-inline-react-svg', 23 | '@babel/plugin-transform-runtime', 24 | '@babel/plugin-transform-async-to-generator', 25 | '@babel/plugin-proposal-class-properties', 26 | '@babel/plugin-syntax-dynamic-import', 27 | '@babel/plugin-syntax-import-meta', 28 | '@babel/plugin-proposal-json-strings', 29 | [ 30 | '@babel/plugin-proposal-decorators', 31 | { 32 | legacy: true, 33 | }, 34 | ], 35 | ], 36 | env: { 37 | production: { 38 | plugins: [ 39 | 'babel-plugin-add-module-exports', 40 | '@babel/plugin-transform-modules-commonjs', 41 | ], 42 | }, 43 | test: { 44 | plugins: [ 45 | '@babel/plugin-transform-modules-commonjs', 46 | 'babel-plugin-dynamic-import-node', 47 | ], 48 | }, 49 | }, 50 | }, fs.existsSync(ext) && require(ext)); // eslint-disable-line 51 | -------------------------------------------------------------------------------- /docs/commands.md: -------------------------------------------------------------------------------- 1 | Build project: 2 | 3 | ```bash 4 | $ npm run build 5 | ``` 6 | 7 | Run unit test: 8 | 9 | ```bash 10 | $ npm test 11 | ``` 12 | 13 | Watch unit test: 14 | 15 | ```bash 16 | $ npm run test:watch 17 | ``` 18 | 19 | Build the `/lib` directory: 20 | 21 | ```bash 22 | $ npm run build:lib 23 | ``` 24 | 25 | Build the `/dist` directory: 26 | 27 | ```bash 28 | $ npm run build:dist 29 | ``` 30 | 31 | Build the `/dist` directory "uncompressed": 32 | 33 | ```bash 34 | $ npm run build:dist:dev 35 | ``` 36 | 37 | Watch the `/dist` directory: 38 | 39 | ```bash 40 | $ npm run build:dist:watch 41 | ``` 42 | 43 | Watch the `/lib` directory: 44 | 45 | ```bash 46 | $ npm run build:lib:watch 47 | ``` 48 | 49 | Start a documentation server and watch the `/docs` directory: 50 | 51 | ```bash 52 | $ npm run styleguide 53 | ``` 54 | 55 | Build documentation in `/public` directory: 56 | 57 | ```bash 58 | $ npm run styleguide:build 59 | ``` 60 | 61 | Build the JSdoc documentation 62 | 63 | ```bash 64 | $ npm run jsdoc 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/configuration.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bootstrap-styled/react-admin/2c7aa792c06ac589ea3428c1d9263096ec283593/docs/configuration.md -------------------------------------------------------------------------------- /docs/contribute.md: -------------------------------------------------------------------------------- 1 | We highly encourage contribution, any feature request and merge request will be reviewed. 2 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | - What is rollup-umd ? 2 | 3 | > It is the boilerplate for all JS project aimed to be packaged. 4 | It is made on top of rollup because the distribution can work everywhere. 5 | If you are a contributor, we strongly suggest you to read [rollup-umd documentation](https://dev-tools.yeutech.com/rollup-umd/). 6 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | This package is an adapter for [ra-core](https://www.npmjs.com/package/ra-core) and [@bootstrap-styled/ra-ui](https://www.npmjs.com/package/@bootstrap-styled/ra-ui) 2 | 3 | It produce an equivalent package as [react-admin](https://www.npmjs.com/package/react-admin), except it use Bootstrap Styled by default. 4 | 5 | You must use a `` to edit the `theme`. 6 | 7 | This is how you can do using the prop [`appLayout`](https://marmelab.com/react-admin/Admin.html#applayout) on ``: 8 | 9 | 10 | ```js static 11 | import React from 'react'; 12 | import PropTypes from 'prop-types'; 13 | import Admin from '$PACKAGE_NAME/lib/Admin'; 14 | import DefaultLayout from '@bootstrap-styled/ra-ui/lib/components/layout/Layout'; 15 | import { REDUX_BS_KEY } from '@bootstrap-styled/redux/lib/constants'; 16 | import ConnectedBootstrapProvider from '@bootstrap-styled/redux/lib/ConnectedBootstrapProvider'; 17 | import themeReducer from '@bootstrap-styled/redux/lib/reducer'; 18 | 19 | export class App extends React.Component { 20 | static propTypes = { 21 | appLayout: PropTypes.any, 22 | theme: PropTypes.object, 23 | themes: PropTypes.object, 24 | initialState: PropTypes.object, 25 | customReducers: PropTypes.object, 26 | }; 27 | static defaultProps = { 28 | appLayout: DefaultLayout, 29 | theme: undefined, 30 | themes: undefined, 31 | initialState: undefined, 32 | customReducers: undefined, 33 | }; 34 | 35 | getAppLayout() { 36 | const { appLayout: Layout } = this.props; 37 | return (props) => ( 38 | 42 | 43 | 44 | ); 45 | } 46 | 47 | render() { 48 | const { theme, themes, customReducers, initialState, ...rest } = this.props; 49 | return ( 50 | 56 | ); 57 | } 58 | } 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/installation.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | $ npm install $PACKAGE_NAME --save 3 | ``` 4 | -------------------------------------------------------------------------------- /docs/introduction.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/bootstrap-styled/react-admin.svg?branch=master)](https://travis-ci.org/bootstrap-styled/react-admin) 2 | [![npm Version](https://img.shields.io/npm/v/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 3 | [![License](https://img.shields.io/npm/l/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 4 | [![npm Version](https://img.shields.io/node/v/@bootstrap-styled/react-admin.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 5 | [![Module formats](https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat)](https://www.npmjs.com/package/@bootstrap-styled/react-admin) 6 | [![gitter](https://badges.gitter.im/bootstrap-styled/bootstrap-styled.svg)](https://gitter.im/bootstrap-styled) 7 | 8 | $PACKAGE_DESCRIPTION 9 | -------------------------------------------------------------------------------- /docs/js/jsdoc.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bootstrap-styled/react-admin/2c7aa792c06ac589ea3428c1d9263096ec283593/docs/js/jsdoc.md -------------------------------------------------------------------------------- /docs/prerequisite.md: -------------------------------------------------------------------------------- 1 | If you don't have them, install all the `peerDependencies` in your project: 2 | 3 | ```bash 4 | $ $PACKAGE_PEERS 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/release.md: -------------------------------------------------------------------------------- 1 | Merge `dev` into `master` will release the documentation and tag a new version. 2 | -------------------------------------------------------------------------------- /docs/ui.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bootstrap-styled/react-admin/2c7aa792c06ac589ea3428c1d9263096ec283593/docs/ui.md -------------------------------------------------------------------------------- /internals/testing/test-bundler.js: -------------------------------------------------------------------------------- 1 | require('@babel/polyfill'); 2 | require('es6-promise').polyfill(); 3 | require('@yeutech-lab/test-polyfill').polyfill(); 4 | const Enzyme = require('enzyme'); 5 | const Adapter = require('enzyme-adapter-react-16'); 6 | Enzyme.configure({ adapter: new Adapter() }); 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@bootstrap-styled/react-admin", 3 | "version": "1.0.4", 4 | "description": "React Admin component for Bootstrap-Styled. It use UI from @bootstrap-styled/ra-ui", 5 | "main": "lib/index.js", 6 | "homepage": "https://bootstrap-styled.github.io/react-admin", 7 | "engines": { 8 | "node": ">=8" 9 | }, 10 | "author": "Dimitri Kopriwa (https://github.com/kopax)", 11 | "scripts": { 12 | "prebuild": "npm run build:clean", 13 | "build": "npm run build:lib", 14 | "prebuild:lib": "rimraf lib/*", 15 | "build:lib": "BABEL_ENV=production babel --out-dir lib src --copy-files", 16 | "build:clean": "rimraf lib/*", 17 | "build:readme": "toctoc README.md -w", 18 | "build:lib:watch": "npm run build:lib -- --watch", 19 | "test": "npm run lint && npm run test:web", 20 | "test:web": "NODE_ENV=test jest --coverage", 21 | "test:clean": "rimraf ./coverage", 22 | "test:watch": "npm run test -- --watch", 23 | "lint": "eslint src", 24 | "prepublish": "npm run build", 25 | "lint-staged": "lint-staged", 26 | "jsdoc-documentation": "jsdoc-documentation", 27 | "jsdoc": "jsdoc-documentation --file", 28 | "prestyleguide": "npm run jsdoc", 29 | "styleguide": "styleguidist server", 30 | "prestyleguide:build": "npm run jsdoc", 31 | "styleguide:build": "styleguidist build" 32 | }, 33 | "repository": { 34 | "type": "git", 35 | "url": "https://github.com/bootstrap-styled/react-admin.git" 36 | }, 37 | "bugs": { 38 | "url": "https://github.com/bootstrap-styled/react-admin/issues" 39 | }, 40 | "keywords": [ 41 | "react", 42 | "yeutech.vn", 43 | "react", 44 | "admin", 45 | "ncu", 46 | "@rollup-umd/ncu" 47 | ], 48 | "ncurc": { 49 | "reject": [ 50 | "ra-core" 51 | ] 52 | }, 53 | "license": "MIT", 54 | "eslintConfig": { 55 | "parser": "babel-eslint", 56 | "extends": "airbnb", 57 | "env": { 58 | "browser": true, 59 | "node": true, 60 | "jest": true, 61 | "es6": true 62 | }, 63 | "parserOptions": { 64 | "ecmaVersion": 6, 65 | "sourceType": "module" 66 | }, 67 | "rules": { 68 | "arrow-parens": [ 69 | "error", 70 | "always" 71 | ], 72 | "arrow-body-style": [ 73 | 2, 74 | "as-needed" 75 | ], 76 | "comma-dangle": [ 77 | 2, 78 | "always-multiline" 79 | ], 80 | "import/extensions": [ 81 | "error", 82 | "always", 83 | { 84 | "js": "never", 85 | "mjs": "never" 86 | } 87 | ], 88 | "import/imports-first": 0, 89 | "import/newline-after-import": 0, 90 | "import/no-dynamic-require": 0, 91 | "import/no-extraneous-dependencies": 0, 92 | "import/no-named-as-default": 0, 93 | "import/no-unresolved": 2, 94 | "import/prefer-default-export": 0, 95 | "indent": [ 96 | 2, 97 | 2, 98 | { 99 | "SwitchCase": 1 100 | } 101 | ], 102 | "max-len": 0, 103 | "newline-per-chained-call": 0, 104 | "no-confusing-arrow": 0, 105 | "no-console": 1, 106 | "no-use-before-define": 0, 107 | "prefer-template": 2, 108 | "class-methods-use-this": 0, 109 | "require-yield": 0, 110 | "no-await-in-loop": 0, 111 | "jsx-a11y/aria-props": 2, 112 | "jsx-a11y/heading-has-content": 0, 113 | "jsx-a11y/href-no-hash": "off", 114 | "jsx-a11y/anchor-is-valid": [ 115 | "warn", 116 | { 117 | "aspects": [ 118 | "invalidHref" 119 | ] 120 | } 121 | ], 122 | "jsx-a11y/label-has-for": 2, 123 | "jsx-a11y/mouse-events-have-key-events": 2, 124 | "jsx-a11y/role-has-required-aria-props": 2, 125 | "jsx-a11y/role-supports-aria-props": 2, 126 | "react/forbid-prop-types": 0, 127 | "react/jsx-first-prop-new-line": [ 128 | 2, 129 | "multiline" 130 | ], 131 | "react/jsx-filename-extension": 0, 132 | "react/jsx-no-target-blank": 0, 133 | "react/require-extension": 0, 134 | "react/self-closing-comp": 0 135 | }, 136 | "settings": { 137 | "import/resolver": { 138 | "node": { 139 | "extensions": [ 140 | ".js", 141 | ".mjs" 142 | ] 143 | } 144 | } 145 | }, 146 | "plugins": [ 147 | "react" 148 | ] 149 | }, 150 | "jestSonar": { 151 | "reportPath": "reports", 152 | "reportFile": "test-report.xml", 153 | "indent": 2 154 | }, 155 | "lint-staged": { 156 | "*.js": [ 157 | "eslint --fix", 158 | "git add" 159 | ] 160 | }, 161 | "pre-commit": [ 162 | "build:readme", 163 | "lint-staged" 164 | ], 165 | "devDependencies": { 166 | "@babel/cli": "^7.2.3", 167 | "@babel/core": "^7.3.4", 168 | "@babel/plugin-external-helpers": "^7.2.0", 169 | "@babel/plugin-proposal-class-properties": "^7.3.4", 170 | "@babel/plugin-proposal-decorators": "^7.3.0", 171 | "@babel/plugin-proposal-json-strings": "^7.2.0", 172 | "@babel/plugin-proposal-object-rest-spread": "^7.3.4", 173 | "@babel/plugin-syntax-dynamic-import": "^7.2.0", 174 | "@babel/plugin-syntax-import-meta": "^7.2.0", 175 | "@babel/plugin-transform-async-to-generator": "^7.3.4", 176 | "@babel/plugin-transform-modules-commonjs": "^7.2.0", 177 | "@babel/plugin-transform-react-constant-elements": "^7.2.0", 178 | "@babel/plugin-transform-react-inline-elements": "^7.2.0", 179 | "@babel/plugin-transform-runtime": "^7.3.4", 180 | "@babel/polyfill": "^7.2.5", 181 | "@babel/preset-env": "^7.3.4", 182 | "@babel/preset-react": "^7.0.0", 183 | "@bootstrap-styled/documentation": "^2.0.0", 184 | "@bootstrap-styled/ra-ui": "^1.0.17", 185 | "@rollup-umd/documentation": "^2.0.1", 186 | "@rollup-umd/ncu": "^1.0.8", 187 | "@semantic-release/changelog": "^3.0.2", 188 | "@semantic-release/git": "^7.0.8", 189 | "@semantic-release/github": "^5.2.10", 190 | "@semantic-release/npm": "^5.1.4", 191 | "@yeutech-lab/test-polyfill": "^1.1.5", 192 | "babel-eslint": "^10.0.1", 193 | "babel-jest": "^24.3.1", 194 | "babel-loader": "^8.0.5", 195 | "babel-merge": "^2.0.1", 196 | "babel-plugin-add-module-exports": "^1.0.0", 197 | "babel-plugin-array-includes": "^2.0.3", 198 | "babel-plugin-dynamic-import-node": "^2.2.0", 199 | "babel-plugin-inline-react-svg": "^1.0.1", 200 | "babel-plugin-react-transform": "^3.0.0", 201 | "babel-plugin-transform-react-remove-prop-types": "^0.4.24", 202 | "cz-conventional-changelog": "^2.1.0", 203 | "enzyme": "^3.9.0", 204 | "enzyme-adapter-react-16": "^1.10.0", 205 | "es6-promise": "^4.2.6", 206 | "eslint": "^5.15.1", 207 | "eslint-config-airbnb": "^17.1.0", 208 | "eslint-plugin-import": "^2.16.0", 209 | "eslint-plugin-jsx-a11y": "^6.2.1", 210 | "eslint-plugin-react": "^7.12.4", 211 | "exports-loader": "^0.7.0", 212 | "istanbul-api": "^2.1.1", 213 | "istanbul-reports": "^2.1.1", 214 | "jest-cli": "^24.3.1", 215 | "jest-sonar-reporter": "^2.0.0", 216 | "lint-staged": "^8.1.5", 217 | "pre-commit": "^1.2.2", 218 | "ra-core": "^2.6.4", 219 | "raf": "^3.4.1", 220 | "react": "^16.8.4", 221 | "react-dom": "^16.8.4", 222 | "react-test-renderer": "^16.8.4", 223 | "semantic-release": "^15.13.3", 224 | "toctoc": "^0.3.2", 225 | "webpack": "^4.29.6" 226 | }, 227 | "dependencies": { 228 | "prop-types": "^15.7.2" 229 | }, 230 | "peerDependencies": { 231 | "react": "^16.8.4", 232 | "react-dom": "^16.8.4", 233 | "ra-core": "^2.6.4", 234 | "@bootstrap-styled/ra-ui": "^1.0.17" 235 | }, 236 | "publishConfig": { 237 | "registry": "https://registry.npmjs.org", 238 | "tag": "latest", 239 | "access": "public" 240 | }, 241 | "release": { 242 | "branch": "master", 243 | "npmPublish": true, 244 | "verifyConditions": [ 245 | "@semantic-release/changelog", 246 | "@semantic-release/npm", 247 | "@semantic-release/git", 248 | "@semantic-release/github" 249 | ], 250 | "prepare": [ 251 | "@semantic-release/changelog", 252 | "@semantic-release/npm", 253 | { 254 | "path": "@semantic-release/git", 255 | "assets": [ 256 | "package.json", 257 | "src/**/*.js", 258 | "CHANGELOG.md", 259 | "README.md", 260 | "LICENSE.md" 261 | ] 262 | } 263 | ], 264 | "publish": [ 265 | "@semantic-release/npm", 266 | { 267 | "path": "@semantic-release/github", 268 | "assets": [ 269 | { 270 | "path": "package.json" 271 | }, 272 | { 273 | "path": "LICENSE.md" 274 | }, 275 | { 276 | "path": "CHANGELOG.md" 277 | }, 278 | { 279 | "path": "README.md" 280 | }, 281 | { 282 | "path": "dist/*.esm.js", 283 | "label": "ES module" 284 | }, 285 | { 286 | "path": "dist/*.esm.js.map", 287 | "label": "ES module source map" 288 | }, 289 | { 290 | "path": "dist/*.min.js", 291 | "label": "UMD compressed" 292 | }, 293 | { 294 | "path": "dist/*.min.js.map", 295 | "label": "UMD compressed source map" 296 | }, 297 | { 298 | "path": "dist/*.cjs.min.js", 299 | "label": "CJS compressed" 300 | }, 301 | { 302 | "path": "dist/*.cjs.min.js.map", 303 | "label": "CJS compressed source map" 304 | }, 305 | { 306 | "path": "lib/*.js", 307 | "label": "CJS folder" 308 | } 309 | ] 310 | } 311 | ] 312 | }, 313 | "config": { 314 | "commitizen": { 315 | "path": "./node_modules/cz-conventional-changelog" 316 | } 317 | }, 318 | "greenkeeper": { 319 | "label": "dependency", 320 | "commitMessages": { 321 | "initialBadge": "docs(readme): add Greenkeeper badge", 322 | "initialDependencies": "chore(package): update dependencies", 323 | "initialBranches": "chore(travis): whitelist greenkeeper branches", 324 | "dependencyUpdate": "fix(package): update ${dependency} to version ${version}", 325 | "devDependencyUpdate": "chore(package): update ${dependency} to version ${version}", 326 | "dependencyPin": "fix: pin ${dependency} to ${oldVersion}", 327 | "devDependencyPin": "chore: pin ${dependency} to ${oldVersion}", 328 | "closes": "\n\nCloses #${number}" 329 | } 330 | }, 331 | "jest": { 332 | "testURL": "http://localhost", 333 | "roots": [ 334 | "/src/" 335 | ], 336 | "testPathIgnorePatterns": [ 337 | "/dist/", 338 | "/lib/" 339 | ], 340 | "collectCoverageFrom": [ 341 | "src/**/*.{js,jsx}", 342 | "!src/**/*.test.{js,jsx}" 343 | ], 344 | "transformIgnorePatterns": [ 345 | "/node_modules", 346 | "/internals" 347 | ], 348 | "coverageThreshold": { 349 | "global": { 350 | "statements": 100, 351 | "branches": 100, 352 | "functions": 100, 353 | "lines": 100 354 | } 355 | }, 356 | "moduleDirectories": [ 357 | "node_modules", 358 | "src" 359 | ], 360 | "testRegex": "tests/.*\\.test\\.js$", 361 | "testResultsProcessor": "jest-sonar-reporter", 362 | "setupFilesAfterEnv": [ 363 | "/internals/testing/test-bundler.js" 364 | ], 365 | "setupFiles": [ 366 | "raf/polyfill" 367 | ] 368 | }, 369 | "declinationId": "react", 370 | "contributors": [] 371 | } 372 | -------------------------------------------------------------------------------- /sonar-project.properties: -------------------------------------------------------------------------------- 1 | sonar.testExecutionReportPaths=reports/test-report.xml 2 | sonar.projectKey=com.github.bootstrap-styled.react-admin 3 | sonar.projectName=com.github.bootstrap-styled.react-admin 4 | sonar.sources=src 5 | sonar.exclusions=/src/**/tests/*.test.js 6 | sonar.test.exclusions=/src/**/tests/*.test.js 7 | sonar.dynamicAnalysis=reuseReports 8 | sonar.javascript.jstest.reportsPath=coverage 9 | sonar.javascript.lcov.reportPaths=coverage/lcov.info 10 | sonar.organization=bootstrap-styled 11 | -------------------------------------------------------------------------------- /src/Admin.js: -------------------------------------------------------------------------------- 1 | import CoreAdmin from 'ra-core/lib/CoreAdmin'; 2 | import DefaultLayout from '@bootstrap-styled/ra-ui/lib/components/layout/Layout'; 3 | import Loading from '@bootstrap-styled/ra-ui/lib/components/layout/Loading'; 4 | import NotFound from '@bootstrap-styled/ra-ui/lib/components/layout/NotFound'; 5 | import Login from '@bootstrap-styled/ra-ui/lib/components/auth/Login'; 6 | import Logout from '@bootstrap-styled/ra-ui/lib/components/auth/Logout'; 7 | 8 | const Admin = CoreAdmin; 9 | 10 | Admin.defaultProps = { 11 | appLayout: DefaultLayout, 12 | catchAll: NotFound, 13 | loading: Loading, 14 | loginPage: Login, 15 | logoutButton: Logout, 16 | }; 17 | 18 | export default Admin; 19 | -------------------------------------------------------------------------------- /src/AdminRouter.js: -------------------------------------------------------------------------------- 1 | import CoreAdminRouter from 'ra-core/lib/CoreAdminRouter'; 2 | import Loading from '@bootstrap-styled/ra-ui/lib/components/layout/Loading'; 3 | 4 | const AdminRouter = CoreAdminRouter; 5 | 6 | AdminRouter.defaultProps = { 7 | loading: Loading, 8 | }; 9 | 10 | export default AdminRouter; 11 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Admin from './Admin'; 2 | import AdminRouter from './AdminRouter'; 3 | 4 | export * from 'ra-core'; 5 | export * from '@bootstrap-styled/ra-ui/lib'; 6 | export { Admin, AdminRouter }; 7 | -------------------------------------------------------------------------------- /src/tests/Admin.test.js: -------------------------------------------------------------------------------- 1 | import { shallow } from 'enzyme'; 2 | import React from 'react'; 3 | import Admin from '../Admin'; 4 | 5 | const renderComponent = (props = {}) => shallow(); 6 | 7 | describe('', () => { 8 | it('should render an tag', () => { 9 | const renderedComponent = renderComponent(); 10 | expect(renderedComponent.length).toBe(1); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/tests/AdminRouter.test.js: -------------------------------------------------------------------------------- 1 | import { shallow } from 'enzyme'; 2 | import React from 'react'; 3 | import AdminRouter from '../Admin'; 4 | 5 | const renderComponent = (props = {}) => shallow(); 6 | 7 | describe('', () => { 8 | it('should render an tag', () => { 9 | const renderedComponent = renderComponent(); 10 | expect(renderedComponent.length).toBe(1); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/tests/index.test.js: -------------------------------------------------------------------------------- 1 | const exported = require('../index'); 2 | 3 | describe('exported', () => { 4 | Object.keys(exported).forEach((key) => { 5 | it(`${key} should be exported`, () => { 6 | expect(exported[key]).toBeDefined(); 7 | }); 8 | }); 9 | it('Admin should be exported', () => { 10 | expect(exported.Admin).toBeDefined(); 11 | }); 12 | it('AdminRouter should be exported', () => { 13 | expect(exported.AdminRouter).toBeDefined(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /styleguide.config.js: -------------------------------------------------------------------------------- 1 | const { createConfig } = require('@rollup-umd/documentation'); 2 | module.exports = createConfig(); 3 | -------------------------------------------------------------------------------- /styleguide/jsdoc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | ## Create documentation using JSdoc annotation here 5 | ## Run the command `npm run jsdoc-documentation `, you can generate only 1 markdown file per command but you can use N source using glob pattern. 6 | ## JSdoc function must be annotated @public for being exported in the markdown 7 | 8 | ## 1. Uncomment this line to generate the full docs 9 | #npm run jsdoc-documentation 'src/**/*.js' docs/js/jsdoc.md 10 | ## 2. Add in styleguide/styleguide.ext.json the section { "name": "JSdoc", "content": "docs/js/jsdoc.md" } 11 | 12 | -------------------------------------------------------------------------------- /styleguide/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DECLINATION_ID=$(node -p "require('./package.json').declinationId") 4 | 5 | npx @rollup-umd/documentation-cli variable \ 6 | PACKAGE_NAME=$(node -p "require('./package.json').name") \ 7 | PACKAGE_DESCRIPTION="$(node -p "require('./package.json').description")" \ 8 | PACKAGE_VERSION=$(node -p "require('./package.json').version") \ 9 | PACKAGE_PEERS="$(npx rollup-umd-scripts peer npm-install-cmd)" \ 10 | NODE_VERSION=$(node --version) \ 11 | NPM_VERSION=$(npm --version) \ 12 | CI_REPOSITORY_URL="https://github.com/${TRAVIS_REPO_SLUG}.git" \ 13 | CI_PROJECT_URL="https://github.com/${TRAVIS_REPO_SLUG}" \ 14 | CI_PROJECT_NAMESPACE=$(echo $TRAVIS_REPO_SLUG | awk -F / '{print $1}') \ 15 | CI_PROJECT_NAME=$(echo $TRAVIS_REPO_SLUG | awk -F / '{print $2}') \ 16 | IMG_SHIELD_PUBLISHING=$(npx rollup-umd-scripts publish status --badge) 17 | 18 | if [[ "$DECLINATION_ID" = cli ]]; then 19 | echo "[Documentation] generating CLI documentation" 20 | npx @yeutech-lab/rollup-umd-documentation-cli 21 | fi 22 | -------------------------------------------------------------------------------- /styleguide/styleguide.ext.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": [ 3 | "**/__tests__/**", 4 | "**/*.test.{js,jsx,ts,tsx}", 5 | "**/*.spec.{js,jsx,ts,tsx}", 6 | "**/*.d.ts" 7 | ], 8 | "sections": [ 9 | { 10 | "name": "Introduction", 11 | "content": "docs/introduction.md" 12 | }, 13 | { 14 | "name": "Prerequisite", 15 | "content": "docs/prerequisite.md" 16 | }, 17 | { 18 | "name": "Getting started", 19 | "content": "docs/getting-started.md", 20 | "sections": [ 21 | { 22 | "name": "Installation", 23 | "content": "docs/installation.md" 24 | } 25 | ] 26 | }, 27 | { 28 | "name": "UI Components", 29 | "components": [ 30 | "src/**/[A-Z]*.js", 31 | "src/**/[A-Z]*/index.js" 32 | ] 33 | }, 34 | { 35 | "name": "FAQ", 36 | "content": "docs/faq.md" 37 | }, 38 | { 39 | "name": "Contribute", 40 | "content": "docs/contribute.md", 41 | "sections": [ 42 | { 43 | "name": "Commands", 44 | "content": "docs/commands.md" 45 | }, 46 | { 47 | "name": "Release", 48 | "content": "docs/release.md" 49 | } 50 | ] 51 | }, 52 | { 53 | "name": "Changelog", 54 | "content": "CHANGELOG.md" 55 | }, 56 | { 57 | "name": "Code of conduct", 58 | "content": "CODE_OF_CONDUCT.md" 59 | } 60 | ], 61 | "ribbon": { 62 | "url": "https://github.com/bootstrap-styled/react-admin", 63 | "text": "Fork us on GitHub" 64 | } 65 | } --------------------------------------------------------------------------------