Skip to content

Feature/sn auth package extraimprovements #1643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 65 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
17dd6c8
feat: sn-auth package
hashtagnulla Sep 6, 2024
8a2b4e8
updated sn-auth-react with api calls and refactored token refreshing
hashtagnulla Sep 23, 2024
c803121
moving react dependency to peer dependencies
hashtagnulla Sep 25, 2024
765752d
moving react dependency to peer dependencies
hashtagnulla Sep 25, 2024
4cc5bb3
fix: refresh token
hashtagnulla Oct 7, 2024
b59e888
raised version number
hashtagnulla Oct 7, 2024
25313b0
bumped version number
hashtagnulla Oct 7, 2024
b1bfc44
fix: blank screen on content actions
hashtagnulla Oct 17, 2024
a90333b
Fix UI elements and file download
marosvolgyiz Dec 5, 2024
70daded
Add ui fixe
marosvolgyiz Dec 9, 2024
3f6a251
Fix: ActionButtonWrapper CSS
marosvolgyiz Dec 10, 2024
fe6301f
admin ui extra improvements
marosvolgyiz Feb 7, 2025
88685e2
admin ui extra imp. #2
marosvolgyiz Feb 7, 2025
df7b986
add fixes
marosvolgyiz Feb 7, 2025
e202b48
Fix import
marosvolgyiz Feb 7, 2025
724a2f4
Remove junks
marosvolgyiz Feb 7, 2025
55a284c
Fix old functions
marosvolgyiz Feb 7, 2025
4d89609
fix odataparams
marosvolgyiz Feb 7, 2025
6a1a0bf
Add selectionService to Grid
marosvolgyiz Feb 7, 2025
b20af03
Add pipe to gitignore
marosvolgyiz Feb 7, 2025
cccc9d9
fixes
marosvolgyiz Feb 13, 2025
d6e961d
fix tree
marosvolgyiz Feb 13, 2025
7dd501d
fixed locked cell in the grid
marosvolgyiz Feb 13, 2025
c3c9bac
fixes
marosvolgyiz Feb 13, 2025
6440999
fix height to 25px
marosvolgyiz Feb 13, 2025
ac3162a
Design improvements
marosvolgyiz Feb 13, 2025
9682b56
add build time auth switch
VargaJoe Apr 29, 2025
1bb9126
keler to snauth and eslint fixes
NoelKova Apr 30, 2025
4eabbb8
remove console logs
NoelKova May 5, 2025
d9c58ba
grid selection filtered only
NoelKova May 5, 2025
70ed295
update deprecated varsions
NoelKova May 5, 2025
6516c53
update eslint-plugin-jsdoc
NoelKova May 5, 2025
f83950b
downgrade eslint-plugin-jsdoc
NoelKova May 5, 2025
255bf9a
remove examples build from ci.yml
NoelKova May 5, 2025
b67fefc
put back examples build
NoelKova May 5, 2025
44c2709
yml edits
NoelKova May 5, 2025
53e3936
comment test
NoelKova May 5, 2025
3a22ab4
revert yml changes
NoelKova May 5, 2025
e34355a
copy ymls from develop
NoelKova May 5, 2025
20c4c3a
Merge pull request #1641 from SenseNet/feature/sn-client-refactor
NoelKova May 5, 2025
32332e3
login with both auth type at the same time
NoelKova May 8, 2025
bc2e5a2
Merge branch 'feature/sn-auth-package-extraimprovements-isswitch' int…
NoelKova May 8, 2025
32089b6
Merge branch 'develop' into feature/sn-auth-package-extraimprovements
NoelKova May 8, 2025
21a6b1b
add missing file
NoelKova May 9, 2025
bfba6c6
remove storybook build
NoelKova May 12, 2025
1974e68
remove storybook build
NoelKova May 12, 2025
5f95881
ci on PR
NoelKova May 12, 2025
bacc399
yml version
NoelKova May 12, 2025
0593e9e
remove ci on pull request
NoelKova May 12, 2025
33c0835
remove exmaples build
NoelKova May 12, 2025
86395f1
remove tests
NoelKova May 12, 2025
8c31749
lint fixes
NoelKova May 12, 2025
5713c12
minor lint fix
NoelKova May 12, 2025
978d875
empty saved queries fix
NoelKova May 14, 2025
60171ff
content explorer tree disabled fix
NoelKova May 14, 2025
ddcd6b6
copy dialog height fix
NoelKova May 14, 2025
6090809
edit view design
NoelKova May 21, 2025
0555227
edit view design 2
NoelKova May 21, 2025
47d4cb2
reference picker
NoelKova May 21, 2025
7d379d2
copy move dialog
NoelKova May 21, 2025
24acb2c
reference picker height fix
NoelKova May 21, 2025
7e8e48e
insert file into tinyMCE start
NoelKova May 21, 2025
846a652
Revert "insert file into tinyMCE start"
NoelKova May 26, 2025
3d2dfce
input updates
NoelKova May 26, 2025
bc8d3dc
auth redirect on logout fix
NoelKova May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react', 'cypress', 'jsdoc', 'import', 'react-hooks'],
env: { browser: true, node: true, es6: true, jest: true, 'cypress/globals': true },
env: { browser: true, node: true, es6: true, 'cypress/globals': true },
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
Expand All @@ -36,6 +36,9 @@ module.exports = {
},
rules: {
'react/prop-types': 0,
'no-unused-vars': 'off',
'import/export': 0,
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
Expand All @@ -45,6 +48,7 @@ module.exports = {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }],
'require-jsdoc': 1,
'cypress/unsafe-to-chain-command': 'off',
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'import/default': 0,
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache
- uses: actions/cache@v4
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -46,15 +46,9 @@ jobs:
- name: build
run: yarn build

- name: build examples
run: yarn build:examples

- name: build snapp
run: yarn snapp build
env:
RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }}

- name: test
run: NODE_OPTIONS='--max-old-space-size=4096' yarn test --coverage --logHeapUsage

- uses: codecov/codecov-action@v1
34 changes: 1 addition & 33 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v4 # Updated from v1 to v4
- uses: actions/cache@v4
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand Down Expand Up @@ -36,35 +36,3 @@ jobs:
env:
NETLIFY_SITE_ID: 94fb346c-b540-40f7-aaaf-21eee2a9c891
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

deploy-storybook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v4 # Updated from v1 to v4
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: install
run: yarn install
env:
CYPRESS_INSTALL_BINARY: 0

- name: build
run: yarn build

- name: build storybook
run: yarn storybook build-storybook

- name: wake up deploy notifier
run: yarn wait-on https://sensenet-sn-deploy-notifier.glitch.me/ -l -t 300000 -i 10000

- name: Publish
run: npx [email protected] deploy --dir=./examples/sn-react-component-docs/storybook-static --message ${{ github.event.pull_request.number }}
env:
NETLIFY_SITE_ID: 1747b330-27d8-4ddd-bf74-39469c257010
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ jspm_packages/

# Misc
.DS_Store
pipe\[0]
64 changes: 64 additions & 0 deletions apps/sensenet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,67 @@ If you start typing a Content query term (that starts with a '+' sign), the term
## ℹ Version info

(Coming soon...)

# sensenet Admin UI

React-based UI for sensenet. This application provides a rich UI for managing your sensenet content repository. It was designed to take advantage of the modern web technologies - which means we built it for evergreen browsers (Edge, Chrome, Firefox). If you need legacy browser support (e.g. IE11) please use the [old admin UI](https://github.com/SenseNet/sensenet/tree/master/src/nuget/snadmin/install-webpages) instead.

## Authentication Configuration

The application supports two authentication methods:

- **SNAuth**: sensenet's JWT-based authentication
- **IdentityServer**: OIDC-based authentication with Identity Server

You can specify which authentication method to use during the build process. This is a build-time configuration, meaning the application will be built to use only one authentication method.

### Building with specific authentication method

To build the application with SNAuth (default):

```bash
yarn build:snauth
# or npm run build:snauth
```

To build the application with Identity Server authentication:

```bash
yarn build:idserver
# or npm run build:idserver
```

### Development with specific authentication method

To run the development server with SNAuth:

```bash
yarn start:snauth
# or npm run start:snauth
```

To run the development server with Identity Server authentication:

```bash
yarn start:idserver
# or npm run start:idserver
```

If you don't specify an authentication method, the application will default to using SNAuth.

## Development

To run the application locally:

```bash
yarn install
yarn start
```

Navigate to http://localhost:8080 in your browser.

To build the application:

```bash
yarn build
```
77 changes: 40 additions & 37 deletions apps/sensenet/index.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, height=device-height, minimum-scale=1.0, initial-scale=1.0, user-scalable=0" />
<meta name="description" content="sensenet application" />
<title>sensenet</title>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
/* width */
::-webkit-scrollbar {
width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
background: rgba(128, 128, 128, 0.3);
}
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, height=device-height, minimum-scale=1.0, initial-scale=1.0, user-scalable=0" />
<meta name="description" content="sensenet application" />
<title>sensenet</title>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
}
/* width */
::-webkit-scrollbar {
width: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" />
</head>
<body>
<div id="root" style="height: inherit"></div>
</body>
</html>
/* Track */
::-webkit-scrollbar-track {
background: rgba(128, 128, 128, 0.3);
}

/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" />
</head>

<body>
<div id="root" style="height: inherit"></div>
</body>

</html>
11 changes: 11 additions & 0 deletions apps/sensenet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"fix:prettier": "prettier \"{,!(dist|temp|bundle)/**/}*.{ts,tsx}\" --write",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config webpack.prod.js",
"build:stats": "webpack --config webpack.prod.js --profile --json > stats.json",
"build:snauth": "cross-env NODE_OPTIONS=--openssl-legacy-provider AUTH_TYPE=SNAuth webpack --config webpack.prod.js",
"build:idserver": "cross-env NODE_OPTIONS=--openssl-legacy-provider AUTH_TYPE=IdentityServer webpack --config webpack.prod.js",
"start": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack serve --progress --config webpack.dev.js",
"start:snauth": "cross-env NODE_OPTIONS=--openssl-legacy-provider AUTH_TYPE=SNAuth webpack serve --progress --config webpack.dev.js",
"start:idserver": "cross-env NODE_OPTIONS=--openssl-legacy-provider AUTH_TYPE=IdentityServer webpack serve --progress --config webpack.dev.js",
"cypress": "cypress open --env coverage=false",
"cypress:local": "cypress open --env coverage=false --config baseUrl=http://localhost:8080",
"cypress:all": "cypress run --env coverage=false",
Expand Down Expand Up @@ -82,6 +86,7 @@
"webpack-merge": "^5.8.0"
},
"dependencies": {
"@ag-grid-community/styles": "30.0.5",
"@iconify-icons/logos": "1.2.23",
"@iconify/react": "4.1.0",
"@material-ui/core": "4.11.4",
Expand All @@ -100,12 +105,18 @@
"@sensenet/pickers-react": "^2.1.4",
"@sensenet/query": "^2.1.3",
"@sensenet/repository-events": "^2.1.3",
"@sensenet/sn-auth-react": "^1.0.3",
"@tiptap/pm": "^2.6.6",
"ag-grid-community": "27.3.0",
"ag-grid-enterprise": "27.3.0",
"ag-grid-react": "27.3.0",
"autosuggest-highlight": "^3.3.4",
"clsx": "1.2.1",
"date-fns": "2.29.3",
"filesize": "10.0.6",
"react": "^16.13.0",
"react-autosuggest": "^10.1.0",
"react-data-grid": "6.1.0",
"react-day-picker": "^8.6.0",
"react-dom": "^16.13.0",
"react-markdown": "6.0.3",
Expand Down
40 changes: 21 additions & 19 deletions apps/sensenet/src/application-paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export const PATHS = {
search: { appPath: '/search' },
content: { appPath: '/content/:browseType/:action?', snPath: '/Root/Content' },
contentTemplates: { appPath: '/content-templates/:browseType/:action?', snPath: '/Root/ContentTemplates' },
custom: { appPath: '/custom/:browseType/:path/:action?' },
custom: { appPath: '/custom/:browseType/:path/:action?', snPath: '/Root' },
configuration: { appPath: '/system/settings/:action?', snPath: '/Root/System/Settings' },
localization: { appPath: '/system/localization/:action?', snPath: '/Root/Localization' },
webhooks: { appPath: '/system/webhooks/:action?', snPath: '/Root/System/WebHooks' },
settings: { appPath: '/system/:submenu?' },
apiKeys: { appPath: '/system/apikeys' },
landingPath: { appPath: '/content/explorer/' },
root: { appPath: '/Root', snPath: '/Root' },
} as const

type SettingsItemType = 'stats' | 'apikeys' | 'webhooks' | 'adminui'
type SettingsItemType = 'stats' | 'settings' | 'apikeys' | 'webhooks' | 'adminui'

type RoutesWithContentBrowser = keyof Pick<
typeof PATHS,
Expand All @@ -30,28 +32,28 @@ type RoutesWithContentBrowser = keyof Pick<
type RoutesWithActionParam = keyof Pick<typeof PATHS, 'savedQueries' | 'localization' | 'configuration' | 'webhooks'>

type Options =
| { path: (typeof PATHS)['events']['appPath']; params?: { eventGuid: string;[index: string]: string } }
| { path: (typeof PATHS)['events']['appPath']; params?: { eventGuid: string; [index: string]: string } }
| {
path: (typeof PATHS)[RoutesWithContentBrowser]['appPath']
params: { browseType: (typeof BrowseType)[number]; action?: string;[index: string]: string | undefined }
}
path: (typeof PATHS)[RoutesWithContentBrowser]['appPath']
params: { browseType: (typeof BrowseType)[number]; action?: string; [index: string]: string | undefined }
}
| {
path: (typeof PATHS)['custom']['appPath']
params: {
browseType: (typeof BrowseType)[number]
path: string
action?: string
[index: string]: string | undefined
path: (typeof PATHS)['custom']['appPath']
params: {
browseType: (typeof BrowseType)[number]
path: string
action?: string
[index: string]: string | undefined
}
}
}
| {
path: (typeof PATHS)[RoutesWithActionParam]['appPath']
params?: { action: string;[index: string]: string }
}
path: (typeof PATHS)[RoutesWithActionParam]['appPath']
params?: { action: string; [index: string]: string }
}
| {
path: (typeof PATHS)['settings']['appPath']
params?: { submenu: SettingsItemType;[index: string]: string | SettingsItemType }
}
path: (typeof PATHS)['settings']['appPath']
params?: { submenu: SettingsItemType; [index: string]: string | SettingsItemType }
}

export const resolvePathParams = ({ path, params }: Options) => {
let currentPath: string = path
Expand Down
10 changes: 10 additions & 0 deletions apps/sensenet/src/auth-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export type AuthServerType = 'SNAuth' | 'IdentityServer'

export interface AuthenticationConfig {
authType: AuthServerType
}

// Use process.env.AUTH_TYPE if available (from build), otherwise default to 'SNAuth'
export const defaultAuthConfig: AuthenticationConfig = {
authType: (process.env.AUTH_TYPE || 'SNAuth') as AuthServerType,
}
Loading