Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
29e098e
feat: call helloworld
tevanburen Sep 11, 2025
ba306dd
fix: default java
tlokeshrao Sep 11, 2025
732cadd
Merge branch 'enhance-default' of https://github.com/SEMOSS/Template …
tlokeshrao Sep 11, 2025
622e851
fix: Hello User
tlokeshrao Sep 11, 2025
9433162
style: pre-commit run commit-msg stage hooks
rithvik-doshi Sep 11, 2025
7749233
Merge branch 'enhance-default' of https://github.com/SEMOSS/Template …
rithvik-doshi Sep 11, 2025
b71ff3d
feat: format
tevanburen Sep 11, 2025
35a7062
docs: update readme to add commit msg syntax
rithvik-doshi Sep 11, 2025
5b6ea8e
Merge branch 'enhance-default' of https://github.com/SEMOSS/Template …
rithvik-doshi Sep 11, 2025
8418e32
feat: up
tevanburen Sep 11, 2025
2e83b7e
fix: spelling
tevanburen Sep 11, 2025
5e3f922
docs: precommit
tevanburen Sep 11, 2025
9070c01
refactor(docs/style/chore): some docs fixes and autoupdate
rithvik-doshi Sep 11, 2025
ea2265d
Merge branch 'enhance-default' of github.com:SEMOSS/Template into enh…
tevanburen Sep 11, 2025
e75cb7f
fix: props
tevanburen Sep 11, 2025
66a44f4
Create .env.local
tevanburen Sep 12, 2025
8676d30
Create project.properties
tevanburen Sep 12, 2025
d478f3e
Revert "Create .env.local"
tevanburen Sep 12, 2025
0138442
Revert "Create project.properties"
tevanburen Sep 12, 2025
95425b9
Merge pull request #6 from SEMOSS/enhance-default
tevanburen Sep 12, 2025
e8893f3
Merge branch 'default-app' of github.com:SEMOSS/Template into enhance…
tevanburen Sep 12, 2025
1096c8a
refactor: rename to examples
tevanburen Sep 12, 2025
bf79902
Merge branch 'default-app' of github.com:SEMOSS/Template into enhance…
tevanburen Sep 12, 2025
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
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Run pre-commit hooks for commit-msg stage
pre-commit run --hook-stage commit-msg --commit-msg-filename "$1"
9 changes: 4 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Lint FE code
echo "Formatting and linting FE code"
echo "Formatting and linting FE code..."
pnpm exec lint-staged

# Capture list of staged files
STAGED_FILES=$(git diff --name-only --cached)


# Format BE code
echo "Formatting BE code"
pre-commit run
echo "Formatting BE code..."
pre-commit run --all-files

echo "Committing changes"
# You may want to consider also running `pre-commit autoupdate` periodically to keep hooks updated.
19 changes: 17 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
files: '^java/.*java'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
files: '^(java/.*\.java|py.*\.py)$'
- id: trailing-whitespace
files: '^(java/.*\.java|py.*\.py)$'
- id: mixed-line-ending
args: ['--fix=auto']
files: '^(java/.*\.java|py.*\.py)$'
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-java
args: [--autofix, --google-java-formatter-version=1.28.0]
files: '^java/.*\.java$'
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.10.0
hooks:
- id: commitizen
stages: [commit-msg]
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
language_version: python3
files: '^py.*\.py$'
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ['--profile', 'black']
files: '^py.*\.py$'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ This repository includes several tools to help maintain code quality:
- [ESLint](https://eslint.org/docs/latest/use/core-concepts/): Checks your front-end code for quality and common errors.
- [pre-commit](https://pre-commit.com/): Ensures code formatting and quality checks are run before committing (primarily for back-end code).
- [lint-staged](https://github.com/okonet/lint-staged): Runs Prettier and ESLint on staged files before each commit to prevent bad code from being pushed.
- Note: if you are a Mac user, and your commits are erroring out with the message `" not foundECURSIVE_EXEC_FIRST_FAIL  Command "lint-staged`, then you likely need to change your line-endings in `./husky/pre-commit` and `./husky/commit-msg` from CRLF to LF.
- [commitizen](https://www.conventionalcommits.org/en/v1.0.0/): This pre-commit hook uses conventional commit syntax. Check this link out to understand how to format your commit messages. Here are some common examples:
- `feat: Major feature added`
- `docs: Documentation changed/updated`
- `fix: Bug fixed and code restored to working state`
- `refactor(style): Changed some code around to adhere to better style`
- `chore: Some update/chore that you've been needing to do`

---

Expand Down
30 changes: 29 additions & 1 deletion client/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
import { useLoadingPixel } from '@/hooks';
import { Stack, Typography } from '@mui/material';

/**
* Renders the home page.
*
* @component
*/
export const HomePage = () => {
return <div>Home page</div>;
const [data, isLoading] = useLoadingPixel<string>('HelloUser()');

return (
<Stack spacing={2}>
<Typography variant="h4">Home page</Typography>
<Typography>
Welcome to the SEMOSS Template application! This repository is
meant to be a starting point for your own SEMOSS application.
</Typography>
<Typography variant="h6">Example pixel call:</Typography>
<ul>
<li>
<Typography variant="body1" fontWeight="bold">
HelloUser()
</Typography>
<ul>
<li>
<Typography fontStyle="italic">
{isLoading ? 'Loading...' : data}
</Typography>
</li>
</ul>
</li>
</ul>
</Stack>
);
};
19 changes: 0 additions & 19 deletions java/src/reactors/HelloWorldReactor.java

This file was deleted.

35 changes: 35 additions & 0 deletions java/src/reactors/examples/HelloUserReactor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package reactors.example;

import prerna.sablecc2.om.PixelDataType;
import prerna.sablecc2.om.ReactorKeysEnum;
import prerna.sablecc2.om.nounmeta.NounMetadata;
import reactors.AbstractProjectReactor;

public class HelloUserReactor extends AbstractProjectReactor {

// Note: Has access to protected variables defined in AbstractProjectReactor

public HelloUserReactor() {

// list of keys the reactor is expecting
this.keysToGet = new String[] {ReactorKeysEnum.NAME.getKey()};

// 1 for required keys, 0 for optional
this.keyRequired = new int[] {0};
}

@Override
protected NounMetadata doExecute() {

// returns null if the argument is not found
String name = this.keyValue.get(ReactorKeysEnum.NAME.getKey());

// if name is not provided, use the user's name
name = (name == null) ? user.getPrimaryLoginToken().getName() : name;

// grabbing user from AbstractProjectReactor
String response = "Hello, " + name + "! Welcome to SEMOSS.";

return new NounMetadata(response, PixelDataType.CONST_STRING);
}
}
2 changes: 0 additions & 2 deletions java/src/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ public class Constants {

// TODO add any constants to be referenced in the project

public static final String HELLO_WORLD = "Hello World!";

public static final String ANIMAL_ID = "animalId";
public static final String ANIMAL_NAME = "animalName";
public static final String ANIMAL_TYPE = "animalType";
Expand Down
4 changes: 1 addition & 3 deletions java/src/util/ProjectProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ private static void loadProp(String projectId) {
try (final FileInputStream fileIn =
new FileInputStream(
Utility.normalizePath(
AssetUtility.getProjectAssetsFolder(projectId)
+ "/java/examples/project.properties"))) { // using properties file in examples
// folder
AssetUtility.getProjectAssetsFolder(projectId) + "/java/project.properties"))) {
Properties projectProperties = new Properties();
projectProperties.load(fileIn);

Expand Down