Skip to content

Commit

Permalink
ui update (#12)
Browse files Browse the repository at this point in the history
* feat(testing): setup testing library

* feat(login): first successful unit tests

* fix(login): fix import

* chore(package): remove depricated and vulnerable ag-grid

* chore(husky): change script path

* fix(husky): precommit hook runs again

* feat(topbar): add unit tests for topbar

* feat(api): set proxy and use local backend

* feat(docker): add dockerfile for containerization

* fix(datatable): fix table types

* chore(hooks): add alias for hooks

* feat(login): store userdata in localstorage

* feat(rightbar): showcase chakra ui components

* chore(copyright): add copyright text to all files

* feat(login): prevent logging in without username

* chore(title): change title appearing on tab

* feat(chat): add separate pages for chat sessions

* feat(datatables): add context action placeholders

* fix(login): update route after login

* feat(admin): add edit modal for users table

* feat(datatable): users table api wip

* fix(docker): update and add packages for docker build

* fix(docker): update dockerfile and config to expose port

* feat(tables): users table with api connection

* feat(users): table updated with full CRUD functionality

---------

Co-authored-by: baaalint <balint_kantor@mckinsey.com>
  • Loading branch information
guy1992l and baaalint authored Sep 3, 2024
1 parent 9f5fc99 commit 9dc7641
Show file tree
Hide file tree
Showing 50 changed files with 11,745 additions and 3,570 deletions.
14 changes: 14 additions & 0 deletions ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

root = true

[*]
Expand Down
14 changes: 14 additions & 0 deletions ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 Iguazio
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module.exports = {
root: true,
env: { browser: true, es2021: true },
Expand Down
20 changes: 20 additions & 0 deletions ui/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# Copyright 2024 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd ui
npm run lint
npm test
npm run build

31 changes: 31 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2024 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM node:18-alpine

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm install

COPY . .

RUN npm run build

RUN npm install -g serve

EXPOSE 3000

CMD ["serve", "-s", "dist", "-l", "3000"]
16 changes: 15 additions & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
<!-- Copyright 2024 Iguazio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GenAI Mosaik</title>
<title>GenAI Factory</title>
</head>
<body>
<div id="root"></div>
Expand Down
45 changes: 45 additions & 0 deletions ui/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2024 Iguazio
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: [
'/node_modules/(?!react-markdown|remark-parse|remark-rehype|rehype-parse|unified|bail|is-plain-obj|trough|vfile|vfile-message).+\\.(js|jsx|ts|tsx)$',
],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>/src/__mocks__/fileMock.ts',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@shared/(.*)$': '<rootDir>/src/shared/$1',
'^@assets/(.*)$': '<rootDir>/src/assets/$1',
'^@atoms/(.*)$': '<rootDir>/src/atoms/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^atoms$': '<rootDir>/src/atoms',
},
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
};

export default config;
Loading

0 comments on commit 9dc7641

Please sign in to comment.