From 29e098ec15303f882d16a6420d3fb4b01d2b463a Mon Sep 17 00:00:00 2001 From: Van Buren Date: Thu, 11 Sep 2025 11:41:23 -0400 Subject: [PATCH 01/14] feat: call helloworld --- client/src/pages/HomePage.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx index bd6f329..e71f55d 100644 --- a/client/src/pages/HomePage.tsx +++ b/client/src/pages/HomePage.tsx @@ -1,8 +1,23 @@ +import { useLoadingPixel } from '@/hooks'; +import { Stack, Typography } from '@mui/material'; + /** * Renders the home page. * * @component */ export const HomePage = () => { - return
Home page
; + const [data, isLoading] = useLoadingPixel('HelloWorld()'); + + return ( + + Home page + + Welcome to the SEMOSS Template application! This is a starting + point for building your own SEMOSS application. + + Example of a pixel call: + {isLoading ? 'Loading...' : data} + + ); }; From ba306dda8afb0e3cb0d0241e84787d209060cbcc Mon Sep 17 00:00:00 2001 From: Tejas Lokeshrao Date: Thu, 11 Sep 2025 14:10:47 -0400 Subject: [PATCH 02/14] fix: default java --- java/src/reactors/HelloWorldReactor.java | 19 ------------ java/src/reactors/example/RepeatReactor.java | 32 ++++++++++++++++++++ java/src/util/Constants.java | 1 - java/src/util/HelperMethods.java | 9 +----- 4 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 java/src/reactors/HelloWorldReactor.java create mode 100644 java/src/reactors/example/RepeatReactor.java diff --git a/java/src/reactors/HelloWorldReactor.java b/java/src/reactors/HelloWorldReactor.java deleted file mode 100644 index f7c73ef..0000000 --- a/java/src/reactors/HelloWorldReactor.java +++ /dev/null @@ -1,19 +0,0 @@ -package reactors; - -import prerna.sablecc2.om.PixelDataType; -import prerna.sablecc2.om.nounmeta.NounMetadata; -import util.Constants; - -public class HelloWorldReactor extends AbstractProjectReactor { - - // Note: Has access to protected variables defined in AbstractProjectReactor - - @Override - protected NounMetadata doExecute() { - - // grabbing user from AbstractProjectReactor - String response = Constants.HELLO_WORLD + " " + user.getPrimaryLoginToken().getId(); - - return new NounMetadata(response, PixelDataType.CONST_STRING); - } -} diff --git a/java/src/reactors/example/RepeatReactor.java b/java/src/reactors/example/RepeatReactor.java new file mode 100644 index 0000000..9b450e5 --- /dev/null +++ b/java/src/reactors/example/RepeatReactor.java @@ -0,0 +1,32 @@ +package reactors.example; + +import prerna.sablecc2.om.PixelDataType; +import prerna.sablecc2.om.ReactorKeysEnum; +import prerna.sablecc2.om.nounmeta.NounMetadata; +import reactors.AbstractProjectReactor; + +public class RepeatReactor extends AbstractProjectReactor { + + // Note: Has access to protected variables defined in AbstractProjectReactor + + public RepeatReactor() { + + // list of keys the reactor is expecting + this.keysToGet = new String[] {ReactorKeysEnum.COMMAND.getKey()}; + + // 1 for required keys, 0 for optional + this.keyRequired = new int[] {1}; + } + + @Override + protected NounMetadata doExecute() { + + // returns null if the argument is not found + String inputString = this.keyValue.get(ReactorKeysEnum.COMMAND.getKey()); + + // grabbing user from AbstractProjectReactor + String response = user.getPrimaryLoginToken().getId() + ": " + inputString; + + return new NounMetadata(response, PixelDataType.CONST_STRING); + } +} diff --git a/java/src/util/Constants.java b/java/src/util/Constants.java index 3e4a686..28656af 100644 --- a/java/src/util/Constants.java +++ b/java/src/util/Constants.java @@ -4,5 +4,4 @@ public class Constants { // TODO add any constants to be referenced in the project - public static final String HELLO_WORLD = "Hello World!"; } diff --git a/java/src/util/HelperMethods.java b/java/src/util/HelperMethods.java index b24968e..54954b0 100644 --- a/java/src/util/HelperMethods.java +++ b/java/src/util/HelperMethods.java @@ -1,10 +1,3 @@ package util; -import prerna.auth.User; - -public class HelperMethods { - - public static String getUserId(User user) { - return user.getPrimaryLoginToken().getId(); - } -} +public class HelperMethods {} From 622e851f17e1fde60f2e790a713aab9ecdfc7784 Mon Sep 17 00:00:00 2001 From: Tejas Lokeshrao Date: Thu, 11 Sep 2025 15:04:50 -0400 Subject: [PATCH 03/14] fix: Hello User --- client/src/pages/HomePage.tsx | 4 ++-- .../{RepeatReactor.java => HelloUserReactor.java} | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) rename java/src/reactors/example/{RepeatReactor.java => HelloUserReactor.java} (56%) diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx index e71f55d..2245a57 100644 --- a/client/src/pages/HomePage.tsx +++ b/client/src/pages/HomePage.tsx @@ -7,7 +7,7 @@ import { Stack, Typography } from '@mui/material'; * @component */ export const HomePage = () => { - const [data, isLoading] = useLoadingPixel('HelloWorld()'); + const [data, isLoading] = useLoadingPixel('HelloUser()'); return ( @@ -16,7 +16,7 @@ export const HomePage = () => { Welcome to the SEMOSS Template application! This is a starting point for building your own SEMOSS application. - Example of a pixel call: + Example of a pixel call: HelloUser() {isLoading ? 'Loading...' : data} ); diff --git a/java/src/reactors/example/RepeatReactor.java b/java/src/reactors/example/HelloUserReactor.java similarity index 56% rename from java/src/reactors/example/RepeatReactor.java rename to java/src/reactors/example/HelloUserReactor.java index 9b450e5..96ef6e1 100644 --- a/java/src/reactors/example/RepeatReactor.java +++ b/java/src/reactors/example/HelloUserReactor.java @@ -5,27 +5,30 @@ import prerna.sablecc2.om.nounmeta.NounMetadata; import reactors.AbstractProjectReactor; -public class RepeatReactor extends AbstractProjectReactor { +public class HelloUserReactor extends AbstractProjectReactor { // Note: Has access to protected variables defined in AbstractProjectReactor - public RepeatReactor() { + public HelloUserReactor() { // list of keys the reactor is expecting - this.keysToGet = new String[] {ReactorKeysEnum.COMMAND.getKey()}; + this.keysToGet = new String[] {ReactorKeysEnum.NAME.getKey()}; // 1 for required keys, 0 for optional - this.keyRequired = new int[] {1}; + this.keyRequired = new int[] {0}; } @Override protected NounMetadata doExecute() { // returns null if the argument is not found - String inputString = this.keyValue.get(ReactorKeysEnum.COMMAND.getKey()); + 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 = user.getPrimaryLoginToken().getId() + ": " + inputString; + String response = "Hello " + name + "! Welcome to SEMOSS."; return new NounMetadata(response, PixelDataType.CONST_STRING); } From 94331628f2ae8459c596279df4210a7b41182aac Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Thu, 11 Sep 2025 15:23:10 -0400 Subject: [PATCH 04/14] style: pre-commit run commit-msg stage hooks --- .husky/commit-msg | 2 ++ .husky/pre-commit | 2 +- .pre-commit-config.yaml | 19 +++++++++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..6e3c7d8 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,2 @@ +# Run pre-commit hooks for commit-msg stage +pre-commit run --hook-stage commit-msg --commit-msg-filename "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index 7f1e6bd..27c909f 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -8,6 +8,6 @@ STAGED_FILES=$(git diff --name-only --cached) # Format BE code echo "Formatting BE code" -pre-commit run +pre-commit run --all-files echo "Committing changes" \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 38c8d6c..7db8a69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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$' From b71ff3dc3a2f57530073fdb9934158de15262aa1 Mon Sep 17 00:00:00 2001 From: Van Buren Date: Thu, 11 Sep 2025 15:33:27 -0400 Subject: [PATCH 05/14] feat: format --- client/src/pages/HomePage.tsx | 21 +++++++++++++++---- .../reactors/example/HelloUserReactor.java | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx index 2245a57..d9301cc 100644 --- a/client/src/pages/HomePage.tsx +++ b/client/src/pages/HomePage.tsx @@ -13,11 +13,24 @@ export const HomePage = () => { Home page - Welcome to the SEMOSS Template application! This is a starting - point for building your own SEMOSS application. + Welcome to the SEMOSS Template application! This repository is + meant to be a starting point for your own SEMOSS application. - Example of a pixel call: HelloUser() - {isLoading ? 'Loading...' : data} + Example pixel call: +
    +
  • + + HelloUser() + +
      +
    • + + {isLoading ? 'Loading...' : data} + +
    • +
    +
  • +
); }; diff --git a/java/src/reactors/example/HelloUserReactor.java b/java/src/reactors/example/HelloUserReactor.java index 96ef6e1..5822d1b 100644 --- a/java/src/reactors/example/HelloUserReactor.java +++ b/java/src/reactors/example/HelloUserReactor.java @@ -28,7 +28,7 @@ protected NounMetadata doExecute() { name = (name == null) ? user.getPrimaryLoginToken().getName() : name; // grabbing user from AbstractProjectReactor - String response = "Hello " + name + "! Welcome to SEMOSS."; + String response = "Hello, " + name + "! Welcome to SEMOSS."; return new NounMetadata(response, PixelDataType.CONST_STRING); } From 35a7062e468df340cb13b94750d882debb8cf6c8 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Thu, 11 Sep 2025 15:36:23 -0400 Subject: [PATCH 06/14] docs: update readme to add commit msg syntax --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7810ea2..46eb9d8 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ 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. +- [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. --- From 8418e326f48be8a95f479e56ca3338bdc057720a Mon Sep 17 00:00:00 2001 From: Van Buren Date: Thu, 11 Sep 2025 15:42:35 -0400 Subject: [PATCH 07/14] feat: up --- .pre-commit-config.yaml | 2 +- client/src/components/base/MainNavigation.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7db8a69..ea253cf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,5 +31,5 @@ repos: rev: 5.12.0 hooks: - id: isort - args: ["--profile", "black"] + args: ['--profile', 'black'] files: '^py.*\.py$' diff --git a/client/src/components/base/MainNavigation.tsx b/client/src/components/base/MainNavigation.tsx index 515e4da..dac89ce 100644 --- a/client/src/components/base/MainNavigation.tsx +++ b/client/src/components/base/MainNavigation.tsx @@ -79,7 +79,7 @@ export const MainNavigation = () => { fontWeight="bold" whiteSpace="nowrap" > - SEMOSS Template + SEMOSS Templatey From 2e83b7e303151cbc6599fe06145631a7f6e4d656 Mon Sep 17 00:00:00 2001 From: Van Buren Date: Thu, 11 Sep 2025 15:43:21 -0400 Subject: [PATCH 08/14] fix: spelling --- client/src/components/base/MainNavigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/base/MainNavigation.tsx b/client/src/components/base/MainNavigation.tsx index dac89ce..515e4da 100644 --- a/client/src/components/base/MainNavigation.tsx +++ b/client/src/components/base/MainNavigation.tsx @@ -79,7 +79,7 @@ export const MainNavigation = () => { fontWeight="bold" whiteSpace="nowrap" > - SEMOSS Templatey + SEMOSS Template From 5e3f9227f68cb2288c8c369169cc1529cdd49645 Mon Sep 17 00:00:00 2001 From: Van Buren Date: Thu, 11 Sep 2025 15:47:07 -0400 Subject: [PATCH 09/14] docs: precommit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 46eb9d8..8fcdadb 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ 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. --- From 9070c0168203541ef5053c8c15ddc29bab9eea33 Mon Sep 17 00:00:00 2001 From: Rithvik Doshi Date: Thu, 11 Sep 2025 15:52:51 -0400 Subject: [PATCH 10/14] refactor(docs/style/chore): some docs fixes and autoupdate --- .husky/pre-commit | 7 +++---- README.md | 7 ++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 27c909f..d8f48dd 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -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" +echo "Formatting BE code..." pre-commit run --all-files -echo "Committing changes" \ No newline at end of file +# You may want to consider also running `pre-commit autoupdate` periodically to keep hooks updated. \ No newline at end of file diff --git a/README.md b/README.md index 8fcdadb..bee60f6 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,12 @@ This repository includes several tools to help maintain code quality: - [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. +- [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` --- From 66a44f4ef782370d7de56c07a256cb7a1f7107c4 Mon Sep 17 00:00:00 2001 From: Thomas Van Buren Date: Fri, 12 Sep 2025 10:31:05 -0400 Subject: [PATCH 11/14] Create .env.local --- client/.env.local | 1 + 1 file changed, 1 insertion(+) create mode 100644 client/.env.local diff --git a/client/.env.local b/client/.env.local new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/.env.local @@ -0,0 +1 @@ + From 8676d301cd728f1ee9f2773c117496c4f0f9d9fd Mon Sep 17 00:00:00 2001 From: Thomas Van Buren Date: Fri, 12 Sep 2025 10:32:20 -0400 Subject: [PATCH 12/14] Create project.properties --- java/project.properties | 1 + 1 file changed, 1 insertion(+) create mode 100644 java/project.properties diff --git a/java/project.properties b/java/project.properties new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/java/project.properties @@ -0,0 +1 @@ + From d478f3e478b3c276a6c1298ea81ce153351922b4 Mon Sep 17 00:00:00 2001 From: Van Buren Date: Fri, 12 Sep 2025 15:18:14 -0400 Subject: [PATCH 13/14] Revert "Create .env.local" This reverts commit 66a44f4ef782370d7de56c07a256cb7a1f7107c4. --- client/.env.local | 1 - 1 file changed, 1 deletion(-) delete mode 100644 client/.env.local diff --git a/client/.env.local b/client/.env.local deleted file mode 100644 index 8b13789..0000000 --- a/client/.env.local +++ /dev/null @@ -1 +0,0 @@ - From 0138442c69c734fbed1662bd150b15f858af76cf Mon Sep 17 00:00:00 2001 From: Van Buren Date: Fri, 12 Sep 2025 15:18:24 -0400 Subject: [PATCH 14/14] Revert "Create project.properties" This reverts commit 8676d301cd728f1ee9f2773c117496c4f0f9d9fd. --- java/project.properties | 1 - 1 file changed, 1 deletion(-) delete mode 100644 java/project.properties diff --git a/java/project.properties b/java/project.properties deleted file mode 100644 index 8b13789..0000000 --- a/java/project.properties +++ /dev/null @@ -1 +0,0 @@ -