Skip to content

Commit

Permalink
feat(dashboard): implement new dashboard search metadata (#718)
Browse files Browse the repository at this point in the history
* chore(dashboard): initial commit

* chore(dashboard): use tenant as cookie

* feat(dashboard): add workflow page

* fix(dashboard): use whoami without session

* feat(dashboard): add taskdef

* feat(dashboard): add userTaskDef to search

* style(dashboard): apply prettier

* feat(dashboard): enable search prefix

* style(dashboard): capitalize entity types

* feat(dashboard): add ExternalEventDef to search

* fix(dashboard): link to search type

* style(dashboard): fix style

* refactor(dashboard): simplify search implementation with generic function

* feat(dashboard): metadata search pagination

* feat(dashboard): load more items with bookmark

* chore(dashboard): remove unused logos

* chore(dashboard): import logo as svg

* docs(dashboard): explain how to run for development
  • Loading branch information
mijailr committed Apr 12, 2024
1 parent e1223ac commit ee56453
Show file tree
Hide file tree
Showing 73 changed files with 9,758 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dashboard-new/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space

[*.{ts,json,js,tsx,jsx}]
indent_style = space
indent_size = 2

[*.md]
indent_size = 2
indent_style = space

[Dockerfile]
indent_style = space
indent_size = 2

[*.{yml,yaml}]
indent_size = 2
16 changes: 16 additions & 0 deletions dashboard-new/.env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Littlehorse configuration
LHC_API_HOST=localhost
LHC_API_PORT=2023

LHD_OAUTH_ENABLED=false
LHS_CA_CERT=


# Next-Auth configuration
NEXTAUTH_SECRET=
NEXTAUTH_URL=

# Keycloak
KEYCLOAK_CLIENT_ID=
KEYCLOAK_CLIENT_SECRET=
KEYCLOAK_ISSUER_URI=
3 changes: 3 additions & 0 deletions dashboard-new/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions dashboard-new/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions dashboard-new/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
10 changes: 10 additions & 0 deletions dashboard-new/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 120,
"semi": false,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"arrowParens": "avoid",
"trailingComma": "es5",
"plugins": ["prettier-plugin-tailwindcss"]
}
33 changes: 33 additions & 0 deletions dashboard-new/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# LH Dashboard

## Development

Create a copy of `.env-sample` as `.env-local` and modify it accordingly to your littlehorse-server configuration.

Then simply run

```shell
npm install
npm run dev
```

The application will start with watch mode on [http://localhost:3000](http://localhost:3000)

### LH Server without authentication

If you don't have a lh-server running, you can use this command:

```shell
docker run --rm -d -p 2023:2023 ghcr.io/littlehorse-enterprises/littlehorse/lh-standalone:master
```

Asuming your lh-server is running on `localhost:2023` create a `.env.local` file with

```env
LHC_API_HOST=localhost
LHC_API_PORT=2023
```

### LH Server with authentication

TODO
29 changes: 29 additions & 0 deletions dashboard-new/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: config => {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find(rule => rule.test?.test?.('.svg'))

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ['@svgr/webpack'],
}
)

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i
return config
},
}

export default nextConfig
Loading

0 comments on commit ee56453

Please sign in to comment.