tree: 73f300077a0a7b1a6fa0be849d251eceaa4d66d6 [path history] [tgz]
  1. config/
  2. src/
  3. .prettierignore
  4. .prettierrc
  5. babel.config.json
  6. package-lock.json
  7. package.json
  8. README.md
security-admin/src/main/webapp/react-webapp/README.md

Ranger React

Building Ranger Admin UI Package

To build the Ranger Admin UI package, run the following Maven command:

mvn clean compile package -DskipTests -DskipJSTests=true

Updating React JS Code to Comply with Checkstyle Requirements

Option 1: Using Visual Studio Code

  1. Install the Prettier - Code Formatter extension from the Visual Studio Code Extensions panel.
  2. Go to Settings > User > Text Editor and set Change Default Formatter to Prettier - Code Formatter.
  3. Set prettier.configPath to the full path of the .prettierrc file in your Ranger project directory. Example:
    /home/user/Workspace/apache/ranger/security-admin/src/main/webapp/react-webapp/.prettierrc
    
  4. Similarly set prettier.ignorePath to the full path of the .prettierignore file to ignore specific files and directories from formatting. Example:
    /home/user/Workspace/apache/ranger/security-admin/src/main/webapp/react-webapp/.prettierignore
    
  5. Enable Format On Save in the editor settings.

Option 2: Using Prettier npm Command

  1. Go to react-webapp directory
    cd security-admin/src/main/webapp/react-webapp
    
  2. Install Prettier
    npm install --save-dev prettier
    
  3. To format a specific file, run:
    npx prettier --write src/App.jsx
    
  4. To format all files in a directory, run:
    npx prettier --write src/
    
  5. After running the command npm install --save-dev prettier and manually formatting the changed files, please ensure that you do not push the package.json and package-lock.json files.