Skip to content

Commit

Permalink
Add documentation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aneelac22 committed Sep 10, 2024
1 parent 37075cd commit 7ce0f44
Show file tree
Hide file tree
Showing 11 changed files with 10,290 additions and 55 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -342,4 +342,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/go,vim,git,macos,linux,emacs,windows,eclipse,intellij+all,visualstudiocode
# End of https://www.gitignore.io/api/go,vim,git,macos,linux,emacs,windows,eclipse,intellij+all,visualstudiocode

# UI node-modules
node_modules
53 changes: 0 additions & 53 deletions pkg/assets/static/redirectpage.js

This file was deleted.

27 changes: 27 additions & 0 deletions pkg/assets/static/redirectpage/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

The redirectPage.js implements the redirect flow of pages from sandbox developer catalog.

== Test

1. In the assets static folder install node_modules by running
```
npm i
```
2. To run tests, execute
```
npm run test
```

== Implementation guidelines

1. When user clicks on a catalog item on developers.redhat.com it redirects to this url format
`${baseUrl}?link="catalogName"&keyword="keyword"&selectedId="selectedId"`
2. If the user is not authenticated, it redirects to sso page for user to login
3. Once the user is authenticated it redirects to the page user wants to access which is in the format
`${consoleUrl}/${link}/ns/${defaultUserNamespace}?keyword="keyword"&selectedId="selectedId"` with
most of the info coming from `api/v1/signup` and the original url

The below are exceptions to above mentioned redirect Url's format
For `Jupyter Notebooks` the url format is `${consoleUrl}/notebookController/spawner`
For `Red Hat Openshift DevSpaces` the url format is `${consoleUrl}/dashboard/`

3 changes: 3 additions & 0 deletions pkg/assets/static/redirectpage/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['@babel/preset-env'],
};
6 changes: 6 additions & 0 deletions pkg/assets/static/redirectpage/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
testEnvironment: "jsdom",
transform: {
'^.+\\.jsx?$': 'babel-jest',
},
}
Loading

0 comments on commit 7ce0f44

Please sign in to comment.