rename airwatch folder

This commit is contained in:
Tykayn 2025-09-09 14:43:57 +02:00 committed by tykayn
parent a05388fcbc
commit 949641d881
262 changed files with 21196 additions and 245 deletions

17
airwatch/.editorconfig Normal file
View file

@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
ij_typescript_use_double_quotes = false
[*.md]
max_line_length = off
trim_trailing_whitespace = false

1
airwatch/.env.local Normal file
View file

@ -0,0 +1 @@
OPENWEATHER=de58cb9a19aec9c6073e9f1f75da1d26

46
airwatch/.gitignore vendored Normal file
View file

@ -0,0 +1,46 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db
*storybook.log
storybook-static
.idea

0
airwatch/.npmrc Normal file
View file

111
airwatch/.storybook/main.ts Normal file
View file

@ -0,0 +1,111 @@
import {StorybookConfig} from '@storybook/angular';
import * as path from 'path';
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-docs',
// '@storybook/addon-viewport',
// Removed deprecated addons:
// '@storybook/addon-backgrounds' - no longer exists in Storybook 9.0+
// '@storybook/addon-controls' - no longer exists in Storybook 9.0+
// ... autres addons
],
framework: {
name: '@storybook/angular',
options: {}
},
webpackFinal: async (config) => {
if (config.module?.rules) {
// Support MDX
config.module.rules.push({
test: /\.mdx?$/,
use: [{loader: require.resolve('@mdx-js/loader')}],
});
// Support fonts amélioré
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/,
type: 'asset/resource',
generator: {filename: 'fonts/[name].[contenthash][ext]'},
});
// Support for remixicon font files specifically
config.module.rules.push({
test: /remixicon.*\.(woff|woff2|eot|ttf|svg)$/,
type: 'asset/resource',
generator: {filename: 'fonts/[name].[contenthash][ext]'},
});
// Add CSS loader rule to handle @font-face declarations
config.module.rules.push({
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
url: true
}
}
]
});
// NOUVELLE SOLUTION : Configurer css-loader pour gérer les URLs
const scssRules = config.module.rules.filter(rule => {
if (rule && typeof rule === 'object' && 'test' in rule && rule.test) {
const testString = rule.test.toString();
return testString.includes('scss') || testString.includes('sass');
}
return false;
});
scssRules.forEach(rule => {
if (rule && typeof rule === 'object' && 'use' in rule && Array.isArray(rule.use)) {
const cssLoaderIndex = rule.use.findIndex((loader: any) => {
if (typeof loader === 'string') {
return loader.includes('css-loader');
}
return loader && loader.loader && loader.loader.includes('css-loader');
});
if (cssLoaderIndex !== -1) {
const cssLoader = rule.use[cssLoaderIndex] as any;
if (typeof cssLoader === 'object' && cssLoader.options) {
cssLoader.options.url = {
filter: (url: string) => {
// Skip problematic URLs with complex relative paths
if (url.includes('../../../../my-workspace/')) {
return false;
}
return true;
}
};
}
}
}
});
}
// Alias
if (!config.resolve) config.resolve = {};
if (!config.resolve.alias) config.resolve.alias = {};
config.resolve.alias['~src'] = path.resolve(__dirname, '../src');
config.resolve.alias['sae-lib'] = path.resolve(__dirname, '../../my-workspace/projects/sae-lib');
// Ajouter un alias pour remixicon
config.resolve.alias['remixicon'] = path.resolve(__dirname, '../node_modules/remixicon');
// Modules resolution
if (!config.resolve.modules) config.resolve.modules = [];
config.resolve.modules.push(path.resolve(__dirname, '../node_modules'));
config.resolve.symlinks = true;
return config;
}
};
export default config;

View file

@ -0,0 +1,138 @@
<style type="text/scss">
// Thin (100)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Thin.ttf') format('truetype');
font-weight: 100;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ThinItalic.ttf') format('truetype');
font-weight: 100;
font-style: italic;
}
// Extra Light (200)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ExtraLight.ttf') format('truetype');
font-weight: 200;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ExtraLightItalic.ttf') format('truetype');
font-weight: 200;
font-style: italic;
}
// Light (300)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Light.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-LightItalic.ttf') format('truetype');
font-weight: 300;
font-style: italic;
}
// Regular (400)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Italic.ttf') format('truetype');
font-weight: 400;
font-style: italic;
}
// Medium (500)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-MediumItalic.ttf') format('truetype');
font-weight: 500;
font-style: italic;
}
// Semi Bold (600)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-SemiBold.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-SemiBoldItalic.ttf') format('truetype');
font-weight: 600;
font-style: italic;
}
// Bold (700)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Bold.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-BoldItalic.ttf') format('truetype');
font-weight: 700;
font-style: italic;
}
// Extra Bold (800)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ExtraBold.ttf') format('truetype');
font-weight: 800;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-ExtraBoldItalic.ttf') format('truetype');
font-weight: 800;
font-style: italic;
}
// Black (900)
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-Black.ttf') format('truetype');
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: 'Barlow';
src: url('fonts/Barlow/Barlow-BlackItalic.ttf') format('truetype');
font-weight: 900;
font-style: italic;
}
</style>

View file

@ -0,0 +1,29 @@
import type {Preview} from '@storybook/angular';
import {moduleMetadata} from '@storybook/angular';
import {Store, StoreModule} from '@ngrx/store';
import {reducers} from '../src/app/reducers';
import 'remixicon/fonts/remixicon.css';
const preview: Preview = {
parameters: {
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
decorators: [
moduleMetadata({
imports: [
StoreModule.forRoot(reducers),
],
providers: [
Store
]
})
]
};
export default preview;

View file

@ -0,0 +1,93 @@
Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View file

@ -0,0 +1,10 @@
// This tsconfig is used by Compodoc to generate the documentation for the project.
// If Compodoc is not used, this file can be deleted.
{
"extends": "./tsconfig.json",
// Exclude all files that are not needed for documentation generation.
"exclude": ["../src/test.ts", "../src/**/*.spec.ts", "../src/**/*.stories.ts"],
// Please make sure to include all files from which Compodoc should generate documentation.
"include": ["../src/**/*"],
"files": ["./typings.d.ts"]
}

View file

@ -0,0 +1,11 @@
{
"extends": "../tsconfig.app.json",
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true
},
"exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
"include": ["../src/**/*.stories.*", "./preview.ts"],
"files": ["./typings.d.ts"]
}

9
airwatch/.storybook/typings.d.ts vendored Normal file
View file

@ -0,0 +1,9 @@
declare module '*.md' {
const content: string;
export default content;
}
declare module '*.mdx' {
const content: any;
export default content;
}

46
airwatch/CHANGES.md Normal file
View file

@ -0,0 +1,46 @@
# Changes Made
## Auto-scrolling Fix
The issue was that the conversation container wasn't automatically scrolling to the bottom when new messages were added. This was fixed by:
1. Removing the direct DOM manipulation approach in the store subscription:
```typescript
// Old code
if (prevMessagesLength !== newMessagesLength) {
const container = document.querySelector('.main-conversation-container');
if (container) {
container.scrollTop = container.scrollHeight;
}
}
// New code
if (prevMessagesLength !== newMessagesLength) {
this.shouldScrollToBottom = true;
}
```
2. Using the existing ViewChild and ngAfterViewChecked approach consistently throughout the component.
This ensures that when new messages are added to the conversation, the view will automatically scroll to the bottom to show the latest message.
## Storybook @font-face Issue
The issue was that Storybook couldn't understand the @font-face declarations in the _typo.scss file because they were using tilde (~) notation for paths. This was fixed by:
1. Changing all font paths from tilde notation to relative paths:
```scss
// Old path
src: url('~src/app/styles/typo/Barlow/Barlow-Thin.ttf') format('truetype');
// New path
src: url('../styles/typo/Barlow/Barlow-Thin.ttf') format('truetype');
```
This change allows Storybook to properly process the @font-face declarations and load the fonts correctly.
## Summary
These changes ensure that:
1. The conversation container automatically scrolls to the latest message when new messages are added.
2. Storybook can properly load and display fonts defined with @font-face declarations.

235
airwatch/LICENSE.md Normal file
View file

@ -0,0 +1,235 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

104
airwatch/README.md Normal file
View file

@ -0,0 +1,104 @@
# Storybook Setup
## Issues Fixed
1. Fixed the import statement in `.storybook/preview.ts` to use the correct path for `INITIAL_VIEWPORTS`:
```typescript
// Changed from
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport/presets';
// To
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
```
2. Removed deprecated Storybook addons:
- Removed `@storybook/addon-backgrounds` from `.storybook/main.ts` and `package.json`
- Removed `@storybook/addon-controls` from `.storybook/main.ts` and `package.json`
- Kept the backgrounds and controls configuration in `.storybook/preview.ts` as these are now part of the core Storybook functionality
3. Fixed Remixicon icons not appearing in Storybook for app-source-block:
- Added global style imports to `.storybook/preview.ts`:
```typescript
// Import global styles
import '../src/app/styles/styles.scss';
// Import Remixicon directly to ensure it's available in Storybook
import 'remixicon/fonts/remixicon.css';
```
- This ensures that both the application's global styles (which include sae-lib styles with Remixicon) and Remixicon itself are properly loaded in Storybook
4. Fixed CSS processing issues with `@font-face` declarations:
- Added explicit CSS loader configuration in `.storybook/main.ts`:
```typescript
config.module.rules.push({
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
url: true,
import: true
}
}
]
});
```
- Enhanced font file handling to support files with query parameters:
```typescript
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)(\?.*)?$/,
type: 'asset/resource',
generator: {filename: 'fonts/[name].[contenthash][ext]'},
});
```
- This ensures that font files referenced in `@font-face` declarations with query parameters (like `?t=1734404658139`) are properly loaded
## Remaining Issues
1. **Node.js Version Compatibility**:
- The Angular CLI requires Node.js v20.19+ or v22.12+
- Current Node.js version is v18.19.1
- To fix this issue, you need to upgrade your Node.js version
## How to Upgrade Node.js
You can upgrade Node.js using one of the following methods:
### Using NVM (Node Version Manager)
```bash
# Install NVM if you don't have it already
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# Install the required Node.js version
nvm install 20.19
# Use the installed version
nvm use 20.19
```
### Using Package Manager
#### For Ubuntu/Debian:
```bash
# Add NodeSource repository
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# Install Node.js
sudo apt-get install -y nodejs
```
#### For macOS (using Homebrew):
```bash
brew update
brew install node@20
```
After upgrading Node.js, run the following commands to reinstall dependencies and start Storybook:
```bash
npm install
npm run storybook
```

119
airwatch/angular.json Normal file
View file

@ -0,0 +1,119 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-app": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"browser": "src/main.ts",
"polyfills": [
"zone.js",
"@angular/localize/init"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/app/styles/styles.scss"
],
"server": "src/main.server.ts"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "my-app:build:production"
},
"development": {
"buildTarget": "my-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular/build:extract-i18n"
},
"test": {
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing",
"@angular/localize/init"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.scss"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "my-app:build",
"compodoc": false,
"port": 6006
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "my-app:build",
"compodoc": false,
"outputDir": "storybook-static"
}
}
}
}
}
}

84
airwatch/build.sh Executable file
View file

@ -0,0 +1,84 @@
#!/bin/bash
# Script to build the Angular application and prepare files for implementation
# Created: 2025-07-22
# Exit on error
set -e
echo "=== Angular Build Script ==="
echo "This script builds the Angular application and prepares files for implementation"
# Check Node.js version
NODE_VERSION=$(node -v | cut -d 'v' -f 2)
NODE_MAJOR_VERSION=$(echo $NODE_VERSION | cut -d '.' -f 1)
NODE_MINOR_VERSION=$(echo $NODE_VERSION | cut -d '.' -f 2)
echo "Detected Node.js version: v$NODE_VERSION"
# Check if Node.js version is compatible (v20.19+ or v22.12+)
if [[ ($NODE_MAJOR_VERSION -eq 20 && $NODE_MINOR_VERSION -ge 19) || ($NODE_MAJOR_VERSION -ge 22 && $NODE_MINOR_VERSION -ge 12) || ($NODE_MAJOR_VERSION -gt 22) ]]; then
echo "Node.js version is compatible."
else
echo "Error: Angular CLI requires Node.js version v20.19+ or v22.12+"
echo "Please update your Node.js version or visit https://nodejs.org/ for additional instructions."
exit 1
fi
# Build the Angular application
echo "Building Angular application..."
npm run build
# Check if build was successful
if [ $? -ne 0 ]; then
echo "Error: Angular build failed."
exit 1
fi
# Define paths
DIST_DIR="dist/my-app/browser"
IMPLEMENTATION_ASSETS_DIR="implementation/assets"
# Create implementation assets directory if it doesn't exist
mkdir -p "$IMPLEMENTATION_ASSETS_DIR"
# Find the CSS and JS files
CSS_FILE=$(find "$DIST_DIR" -name "styles-*.css" | head -n 1)
MAIN_JS_FILE=$(find "$DIST_DIR" -name "main-*.js" | head -n 1)
POLYFILLS_JS_FILE=$(find "$DIST_DIR" -name "polyfills-*.js" | head -n 1)
# Check if files exist
if [ -z "$CSS_FILE" ]; then
echo "Error: Could not find styles CSS file in $DIST_DIR"
exit 1
fi
if [ -z "$MAIN_JS_FILE" ]; then
echo "Error: Could not find main JS file in $DIST_DIR"
exit 1
fi
# Copy and rename CSS file
echo "Copying CSS file to implementation assets..."
cp "$CSS_FILE" "$IMPLEMENTATION_ASSETS_DIR/design-system.css"
# Combine JS files if polyfills exist, otherwise just use main JS
if [ -n "$POLYFILLS_JS_FILE" ]; then
echo "Combining main and polyfills JS files..."
cat "$MAIN_JS_FILE" "$POLYFILLS_JS_FILE" > "$IMPLEMENTATION_ASSETS_DIR/design-system.js"
else
echo "Copying main JS file to implementation assets..."
cp "$MAIN_JS_FILE" "$IMPLEMENTATION_ASSETS_DIR/design-system.js"
fi
echo "Build completed successfully!"
echo "Files have been copied to $IMPLEMENTATION_ASSETS_DIR:"
echo "- design-system.css"
echo "- design-system.js"
# Show file sizes
echo "File sizes:"
ls -lh "$IMPLEMENTATION_ASSETS_DIR/design-system.css" | awk '{print "- CSS: " $5}'
ls -lh "$IMPLEMENTATION_ASSETS_DIR/design-system.js" | awk '{print "- JS: " $5}'
echo "=== Done ==="

18768
airwatch/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

73
airwatch/package.json Normal file
View file

@ -0,0 +1,73 @@
{
"name": "my-app",
"version": "0.0.0",
"scripts": {
"build": "ng build",
"build-storybook": "ng run my-app:build-storybook",
"build:elements": "ng build --configuration production --output-hashing none && cat dist/runtime.js dist/polyfills.js dist/main.js > dist/color-display.js",
"link-sae-lib": "bash ./scripts/link-sae-lib.sh",
"ng": "ng",
"postinstall": "npm run link-sae-lib",
"serve:ssr:my-app": "node dist/my-app/server/server.mjs",
"start": "ng serve",
"storybook": "ng run my-app:storybook",
"test": "ng test",
"watch": "ng build --watch --configuration development"
},
"prettier": {
"overrides": [
{
"files": "*.html",
"options": {
"parser": "angular"
}
}
]
},
"private": true,
"dependencies": {
"@angular/common": "^20.1.0",
"@angular/compiler": "^20.1.0",
"@angular/core": "^20.1.0",
"@angular/forms": "^20.1.0",
"@angular/platform-browser": "^20.1.0",
"@angular/platform-server": "^20.1.0",
"@angular/router": "^20.1.0",
"@angular/ssr": "^20.1.1",
"@ngrx/store": "^20.0.0",
"@ngrx/store-devtools": "^20.0.0",
"@sjmc11/tourguidejs": "^0.0.27",
"angular-shepherd": "^20.0.0",
"express": "^5.1.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^20.1.1",
"@angular/build": "^20.1.1",
"@angular/cli": "^20.1.1",
"@angular/compiler-cli": "^20.1.0",
"@angular/localize": "^20.1.2",
"@mdx-js/loader": "^3.1.0",
"@storybook/addon-docs": "^9.0.17",
"@storybook/addon-links": "^9.0.17",
"@storybook/addon-viewport": "^9.0.8",
"@storybook/addon-vitest": "^9.0.17",
"@storybook/angular": "^9.0.17",
"@types/express": "^5.0.1",
"@types/jasmine": "~5.1.0",
"@types/node": "^20.17.19",
"ag-grid-angular": "^34.0.2",
"bulma": "^1.0.4",
"jasmine-core": "~5.8.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"remixicon": "^4.6.0",
"storybook": "^9.0.17",
"typescript": "~5.8.2"
}
}

View file

@ -0,0 +1,22 @@
{
"locale": "en-US",
"translations": {
"welcome": "Welcome to our chatbot application",
"newChat": "New conversation",
"search": "Search",
"sources": "Sources",
"noSources": "No sources available",
"feedback": "Feedback",
"send": "Send",
"loading": "Loading...",
"error": "System error - I couldn't process your request. Please try again in a few moments",
"language": "Language",
"theme": "Theme",
"userMessage": "User message",
"botMessage": "Bot message",
"documentation": "Documentation",
"about": "About",
"contact": "Contact",
"reportIssue": "Report an issue"
}
}

View file

@ -0,0 +1,22 @@
{
"locale": "fr-FR",
"translations": {
"welcome": "Bienvenue dans notre application de chatbot",
"newChat": "Nouvelle conversation",
"search": "Rechercher",
"sources": "Sources",
"noSources": "Aucune source disponible",
"feedback": "Commentaires",
"send": "Envoyer",
"loading": "Chargement...",
"error": "Erreur système - Je n'ai pas pu traiter votre demande. Veuillez réessayer dans quelques instants",
"language": "Langue",
"theme": "Thème",
"userMessage": "Message utilisateur",
"botMessage": "Message du bot",
"documentation": "Documentation",
"about": "À propos",
"contact": "Contact",
"reportIssue": "Signaler un problème"
}
}

View file

@ -0,0 +1,4 @@
{
"locale": "en-US",
"translations": {}
}

BIN
airwatch/public/chatbot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -0,0 +1,22 @@
{
"locale": "en-US",
"translations": {
"welcome": "Welcome to our chatbot application",
"newChat": "New conversation",
"search": "Search",
"sources": "Sources",
"noSources": "No sources available",
"feedback": "Feedback",
"send": "Send",
"loading": "Loading...",
"error": "System error - I couldn't process your request. Please try again in a few moments",
"language": "Language",
"theme": "Theme",
"userMessage": "User message",
"botMessage": "Bot message",
"documentation": "Documentation",
"about": "About",
"contact": "Contact",
"reportIssue": "Report an issue"
}
}

BIN
airwatch/public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,22 @@
{
"locale": "fr-FR",
"translations": {
"welcome": "Bienvenue dans notre application de chatbot",
"newChat": "Nouvelle conversation",
"search": "Rechercher",
"sources": "Sources",
"noSources": "Aucune source disponible",
"feedback": "Commentaires",
"send": "Envoyer",
"loading": "Chargement...",
"error": "Erreur système - Je n'ai pas pu traiter votre demande. Veuillez réessayer dans quelques instants",
"language": "Langue",
"theme": "Thème",
"userMessage": "Message utilisateur",
"botMessage": "Message du bot",
"documentation": "Documentation",
"about": "À propos",
"contact": "Contact",
"reportIssue": "Signaler un problème"
}
}

View file

@ -0,0 +1,22 @@
{
"locale": "en-US",
"translations": {
"welcome": "Welcome to our chatbot application",
"newChat": "New conversation",
"search": "Search",
"sources": "Sources",
"noSources": "No sources available",
"feedback": "Feedback",
"send": "Send",
"loading": "Loading...",
"error": "System error - I couldn't process your request. Please try again in a few moments",
"language": "Language",
"theme": "Theme",
"userMessage": "User message",
"botMessage": "Bot message",
"documentation": "Documentation",
"about": "About",
"contact": "Contact",
"reportIssue": "Report an issue"
}
}

View file

@ -0,0 +1,22 @@
{
"locale": "fr-FR",
"translations": {
"welcome": "Bienvenue dans notre application de chatbot",
"newChat": "Nouvelle conversation",
"search": "Rechercher",
"sources": "Sources",
"noSources": "Aucune source disponible",
"feedback": "Commentaires",
"send": "Envoyer",
"loading": "Chargement...",
"error": "Erreur système - Je n'ai pas pu traiter votre demande. Veuillez réessayer dans quelques instants",
"language": "Langue",
"theme": "Thème",
"userMessage": "Message utilisateur",
"botMessage": "Message du bot",
"documentation": "Documentation",
"about": "À propos",
"contact": "Contact",
"reportIssue": "Signaler un problème"
}
}

View file

@ -0,0 +1,4 @@
{
"locale": "en-US",
"translations": {}
}

View file

@ -0,0 +1,4 @@
{
"locale": "en-US",
"translations": {}
}

View file

@ -0,0 +1,134 @@
<svg width="108" height="32" viewBox="0 0 108 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_78_4310)">
<path d="M60.5489 12.736V15.44H66.7657L66.3933 17.2H60.5651V21.072H57.7319V10.96H67.737L67.3647 12.72H60.5489V12.736ZM94.9839 21.088H91.7298L90.7423 19.04H85.2864L84.3474 21.088H82.2914L87.0996 10.976H89.01C89.7385 10.976 90.0137 11.264 90.3861 12.016C90.7423 12.736 94.9839 21.088 94.9839 21.088ZM89.9004 17.28L87.9739 13.248L86.1121 17.28H89.9004ZM56.3073 21.088H53.0532L52.0818 19.04H46.6259L45.687 21.088H43.6309L48.4554 10.976H50.3657C51.0942 10.976 51.3695 11.264 51.7418 12.016C52.0656 12.736 56.3073 21.088 56.3073 21.088ZM51.2238 17.28L49.2972 13.248L47.4354 17.28H51.2238ZM37.657 21.408C41.3158 21.408 42.9995 20.08 42.9995 18.16C42.9995 16.48 41.4615 15.616 38.1103 14.72C36.1028 14.176 34.8562 14.064 34.8562 13.392C34.8562 12.72 36.0218 12.416 37.8189 12.496C40.0692 12.608 41.5101 13.536 41.5101 13.536L42.4005 12.128C42.4005 12.128 40.3768 10.64 37.1389 10.64C33.6258 10.64 31.7802 11.696 31.7802 13.648C31.7802 15.6 33.8848 16.24 36.9446 17.104C38.8388 17.632 39.9235 17.744 39.9235 18.448C39.9235 18.992 39.3569 19.68 36.8475 19.568C34.4353 19.456 32.3468 18.064 32.3468 18.064L31.2783 19.344C31.2783 19.376 33.5772 21.408 37.657 21.408ZM105.879 10.976V17.008C105.879 17.008 99.8893 12.288 99.4036 11.888C98.5132 11.184 98.1085 10.976 97.1209 10.976H96.3924V21.088H98.497V15.152C98.497 15.152 104.439 19.84 104.94 20.224C105.831 20.928 106.284 21.088 107.272 21.088H108V10.976H105.879ZM81.2067 21.088H79.2963C78.163 21.088 77.4669 20.304 77.046 19.776C76.5927 19.184 75.427 17.68 75.427 17.68H72.3186V21.104H69.4855V10.992H75.2328C77.4345 10.992 80.5915 11.216 80.6077 14.336C80.6077 16.144 79.5392 16.976 78.2116 17.36L81.2067 21.088ZM77.5317 14.32C77.5317 13.264 76.8517 12.736 75.3461 12.736H72.351L72.3186 12.72V15.92L72.351 15.904H75.3461C76.8517 15.904 77.5317 15.376 77.5317 14.32Z" fill="white"/>
<mask id="mask0_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="20" width="20" height="7">
<path d="M25.9191 20.384C23.8144 23.232 20.4147 25.088 16.5777 25.088C12.7408 25.088 9.34105 23.232 7.23642 20.384H7.00977C8.70966 23.92 12.3523 26.352 16.5777 26.352C20.8032 26.352 24.4458 23.904 26.1457 20.384H25.9191Z" fill="white"/>
</mask>
<g mask="url(#mask0_78_4310)">
<path d="M26.1457 20.384H7.00977V26.352H26.1457V20.384Z" fill="url(#paint0_radial_78_4310)"/>
</g>
<mask id="mask1_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="7" width="19" height="18">
<path d="M9.82723 9.50397C8.56446 10.432 8.06258 11.376 7.8845 12.256C6.99408 16.56 15.6069 18.272 18.9095 19.344C20.7228 19.92 20.9656 20.704 20.9494 21.328C20.917 22.768 18.861 24.064 18.8448 24.064C20.5285 24.032 22.795 23.056 24.1549 21.536C24.673 20.96 25.1263 20.192 25.2396 19.632C25.7415 17.056 23.3131 15.744 20.4475 14.752C18.2134 13.984 16.3678 13.456 14.7974 12.976C12.3042 12.224 11.8833 11.504 11.8995 10.72C11.9157 9.80797 12.9032 8.65597 14.0041 7.98397C13.9879 7.95197 11.9157 7.95197 9.82723 9.50397Z" fill="white"/>
</mask>
<g mask="url(#mask1_78_4310)">
<path d="M0 20.128L21.1758 32L32.7351 11.872L11.5593 0L0 20.128Z" fill="url(#paint1_linear_78_4310)"/>
</g>
<mask id="mask2_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="5" y="2" width="27" height="27">
<path d="M31.9256 2.01599H5.09961V28.672H31.9256V2.01599Z" fill="white"/>
</mask>
<g mask="url(#mask2_78_4310)">
<mask id="mask3_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="11" y="7" width="15" height="16">
<path d="M11.7375 10.576C11.7213 10.672 11.7051 10.752 11.7051 10.848V10.912C11.7213 11.728 12.5146 12.448 14.6192 13.088C16.1896 13.568 18.0352 14.096 20.2693 14.864C23.1348 15.856 25.4985 17.008 24.9804 19.6C24.8347 20.288 24.1224 21.552 22.4225 22.736C22.9406 22.512 23.75 22 24.1872 21.52C24.7052 20.944 25.1585 20.176 25.2719 19.616C25.3204 19.392 25.3366 19.184 25.3366 18.976V18.944C25.3204 16.8 23.0863 15.632 20.4798 14.736C18.2456 13.968 16.4 13.44 14.8296 12.96C12.3365 12.208 11.9155 11.488 11.9317 10.704C11.9479 9.79202 12.9355 8.64002 14.0364 7.96802C12.4174 8.92802 11.867 9.87202 11.7375 10.576Z" fill="white"/>
</mask>
<g mask="url(#mask3_78_4310)">
<path d="M31.9258 11.584L15.0887 2.08002L5.26172 19.104L22.115 28.592L31.9258 11.584Z" fill="url(#paint2_linear_78_4310)"/>
</g>
</g>
<g opacity="0.8">
<mask id="mask4_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="13" y="10" width="16" height="16">
<path d="M28.72 10.128H13.4209V25.056H28.72V10.128Z" fill="white"/>
</mask>
<g mask="url(#mask4_78_4310)">
<mask id="mask5_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="16" y="13" width="10" height="9">
<path d="M17.2739 13.984C17.0148 13.984 16.8691 14.08 16.8691 14.208V14.24C16.8853 14.416 17.1606 14.672 17.7758 14.864C18.4557 15.088 19.3461 15.392 20.0908 15.616C22.5355 16.416 24.7858 17.424 24.3649 19.92C24.2677 20.432 24.203 20.656 23.7982 21.184C23.863 21.104 24.9801 20.624 25.1582 19.392C25.1743 19.264 25.1905 19.136 25.1905 19.008V18.928C25.1582 16.832 22.7783 15.712 20.2527 14.848C19.5728 14.608 18.6662 14.32 17.9053 14.08C17.6786 14.016 17.5005 13.984 17.3386 13.968H17.2739V13.984Z" fill="white"/>
</mask>
<g mask="url(#mask5_78_4310)">
<mask id="mask6_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="13" y="10" width="16" height="16">
<path d="M28.72 10.128H13.4209V25.056H28.72V10.128Z" fill="white"/>
</mask>
<g mask="url(#mask6_78_4310)">
<mask id="mask7_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="13" y="10" width="16" height="16">
<path d="M18.9993 10.1164L13.4277 19.2768L23.1546 25.0551L28.7261 15.8947L18.9993 10.1164Z" fill="white"/>
</mask>
<g mask="url(#mask7_78_4310)">
<path d="M17.4836 3.45599L6.75 21.088L24.6556 31.728L35.3892 14.08L17.4836 3.45599Z" fill="url(#paint3_linear_78_4310)"/>
</g>
</g>
</g>
</g>
</g>
<g opacity="0.5">
<mask id="mask8_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="13" y="12" width="16" height="16">
<path d="M28.931 12.304H13.7129V27.376H28.931V12.304Z" fill="white"/>
</mask>
<g mask="url(#mask8_78_4310)">
<mask id="mask9_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="17" y="15" width="8" height="10">
<path d="M17.8574 18.688C18.3107 18.816 18.7155 18.944 19.0878 19.04C20.9496 19.568 21.5648 20.336 21.3543 21.504C21.1277 22.736 19.0878 23.904 18.845 24.048C20.2697 23.92 22.6819 22.704 23.7828 21.2C24.1875 20.672 24.2523 20.432 24.3494 19.92C24.7541 17.44 22.52 16.416 20.0754 15.616L17.8574 18.688Z" fill="white"/>
</mask>
<g mask="url(#mask9_78_4310)">
<path d="M13.7129 20.784L22.099 27.376L28.9148 18.896L20.5449 12.304L13.7129 20.784Z" fill="url(#paint4_linear_78_4310)"/>
</g>
</g>
</g>
<mask id="mask10_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="12" width="15" height="13">
<path d="M21.5801 12.368H7.15527V24.048H21.5801V12.368Z" fill="white"/>
</mask>
<g mask="url(#mask10_78_4310)">
<mask id="mask11_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="12" width="15" height="13">
<path d="M18.9087 19.328C20.7219 19.904 20.9647 20.688 20.9486 21.312C20.9162 22.704 18.9896 23.968 18.8601 24.048C19.1353 23.888 21.1428 22.72 21.3695 21.504C21.5799 20.336 20.9647 19.568 19.103 19.04C18.1316 18.768 16.9336 18.416 15.5089 17.984C14.408 17.664 13.0157 17.168 11.7044 16.608C8.22363 15.088 7.77032 13.232 7.86746 12.368C7.15512 16.592 15.6384 18.288 18.9087 19.328Z" fill="white"/>
</mask>
<g mask="url(#mask11_78_4310)">
<path d="M21.5801 12.368H7.15527V24.032H21.5801V12.368Z" fill="url(#paint5_linear_78_4310)"/>
</g>
</g>
<mask id="mask12_78_4310" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="5" width="20" height="7">
<path d="M7.00977 11.408H7.23642C9.34105 8.56002 12.7408 6.70402 16.5777 6.70402C20.4147 6.70402 23.8144 8.56002 25.9191 11.408H26.1457C24.4458 7.87202 20.8032 5.44002 16.5777 5.44002C12.3685 5.42402 8.70966 7.87202 7.00977 11.408Z" fill="white"/>
</mask>
<g mask="url(#mask12_78_4310)">
<path d="M6.28125 5.51999L7.30119 13.712L26.8905 11.312L25.8543 3.12L6.28125 5.51999Z" fill="url(#paint6_linear_78_4310)"/>
</g>
</g>
<defs>
<radialGradient id="paint0_radial_78_4310" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(16.5812 23.3647) scale(10.698 10.5728)">
<stop stop-color="#84CFED"/>
<stop offset="0.22" stop-color="#59A7D5"/>
<stop offset="0.45" stop-color="#3284C0"/>
<stop offset="0.67" stop-color="#176BB1"/>
<stop offset="0.86" stop-color="#065BA7"/>
<stop offset="1" stop-color="#0056A4"/>
</radialGradient>
<linearGradient id="paint1_linear_78_4310" x1="10.8516" y1="12.9448" x2="25.3329" y2="21.2553" gradientUnits="userSpaceOnUse">
<stop stop-color="#57BCEC"/>
<stop offset="0.08" stop-color="#4CB1E3"/>
<stop offset="0.34" stop-color="#2B8FC9"/>
<stop offset="0.59" stop-color="#1376B6"/>
<stop offset="0.81" stop-color="#0567AB"/>
<stop offset="1" stop-color="#0062A7"/>
</linearGradient>
<linearGradient id="paint2_linear_78_4310" x1="22.1862" y1="17.3685" x2="13.1713" y2="12.1656" gradientUnits="userSpaceOnUse">
<stop stop-color="#84CFED"/>
<stop offset="0.31" stop-color="#57A6D4"/>
<stop offset="0.78" stop-color="#196DB2"/>
<stop offset="1" stop-color="#0056A4"/>
</linearGradient>
<linearGradient id="paint3_linear_78_4310" x1="22.6372" y1="15.1296" x2="21.6733" y2="16.7523" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="0.08" stop-color="white"/>
<stop offset="1" stop-color="white"/>
</linearGradient>
<linearGradient id="paint4_linear_78_4310" x1="18.484" y1="17.6353" x2="23.4572" y2="21.6395" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#0069B4"/>
</linearGradient>
<linearGradient id="paint5_linear_78_4310" x1="7.71112" y1="18.0613" x2="21.3006" y2="18.0613" gradientUnits="userSpaceOnUse">
<stop stop-color="#84CFED"/>
<stop offset="0.31" stop-color="#57A6D4"/>
<stop offset="0.78" stop-color="#196DB2"/>
<stop offset="1" stop-color="#0056A4"/>
</linearGradient>
<linearGradient id="paint6_linear_78_4310" x1="16.1324" y1="5.2491" x2="18.6841" y2="26.0376" gradientUnits="userSpaceOnUse">
<stop stop-color="#81CDEC"/>
<stop offset="0.08" stop-color="#5FADD8"/>
<stop offset="0.16" stop-color="#4292C8"/>
<stop offset="0.25" stop-color="#2A7CBB"/>
<stop offset="0.35" stop-color="#176BB1"/>
<stop offset="0.47" stop-color="#0A5FA9"/>
<stop offset="0.62" stop-color="#0258A5"/>
<stop offset="0.94" stop-color="#0056A4"/>
<stop offset="1" stop-color="#0056A4"/>
</linearGradient>
<clipPath id="clip0_78_4310">
<rect width="108" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,60 @@
<svg fill="none" height="21" viewBox="0 0 20 21" width="20" xmlns="http://www.w3.org/2000/svg">
<mask height="7" id="mask0_86_6577" maskUnits="userSpaceOnUse" style="mask-type:luminance" width="20" x="0" y="14">
<path
d="M18.9093 14.944C16.8047 17.792 13.4049 19.648 9.56798 19.648C5.73108 19.648 2.33128 17.792 0.226653 14.944H0C1.6999 18.48 5.34253 20.912 9.56798 20.912C13.7934 20.912 17.4361 18.464 19.136 14.944H18.9093Z"
fill="white"/>
</mask>
<g mask="url(#mask0_86_6577)">
<path d="M19.136 14.944H0V20.912H19.136V14.944Z" fill="url(#paint0_radial_86_6577)"/>
</g>
<mask height="17" id="mask1_86_6577" maskUnits="userSpaceOnUse" style="mask-type:luminance" width="19" x="0" y="2">
<path
d="M2.81698 4.06403C1.5542 4.99203 1.05233 5.93603 0.874244 6.81603C-0.0161772 11.12 8.59663 12.832 11.8993 13.904C13.7125 14.48 13.9553 15.264 13.9392 15.888C13.9068 17.328 11.8507 18.624 11.8345 18.624C13.5182 18.592 15.7848 17.616 17.1447 16.096C17.6627 15.52 18.116 14.752 18.2294 14.192C18.7312 11.616 16.3028 10.304 13.4373 9.31203C11.2031 8.54403 9.35753 8.01603 7.78715 7.53603C5.29397 6.78403 4.87304 6.06403 4.88923 5.28003C4.90542 4.36803 5.89298 3.21603 6.99387 2.54403C6.97768 2.51203 4.90542 2.51203 2.81698 4.06403Z"
fill="white"/>
</mask>
<g mask="url(#mask1_86_6577)">
<path d="M-7.01025 14.6881L14.1656 26.5601L25.7249 6.43206L4.54903 -5.43994L-7.01025 14.6881Z"
fill="url(#paint1_linear_86_6577)"/>
</g>
<mask height="6" id="mask2_86_6577" maskUnits="userSpaceOnUse" style="mask-type:luminance" width="20" x="0" y="0">
<path
d="M0 5.96808H0.226653C2.33128 3.12008 5.73108 1.26408 9.56798 1.26408C13.4049 1.26408 16.8047 3.12008 18.9093 5.96808H19.136C17.4361 2.43208 13.7934 7.79692e-05 9.56798 7.79692e-05C5.35872 -0.015922 1.6999 2.43208 0 5.96808Z"
fill="white"/>
</mask>
<g mask="url(#mask2_86_6577)">
<path d="M-0.728516 0.0800536L0.291421 8.27205L19.8807 5.87205L18.8446 -2.31995L-0.728516 0.0800536Z"
fill="url(#paint2_linear_86_6577)"/>
</g>
<defs>
<radialGradient cx="0" cy="0" gradientTransform="translate(9.57148 17.9248) scale(10.698 10.5728)" gradientUnits="userSpaceOnUse" id="paint0_radial_86_6577"
r="1">
<stop stop-color="#84CFED"/>
<stop offset="0.22" stop-color="#59A7D5"/>
<stop offset="0.45" stop-color="#3284C0"/>
<stop offset="0.67" stop-color="#176BB1"/>
<stop offset="0.86" stop-color="#065BA7"/>
<stop offset="1" stop-color="#0056A4"/>
</radialGradient>
<linearGradient gradientUnits="userSpaceOnUse" id="paint1_linear_86_6577" x1="3.84135" x2="18.3227" y1="7.50491"
y2="15.8153">
<stop stop-color="#57BCEC"/>
<stop offset="0.08" stop-color="#4CB1E3"/>
<stop offset="0.34" stop-color="#2B8FC9"/>
<stop offset="0.59" stop-color="#1376B6"/>
<stop offset="0.81" stop-color="#0567AB"/>
<stop offset="1" stop-color="#0062A7"/>
</linearGradient>
<linearGradient gradientUnits="userSpaceOnUse" id="paint2_linear_86_6577" x1="9.12259" x2="11.6743" y1="-0.190838"
y2="20.5976">
<stop stop-color="#81CDEC"/>
<stop offset="0.08" stop-color="#5FADD8"/>
<stop offset="0.16" stop-color="#4292C8"/>
<stop offset="0.25" stop-color="#2A7CBB"/>
<stop offset="0.35" stop-color="#176BB1"/>
<stop offset="0.47" stop-color="#0A5FA9"/>
<stop offset="0.62" stop-color="#0258A5"/>
<stop offset="0.94" stop-color="#0056A4"/>
<stop offset="1" stop-color="#0056A4"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
airwatch/public/user.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,37 @@
#!/bin/bash
# Script pour lier sae-lib comme un module npm local
echo "script de postinstallation pour relier la lib SAE Aero au projet courant"
# Vérifier si npm est installé
if ! [ -x "$(command -v npm)" ]; then
echo 'Erreur: npm n est pas installé.' >&2
exit 1
fi
# Configurer npm pour utiliser un répertoire dans l'espace utilisateur
NPM_PREFIX="$HOME/.npm-global"
mkdir -p "$NPM_PREFIX"
npm config set prefix "$NPM_PREFIX"
# Ajouter temporairement au PATH
export PATH="$NPM_PREFIX/bin:$PATH"
# Aller dans le dossier de la bibliothèque
cd ../my-workspace/projects/sae-lib
# Vérifier si package.json existe
if [ ! -f "package.json" ]; then
echo "Erreur: package.json n\'existe pas dans le dossier sae-lib." >&2
exit 1
fi
echo "Création d'un lien npm pour sae-lib..."
npm link
cd ../../../old-sae-airwatch
# Utiliser le lien dans l'application
echo "Utilisation du lien dans l'application old-sae-airwatch..."
npm link sae-lib
echo "Lien créé avec succès. sae-lib est maintenant disponible comme un module npm."

View file

@ -0,0 +1,12 @@
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
import { provideServerRendering, withRoutes } from '@angular/ssr';
import { appConfig } from './app.config';
import { serverRoutes } from './app.routes.server';
const serverConfig: ApplicationConfig = {
providers: [
provideServerRendering(withRoutes(serverRoutes))
]
};
export const config = mergeApplicationConfig(appConfig, serverConfig);

View file

@ -0,0 +1,20 @@
import {ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection, isDevMode} from '@angular/core';
import {provideRouter} from '@angular/router';
import {routes} from './app.routes';
import {provideHttpClient, withFetch} from '@angular/common/http';
import { provideStore } from '@ngrx/store';
import { reducers, metaReducers } from './reducers';
import { provideStoreDevtools } from '@ngrx/store-devtools';
export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
provideHttpClient(withFetch()),
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideStore(reducers, { metaReducers }),
provideStoreDevtools({ maxAge: 25, logOnly: !isDevMode() })
]
};

32
airwatch/src/app/app.html Normal file
View file

@ -0,0 +1,32 @@
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
<!-- * * * * * * * to get started with your project! * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<style>
</style>
<main class="main">
<div class="content">
<h1>Hello, {{ title() }}</h1>
<p>Congratulations! Your app is running. 🎉</p>
</div>
<div aria-label="Divider" class="divider" role="separator"></div>
</main>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<router-outlet/>

View file

@ -0,0 +1,8 @@
import { RenderMode, ServerRoute } from '@angular/ssr';
export const serverRoutes: ServerRoute[] = [
{
path: '**',
renderMode: RenderMode.Prerender
}
];

View file

@ -0,0 +1,46 @@
import {Routes} from '@angular/router';
import {ColorsPage} from './pages/colors-page/colors-page';
import {AirwatchDemo} from './pages/airwatch-demo/airwatch-demo';
import {Csc} from './pages/csc/csc';
import {LayoutDemo} from './pages/layout-demo/layout-demo';
import {TestingApi} from './pages/testing-api/testing-api';
export const routes: Routes = [
{
path: '',
component: LayoutDemo,
title: 'Démo Layout'
},
{
path: 'home',
component: LayoutDemo,
title: 'Démo Layout'
},
{
path: 'grid',
loadComponent: () => import('./pages/grid-demo/grid-demo').then(m => m.GridDemo),
title: 'Démo AG Grid'
},
{
path: 'colors',
component: ColorsPage,
},
{
path: 'airwatch',
component: AirwatchDemo,
},
{
path: 'api-testing',
component: TestingApi,
},
{
path: 'csc',
component: Csc,
},
{
path: '*',
redirectTo: 'home',
pathMatch: 'full'
}
];

View file

View file

@ -0,0 +1,23 @@
import { TestBed } from '@angular/core/testing';
import { App } from './app';
describe('App', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [App],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(App);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it('should render title', () => {
const fixture = TestBed.createComponent(App);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, my-app');
});
});

22
airwatch/src/app/app.ts Normal file
View file

@ -0,0 +1,22 @@
import {Component, signal} from '@angular/core';
import {RouterOutlet} from '@angular/router';
@Component({
selector: 'app-root',
imports: [RouterOutlet],
template: `
<div id="app_main_page">
<main>
<router-outlet/>
</main>
<footer class="main-footer">
</footer>
</div>
`,
styles: [`
`],
})
export class App {
protected readonly title = signal('Exemple de Boutons');
}

View file

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AuthService } from './auth-service';
describe('AuthService', () => {
let service: AuthService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AuthService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,35 @@
import {Injectable} from '@angular/core';
import {Inject} from '@angular/core';
import {DOCUMENT} from '@angular/common';
@Injectable({
providedIn: 'root'
})
export class AuthService {
// check if we have auth at load, or redirect to the given app url
app_check_url: string = "https://example.com/check";
app_auth_url: string = "https://example.com/auth";
auth_data: any = null;
private window: WindowProxy & typeof globalThis | null;
constructor(@Inject(DOCUMENT) private document: Document) {
this.window = this.document.defaultView;
this.checkAuthData()
}
checkAuthData() {
if (this.auth_data) {
fetch(this.app_auth_url).then(resp => {
if (resp.status !== 200) {
this.redirectToAuth()
}
})
}
}
redirectToAuth() {
this.window?.open(this.app_auth_url)
}
}

View file

@ -0,0 +1,70 @@
@use "sae-lib/src/styles/shadows.scss";
@use "sae-lib/src/styles/states.scss";
@use "sae-lib/src/styles/variables.scss";
@use "sass:color";
:host {
display: inline-block;
button {
background: shadows.$primary-color;
color: shadows.$neutral-white;
border-radius: shadows.$radius-main;
padding: 1rem 2rem;
cursor: pointer;
transition: all 0.25s ease;
border: 0;
width: 100%;
margin-top: 8px;
i {
margin-right: 1rem;
}
&:hover, &:active, &:focus {
background: shadows.$main-bg-color-active;
color: shadows.$main-color-active;
transition: all 0.25s ease;
}
// state colors
&.is-primary {
background-color: variables.$primary-color;
color: variables.$neutral-white;
border-color: color.adjust(variables.$primary-color, $lightness: - 10%);
}
&.is-secondary {
background-color: variables.$secondary-color;
color: variables.$neutral-white;
}
&.is-warning {
background: variables.$neutral-white;
color: variables.$warning-color-text;
border: 0;
}
&.is-info {
background: variables.$info-color;
color: variables.$neutral-white;
border-color: color.adjust(variables.$info-color, $lightness: -50%);
}
&.is-success {
background: variables.$success-color;
color: variables.$neutral-white;
border-color: color.adjust(variables.$success-color, $lightness: -50%);
}
&.is-error {
background: rgba(variables.$danger-color, 10%);
color: variables.$danger-color;
border: 0;
}
}
}

View file

@ -0,0 +1,94 @@
import type {Meta, StoryObj} from '@storybook/angular';
import {MainButton} from './main-button';
import {moduleMetadata} from '@storybook/angular';
import {CommonModule} from '@angular/common';
// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
const meta: Meta<MainButton> = {
title: 'UI/Buttons/MainButton',
component: MainButton,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [CommonModule],
providers: []
})
],
argTypes: {
label: {control: 'text'},
icon: {control: 'text'},
kind: {
control: 'select',
options: ['', 'primary', 'secondary', 'info', 'success', 'warning', 'danger'],
description: 'Style du bouton'
},
},
};
export default meta;
type Story = StoryObj<MainButton>;
// More on writing stories with args: https://storybook.js.org/docs/angular/writing-stories/args
export const Primary: Story = {
args: {
label: 'Button',
icon: 'home-line-2',
kind: 'primary'
},
};
export const Secondary: Story = {
args: {
label: 'Secondary Button',
icon: 'settings-line',
kind: 'secondary'
},
};
export const Info: Story = {
args: {
label: 'Info Button',
icon: 'information-line',
kind: 'info'
},
};
export const Success: Story = {
args: {
label: 'Success Button',
icon: 'check-line',
kind: 'success'
},
};
export const Warning: Story = {
args: {
label: 'Warning Button',
icon: 'alert-line',
kind: 'warning'
},
};
export const Danger: Story = {
args: {
label: 'Danger Button',
icon: 'close-circle-line',
kind: 'danger'
},
};
export const WithoutIcon: Story = {
args: {
label: 'Button without icon',
icon: '',
kind: 'primary'
},
};
export const WithIcon: Story = {
args: {
label: 'Button with icon',
icon: 'user-line',
kind: ''
},
};

View file

@ -0,0 +1,28 @@
import {Component, Input} from '@angular/core';
import {CommonModule} from '@angular/common';
export type ButtonKind = '' | 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger';
@Component({
selector: 'app-main-button',
imports: [CommonModule],
template: `
<button class="is-{{kind}}">
@if (icon) {
<i class="ri ri-{{icon}}"></i>
}
<span class="label">
{{ label }}
</span>
</button>
`,
styleUrl: './main-button.scss'
})
export class MainButton {
@Input() label: string = '';
@Input() icon: string = '';
@Input() kind: ButtonKind = '';
}

View file

@ -0,0 +1,384 @@
<div [ngClass]="{
'is-expanded-left': appState.displayConversationListPanelLarge,
'is-small-left': ! appState.displayConversationListPanelLarge,
'is-expanded-right': appState.displaySourcesPanelLarge,
'is-small-right': ! appState.displaySourcesPanelLarge,
}" class="visible-imbrication chatbot-land"
id="layout_demo"
>
<div class="demo-airwatch">
<div class="layout-split">
<nav aria-label="main navigation" class="navbar" role="navigation">
<div class="navbar-start">
<a (click)="toggleSidePanelConversationsList()" class="navbar-item aside-toggle-button">
@if (appState.displayConversationListPanelLarge) {
<i class="ri-sidebar-fold-line"></i>
} @else {
<i class="ri-sidebar-unfold-line"></i>
}
</a>
</div>
<div class="navbar-brand">
<a class="navbar-item" href="/#">
<!-- <i class="ri-robot-2-fill"></i>-->
@if (appState.displayConversationListPanelLarge) {
<img alt="safran logo" class="logo" src="/safran_logo_large.svg">
<span class="label">
airwatch
</span>
} @else {
<img src="safran_logo_small.svg" alt="logo">
}
</a>
<a aria-expanded="false" aria-label="menu" class="navbar-burger" data-target="navbarBasicExample"
role="button">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu" id="airwatchNavigation">
<div class="navbar-end">
<a (click)="toggleSourcesPanel()" class="navbar-item aside-toggle-button">
@if (appState.displaySourcesPanelLarge) {
<i class="ri-layout-right-2-line"></i>
} @else {
<i class="ri-layout-right-line"></i>
}
</a>
<a class="navbar-item is-active">
<i class="ri-chat-4-line"></i>
Ask question
</a>
<a class="navbar-item">
<i class="ri-database-2-line"></i>
Knowledge base
</a>
<a class="navbar-item">
<i class="ri-compass-3-line"></i>
Quick start
</a>
<div class="navbar-item ">
<!-- <div class="navbar-item has-dropdown is-hoverable">-->
<!-- <a aria-expanded="false" aria-haspopup="true" class="navbar-linking">-->
<i class="ri-notification-2-line"></i>
<!-- </a>-->
<!-- <div class="navbar-dropdown">-->
<!-- <a class="navbar-item">-->
<!-- About-->
<!-- </a>-->
<!-- <a class="navbar-item is-selected">-->
<!-- Jobs-->
<!-- </a>-->
<!-- <a class="navbar-item">-->
<!-- Contact-->
<!-- </a>-->
<!-- <hr class="navbar-divider">-->
<!-- <a class="navbar-item">-->
<!-- Report an issue-->
<!-- </a>-->
<!-- </div>-->
</div>
<a class="navbar-item user-account-item">
<i class="ri-layout-right-line"></i>
Borhène
</a>
</div>
</div>
</nav>
<div class="chatbot-container-box">
<main class="columns ">
<div
[ngClass]="{'is-expanded': appState.displayConversationListPanelLarge, 'is-small': ! appState.displayConversationListPanelLarge}"
class="aside column-conversation ">
<div (click)="newChat()" class="new-button">
<i class="ri-chat-ai-line"></i>
<span class="label">
New chat
</span>
</div>
@if (appState.displayConversationListPanelLarge) {
<!-- <div class="search-button is-expanded is-clickable">-->
<!-- <i class="ri-search-line"></i>-->
<!-- <input type="text" class="no-borders" placeholder="Search a chat" value="blah">-->
<!-- <i class="funnel ri-filter-3-line"></i>-->
<!-- </div>-->
} @else {
<div class="search-button is-clickable">
<i class="ri-search-line"></i>
</div>
}
@if (appState.displayConversationListPanelLarge) {
<div class="conversation-container">
@for (conversation of conversationsList; track conversation) {
<div class="conversation-item"
[ngClass]="{'is-active' : conversation.name == activeConversation?.name }"
(click)="updateActiveConversation(conversation)">
<div class="actions">
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
<div class="menu">
<i class="ri-more-line"></i>
</div>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" (click)="copyConversationLink(conversation)">
<i class="ri-link-m"></i>
<span>Share</span>
</a>
<a class="dropdown-item" (click)="toggleVisibleEditInput(conversation)">
<i class="ri-edit-line"></i>
<span>Rename</span>
</a>
<a class="dropdown-item" (click)="pinConversation(conversation)">
<i class="ri-pushpin-fill"></i>
<span>Pin</span>
</a>
<hr class="dropdown-divider">
<a class="dropdown-item trash" (click)="deleteConversation(conversation)">
<i class="ri-delete-bin-line"></i>
<span>Delete</span>
</a>
</div>
</div>
</div>
</div>
<div class="container-text">
@if (conversation.pinned) {
<span class="pinned-icon">
<i class="ri-pushpin-line"></i>
</span>
} @else {
<div class="pinned-icon llm-avatar">
</div>
}
<span class="name">
{{ conversation.name || 'New Conversation' }}
</span>
<span class="date">
{{ conversation.lastMessageDate | date: 'dd/MM/yyyy' }}
</span>
<span class="description">
{{ conversation.description || 'No description' }}
</span>
<input type="text" [(ngModel)]="conversation.name"
[ngClass]="{'is-expanded': ! conversation.visibleInput}">
<!-- <i class="ri-pencil-line" (click)="toggleVisibleEditInput(conversation)"></i>-->
</div>
<div class="active-peak">
<svg width="12" height="14" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 7L0 13.9282V0.0717969L12 7Z" fill="#3B87CC" fill-opacity="0.1"/>
</svg>
</div>
</div>
}
</div>
<app-version-infos [versionInfo]="appVersion"></app-version-infos>
<!-- <div class="admin-actions debug">-->
<!-- <app-theme-selector></app-theme-selector>-->
<!-- <app-language-selector></app-language-selector>-->
<!-- <br>-->
<!-- <app-main-button (click)="changeTheme()" icon="chat-new-line" label="thème"></app-main-button>-->
<!-- <app-main-button (click)="newChat()" icon="chat-new-line" label="nouveau"></app-main-button>-->
<!-- <app-main-button (click)="addMockMessage('user')" icon="user-line"-->
<!-- label="ajout message utilisateur"></app-main-button>-->
<!-- <app-main-button (click)="addMockMessage('llm')" icon="robot-2-line"-->
<!-- label="ajout message llm"></app-main-button>-->
<!-- <app-tuto-tour></app-tuto-tour>-->
<!-- </div>-->
}
</div>
<div class="chat chat-column ">
<div id="newChatBar">
<div class="new-chat-title">
<div class="title">
{{ translate('newChat') }}
</div>
<div class="chips">
@if (displayChipsTitleConversations) {
<div class="chips-container is-grey">
<i class="ri-pushpin-line"></i>
<span class="label">
Auto mode
</span>
</div>
}
</div>
<div class="action">
@if (displayExportConversation) {
<div class="dropdown" [ngClass]="{'is-active': isExportDropdownActive}">
<div class="dropdown-trigger">
<div class="export-chat-button is-clickable" (click)="toggleExportDropdown()">
<i class="ri-download-2-line"></i>
<span class="label">
Export chat
</span>
</div>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" (click)="exportConversation('csv')">
CSV
</a>
<a class="dropdown-item" (click)="exportConversation('excel')">
Excel
</a>
<a class="dropdown-item" (click)="exportConversation('txt')">
TXT
</a>
</div>
</div>
</div>
}
</div>
</div>
</div>
<!-- tchatt-->
@if (!activeConversation?.messages?.length) {
<app-new-input></app-new-input>
} @else {
<div #conversationContainer class="main-conversation-container">
<!-- main-conversation-container-->
<!-- <div class="top-bar">-->
<!-- top bar-->
<!-- <div class="conversation-title">-->
<!-- {{ activeConversation?.name || 'New Conversation' }}-->
<!-- </div>-->
<!-- <div class="conversation-typing">-->
<!-- typing-->
<!-- </div>-->
<!-- </div>-->
<div class="conversation-messages-container">
<app-time-separator></app-time-separator>
@if (activeConversation && activeConversation.messages) {
@for (message of activeConversation.messages; track message) {
<app-message-box [message]="message" [kind]="message.kind"
[content]="message.content"></app-message-box>
}
}
@if (appState.loading) {
<app-loading-notification></app-loading-notification>
}
</div>
<div class="conversation-bottom">
<app-prompt-input></app-prompt-input>
<app-tools-options [alignLeft]="true" [hideDisabledButtons]="true"></app-tools-options>
</div>
</div>
}
<div class="bottom-warning-container">
<app-warning-bugs></app-warning-bugs>
</div>
</div>
<div [ngClass]="{'expanded': appState.displaySourcesPanelLarge}" class="column panel-more">
<div class="has-text-right">
<div [ngClass]="{'is-active': isExportSourcesDropdownActive}" class="dropdown">
<div class="dropdown-trigger">
<div (click)="toggleExportSourcesDropdown()" class="export-chat-button is-clickable">
<i class="ri-download-2-line"></i>
<span class="label">
Export all sources
</span>
</div>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a (click)="exportSources('csv')" class="dropdown-item">
CSV
</a>
<a (click)="exportSources('excel')" class="dropdown-item">
Excel
</a>
<a (click)="exportSources('txt')" class="dropdown-item">
TXT
</a>
</div>
</div>
</div>
</div>
<div class="panel-more-inside">
<div class="main-title">Knowledge Base documents :
<div class="filter">
<i class="ri-download-2-line"></i>
</div>
</div>
<div class="sources-list">
@if (activeConversation && activeConversation.sources && activeConversation.sources.length > 0) {
@for (source of activeConversation.sources; track source) {
<app-source-block [source]="source"></app-source-block>
}
} @else {
<div class="no-sources">
Aucune source disponible
</div>
}
</div>
<div class="bottom-gradient">
</div>
</div>
</div>
<app-feedback-button></app-feedback-button>
</main>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,204 @@
@use "sae-lib/src/styles/variables.scss" as variables;
.panel-more-inside {
border-radius: 10px;
background: #F5F5F5;
padding: 20px 16px;
height: 100vh;
margin-top: 14px;
.main-title {
color: #1E1F22;
font-size: 16px;
font-style: normal;
font-weight: 600;
line-height: normal;
}
.sources-list {
margin-top: 17px;
height: 90vh;
overflow: auto;
}
.source {
border-radius: 4px;
background: #ECF3FA;
}
.bottom-gradient {
border-radius: 8px 8px 0 0;
background: linear-gradient(354deg, #F5F5F5 27.6%, rgba(255, 255, 255, 0.72) 47.82%, rgba(245, 245, 245, 0.00) 72.79%);
}
.filter {
cursor: pointer;
border-radius: 8px;
background: rgba(59, 135, 204, 0.5);
display: flex;
width: 34px;
padding: 10px;
justify-content: center;
align-items: center;
position: absolute;
right: 100px;
top: 170px;
}
}
.chips-container {
display: inline-flex;
padding: 4px 10px 6px 10px;
justify-content: center;
align-items: center;
gap: 10px;
border-radius: 6px;
background: #979797;
margin-left: 12px;
margin-right: 12px;
position: relative;
top: -3px;
i {
color: white;
}
.label {
color: #FFF;
text-align: center;
font-size: 12px;
font-style: normal;
font-weight: 600;
line-height: 8px; /* 66.667% */
}
}
.export-chat-button {
position: relative;
right: 0;
display: inline-flex;
height: 44px;
padding: 0 20px;
justify-content: center;
align-items: center;
gap: 10px;
flex-shrink: 0;
border-radius: 8px;
border: 1px solid #005AA2;
color: #005AA2;
text-align: center;
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: 100px; /* 500% */
&:hover {
background: #005AA2;
color: white;
}
}
// Dropdown styles for export buttons
.dropdown {
position: relative;
display: inline-block;
&.is-active,
&.is-hoverable:hover {
.dropdown-menu {
display: block;
}
}
.dropdown-trigger {
display: inline-block;
}
.dropdown-menu {
display: none;
position: absolute;
z-index: 20;
top: 100%;
right: 0;
min-width: 175px;
background-color: white;
border-radius: 10px;
padding-bottom: 20px;
padding-top: 20px;
margin-top: 2px;
margin-right: 0;
box-shadow: 0 4px 13px 0 rgba(37, 91, 142, 0.10);
}
.dropdown-content {
padding: 0.5rem 0;
}
.dropdown-item {
color: #4a4a4a;
display: block;
font-size: 0.875rem;
line-height: 1.5;
padding: 0.375rem 1rem;
position: relative;
cursor: pointer;
padding-bottom: 20px;
&:hover {
background-color: #f5f5f5;
color: #0a0a0a;
}
&.is-active {
background-color: #3273dc;
color: white;
}
i {
margin-right: 16px;
width: 20px;
height: 20px;
}
hr {
stroke-width: 0.5px;
stroke: #ABABAB;
color: #ABABAB;
border-color: #ABABAB;
margin-bottom: 20px;
}
}
}
.aside-toggle-button {
color: white;
color: #FFF;
font-family: Barlow;
font-size: 18px;
font-style: normal;
font-weight: 500;
line-height: normal;
text-transform: uppercase;
.label {
margin-right: 22px;
}
}
.llm-avatar {
background: white url("./../../../public/chatbot.png") no-repeat center center;
width: 24px;
height: 24px;
border-radius: 8px;
background-size: contain;
margin-right: 10px;
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Chatbot } from './chatbot';
describe('Chatbot', () => {
let component: Chatbot;
let fixture: ComponentFixture<Chatbot>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Chatbot]
})
.compileComponents();
fixture = TestBed.createComponent(Chatbot);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,105 @@
import type {Meta, StoryObj} from '@storybook/angular';
import {moduleMetadata} from '@storybook/angular';
import {Chatbot} from './chatbot';
import {Store, StoreModule} from '@ngrx/store';
import {reducers} from '../reducers';
import {ConversationsService} from '../services/conversations.service';
import {ApiService} from '../services/api-service';
import {HttpClientModule} from '@angular/common/http';
import {TranslationService} from '../services/translation.service';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PromptInput} from './prompt-input/prompt-input';
import {MessageBox} from './message-box/message-box';
import {NewInput} from './new-input/new-input';
import {FeedbackButton} from './feedback-button/feedback-button';
import {WarningBugs} from './warning-bugs/warning-bugs';
import {VersionInfos} from './version-infos/version-infos';
import {LoadingNotification} from './loading-notification/loading-notification';
import {SourceBlock} from './source-block/source-block';
import {ToolsOptions} from './tools-options/tools-options';
const appReducer = reducers.app;
const meta: Meta<Chatbot> = {
title: 'App/Features/Chatbot',
component: Chatbot,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [
CommonModule,
FormsModule,
HttpClientModule,
StoreModule.forRoot({app: appReducer as any}),
PromptInput,
MessageBox,
NewInput,
FeedbackButton,
WarningBugs,
VersionInfos,
LoadingNotification,
SourceBlock,
ToolsOptions,
],
providers: [
ConversationsService,
ApiService,
TranslationService,
Store
]
})
],
parameters: {
layout: 'fullscreen',
}
};
export default meta;
type Story = StoryObj<Chatbot>;
export const Default: Story = {
args: {
// Les propriétés sont injectées par les services
}
};
export const DemoMode: Story = {
args: {
// Les propriétés sont injectées par les services
},
parameters: {
store: {
init: (store: Store) => {
store.dispatch({
type: 'UPDATE_APP',
payload: {
demoMode: true,
displayConversationListPanelLarge: true,
displaySourcesPanelLarge: true
}
});
}
}
}
};
export const CompactView: Story = {
args: {
// Les propriétés sont injectées par les services
},
parameters: {
store: {
init: (store: Store) => {
store.dispatch({
type: 'UPDATE_APP',
payload: {
demoMode: true,
displayConversationListPanelLarge: false,
displaySourcesPanelLarge: false
}
});
}
}
}
};

View file

@ -0,0 +1,417 @@
import {AfterViewChecked, Component, ElementRef, ViewChild} from '@angular/core';
import {PromptInput} from './prompt-input/prompt-input';
import {MessageBox} from './message-box/message-box';
import {NewInput} from './new-input/new-input';
import {FeedbackButton} from './feedback-button/feedback-button';
import {WarningBugs} from './warning-bugs/warning-bugs';
import {VersionInfos} from './version-infos/version-infos';
import {LoadingNotification} from './loading-notification/loading-notification';
import {SourceBlock} from './source-block/source-block';
import {ChatbotConversation, ChatbotSource, ConversationsService} from '../services/conversations.service';
import {Store} from '@ngrx/store';
import {ActionTypes, StateInterface} from '../reducers';
import {FormsModule} from '@angular/forms';
import {ApiService} from '../services/api-service';
import {CommonModule} from '@angular/common';
import {ChatbotMessage, ChatbotMessageKind} from '../services/chatbot.message.type';
import {ToolsOptions} from './tools-options/tools-options';
import {TranslationService} from '../services/translation.service';
import {TimeSeparator} from './time-separator/time-separator';
@Component({
selector: 'app-chatbot',
imports: [
PromptInput,
MessageBox,
NewInput,
FeedbackButton,
WarningBugs,
VersionInfos,
LoadingNotification,
SourceBlock,
FormsModule,
CommonModule,
ToolsOptions,
TimeSeparator,
],
templateUrl: './chatbot.html',
styleUrl: './chatbot.scss'
})
export class Chatbot implements AfterViewChecked {
public conversationsList: Array<ChatbotConversation> = [];
public activeConversation: ChatbotConversation | null = null;
public appVersion: string = '';
public appState: any = '';
conversationName: any;
// fonctions d'exports
visibleInput: boolean = false;
// demo tour lors du premier chargement
displayChipsTitleConversations = true;
displayExportConversation: boolean = true;
isExportDropdownActive: boolean = false;
isExportSourcesDropdownActive: boolean = false;
@ViewChild('conversationContainer') private conversationContainer: ElementRef | null = null;
private shouldScrollToBottom: boolean = false;
constructor(
private conversations: ConversationsService,
private apiService: ApiService,
private store: Store<StateInterface>,
private translationService: TranslationService
) {
// Initialize conversations in the store
this.store.dispatch({
type: ActionTypes.UPDATE_CONVERSATIONS_LIST,
payload: conversations.chatbotConversations
});
// Subscribe to conversations list from store
this.store.select(state => state.conversationsList).subscribe(convList => {
this.conversationsList = convList;
if (!this.conversationsList.length) {
this.newChat();
}
});
// Subscribe to active conversation from store
this.store.select(state => state.activeConversation).subscribe(activeConv => {
if (activeConv && Object.keys(activeConv).length > 0) {
const prevMessagesLength = this.activeConversation?.messages?.length || 0;
this.activeConversation = activeConv as ChatbotConversation;
const newMessagesLength = this.activeConversation?.messages?.length || 0;
console.log('prevMessagesLength', prevMessagesLength, newMessagesLength);
// Set flag to scroll to bottom when active conversation changes or when messages are added
if (prevMessagesLength !== newMessagesLength) {
this.shouldScrollToBottom = true;
}
} else if (this.conversationsList.length > 0) {
this.updateActiveConversation(this.conversationsList[0]);
}
});
// Get app version from store
this.store.select(state => state.app.version).subscribe(version => {
this.appVersion = version;
});
// Get app state from store
this.store.select(state => state.app).subscribe(app => {
this.appState = app;
});
// à désactiver en mode production
this.demoConversation();
}
/**
* Lifecycle hook that is called after the view has been checked
* Used to scroll to the bottom of the conversation container when needed
*/
ngAfterViewChecked(): void {
if (this.shouldScrollToBottom && this.conversationContainer) {
this.scrollToBottom();
this.shouldScrollToBottom = false;
}
}
/**
* Translates a key using the translation service
* @param key The key to translate
* @param defaultValue Optional default value if translation is not found
* @returns The translated string
*/
translate(key: string, defaultValue?: string): string {
return this.translationService.translate(key, defaultValue);
}
demoConversation() {
// Add example sources if in demo mode
if (this.appState.demoMode && this.activeConversation) {
console.log('mode démo: on ajoute des demoConversation');
// Create a proper instance of ChatbotConversation from the active conversation
const updatedConversation: ChatbotConversation = ChatbotConversation.fromObject(this.activeConversation);
this.addMockMessage("user");
// Add three example sources
const conversation2 = new ChatbotConversation();
conversation2.name = "Liste de courses";
conversation2.addMessage(new ChatbotMessage({
kind: 'user',
user: {},
content: "Comment puis-je utiliser cette application?",
name: "User"
}));
conversation2.addMessage(new ChatbotMessage({
kind: 'llm',
user: {},
content: "The documents also highlight various post- incident safety measures implemented, including improved training procedures, enhanced maintenance protocols, and aircraft design modifications. Regulatory agencies such as the NTSB, BEA, AAIB, and others were involved in investigating these incidents and making safety recommendations.\n" +
"This summary provides an overview of significant aviation incidents, their causes, and outcomes, which may be useful for understanding patterns in aircraft accidents and areas for improving aviation safety.\n" +
"<br/>" +
"Internet Search Not Activated.<br/>" +
"No internet search was activated for this query<br/>" +
"<br/>" +
"Search results.",
name: "Assistant"
}));
let source1 = new ChatbotSource();
source1.title = "abc-1258.pdf";
source1.url = "https://example.com/source1";
source1.description = "Admittedly Air Traffic Control in smaller airports are being effected by ...";
let source2 = new ChatbotSource();
source2.title = "abc-45689.pdf";
source2.url = "https://example.com/source1";
source2.description = "DE GAGNE DATE: JANUARY 18, 2008 VEN #: V6-CAW-M2700-10 APPROVED BY: MARTIN SWAN DATE: FEBRUARY 5, 2008 -TITLE- DHC-6 ELEVATOR CONTROL CABLE WEAR SURVEY RESULTS ISSUE: 2 PAGE 2 respondents, representing 16 aircraft, operate outside the tropics and have a cycle/hour ratio of 1.6 to 2.8. Most respondents have reported that carbon steel elevator control cables are more wear resistant than stainless steel cables. Two operators in the tropics, representing 39 aircraft, use.\n" +
"I remember having reconunended while dealing with the Guwahati crash in regard to a Vayudoot aircraft that the National Airports Authority should ensure that only trained and";
conversation2.sources = [source1, source2, source2, source2, source2, source2, source2, source2, source2, source2, source2, source2, source2];
// Update the active conversation in the store
this.updateActiveConversation(updatedConversation);
// Update the conversations list in the store
const updatedList = this.conversationsList.map(conv =>
conv === this.activeConversation ? updatedConversation : conv
);
updatedList.push(conversation2)
this.store.dispatch({
type: ActionTypes.UPDATE_CONVERSATIONS_LIST,
payload: updatedList
});
// Set the first conversation as active
this.updateActiveConversation(updatedConversation);
}
}
updateActiveConversation(conversation: ChatbotConversation) {
this.store.dispatch({
type: ActionTypes.UPDATE_ACTIVE_CONVERSATION,
payload: conversation
});
}
addMockMessage(kind: ChatbotMessageKind, content?: string) {
if (this.activeConversation) {
// Create a proper instance of ChatbotConversation from the active conversation
const updatedConversation = ChatbotConversation.fromObject(this.activeConversation);
// Add the message to the copy
updatedConversation.addMessage(new ChatbotMessage({
kind: kind,
user: {},
content: content ? content : "blah",
name: "Mock Message"
}));
// Update the active conversation in the store
this.updateActiveConversation(updatedConversation);
// Update the conversations list in the store
const updatedList = this.conversationsList.map(conv =>
conv === this.activeConversation ? updatedConversation : conv
);
this.store.dispatch({
type: ActionTypes.UPDATE_CONVERSATIONS_LIST,
payload: updatedList
});
// Set flag to scroll to bottom after adding a message
this.shouldScrollToBottom = true;
}
}
newChat() {
const newConv = new ChatbotConversation();
newConv.name = "Other conversation " + (this.conversationsList.length + 1);
// Update the conversations list in the store by adding the new conversation to the existing list
this.store.dispatch({
type: ActionTypes.UPDATE_CONVERSATIONS_LIST,
payload: [...this.conversationsList, newConv]
});
// Set the new conversation as active
this.updateActiveConversation(newConv);
}
toggleSidePanelConversationsList() {
this.store.dispatch({
type: ActionTypes.UPDATE_APP,
payload: {
displayConversationListPanelLarge: !this.appState.displayConversationListPanelLarge
}
});
}
toggleSourcesPanel() {
this.store.dispatch({
type: ActionTypes.UPDATE_APP,
payload: {
displaySourcesPanelLarge: !this.appState.displaySourcesPanelLarge
}
});
}
launchDemoTour() {
}
endDemoTour() {
}
toggleExportDropdown() {
this.isExportDropdownActive = !this.isExportDropdownActive;
// Close the other dropdown if it's open
if (this.isExportDropdownActive) {
this.isExportSourcesDropdownActive = false;
}
}
toggleExportSourcesDropdown() {
this.isExportSourcesDropdownActive = !this.isExportSourcesDropdownActive;
// Close the other dropdown if it's open
if (this.isExportSourcesDropdownActive) {
this.isExportDropdownActive = false;
}
}
exportMessage() {
// This method is kept for backward compatibility
this.exportConversation('txt');
}
exportConversation(format: 'csv' | 'excel' | 'txt') {
console.log(`Exporting conversation in ${format} format`);
// Close the dropdown after selection
this.isExportDropdownActive = false;
if (!this.activeConversation) {
console.error('No active conversation to export');
return;
}
// Implementation will depend on the specific requirements
// This is a placeholder for the actual export functionality
switch (format) {
case 'csv':
// Export as CSV
console.log('TODO Exporting as CSV');
break;
case 'excel':
// Export as Excel
console.log('TODO Exporting as Excel');
break;
case 'txt':
// Export as TXT
console.log('TODO Exporting as TXT');
break;
}
}
exportSources(format: 'csv' | 'excel' | 'txt') {
console.log(`Exporting sources in ${format} format`);
// Close the dropdown after selection
this.isExportSourcesDropdownActive = false;
if (!this.activeConversation || !this.activeConversation.sources || this.activeConversation.sources.length === 0) {
console.error('No sources to export');
return;
}
// Implementation will depend on the specific requirements
// This is a placeholder for the actual export functionality
switch (format) {
case 'csv':
// Export as CSV
console.log('Exporting sources as CSV');
break;
case 'excel':
// Export as Excel
console.log('Exporting sources as Excel');
break;
case 'txt':
// Export as TXT
console.log('Exporting sources as TXT');
break;
}
}
copyToClipboard(text: string) {
// Implementation for copying to clipboard
}
toggleVisibleEditInput(conversation: ChatbotConversation) {
// Create a copy of the conversation
const updatedConversation = ChatbotConversation.fromObject(conversation);
// Toggle the visibleInput property
updatedConversation.visibleInput = !conversation.visibleInput;
// Update the active conversation if this is the active one
if (this.activeConversation === conversation) {
this.updateActiveConversation(updatedConversation);
}
// Update the single conversation in the store without replacing the entire list
this.store.dispatch({
type: ActionTypes.UPDATE_SINGLE_CONVERSATION,
payload: {
conversation: updatedConversation
}
});
}
changeTheme() {
// Dispatch the action to switch to the next theme
this.store.dispatch({type: ActionTypes.SWITCH_TO_NEXT_THEME});
}
changeLang() {
// Dispatch the action to switch to the next language
this.store.dispatch({type: ActionTypes.SWITCH_TO_NEXT_LANGUAGE});
}
pinConversation(conversation: ChatbotConversation) {
conversation.pinned = !conversation.pinned;
}
copyConversationLink(conversation: ChatbotConversation) {
console.log('todo copy conversation link', conversation);
}
deleteConversation(conversation: ChatbotConversation) {
console.log('todo delete conversation', conversation);
}
/**
* Scrolls to the bottom of the conversation container
*/
private scrollToBottom(): void {
try {
const element = this.conversationContainer?.nativeElement;
if (element) {
element.scrollTop = element.scrollHeight;
}
} catch (err) {
console.error('Error scrolling to bottom:', err);
}
}
}

View file

@ -0,0 +1,65 @@
<div class="conversation-item"
[ngClass]="{'is-active': isActive}"
(click)="selectConversation()">
<div class="actions">
<div class="dropdown is-hoverable">
<div class="dropdown-trigger">
<div class="menu">
<i class="ri-more-2-line"></i>
</div>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" (click)="shareConversation($event)">
<i class="ri-link-m"></i>
<span>Share</span>
</a>
<a class="dropdown-item" (click)="renameConversation($event)">
<i class="ri-edit-line"></i>
<span>Rename</span>
</a>
<a class="dropdown-item" (click)="pinConversation($event)">
<i class="ri-pushpin-fill"></i>
<span>Pin</span>
</a>
<hr class="dropdown-divider">
<a class="dropdown-item trash" (click)="deleteConversation($event)">
<i class="ri-delete-bin-line"></i>
<span>Delete</span>
</a>
</div>
</div>
</div>
</div>
<div class="container-text">
<ng-container *ngIf="conversation.pinned; else avatarTemplate">
<span class="pinned-icon">
<i class="ri-pushpin-line"></i>
</span>
</ng-container>
<ng-template #avatarTemplate>
<div class="pinned-icon llm-avatar"></div>
</ng-template>
<span class="name">
{{ conversation.name || 'New Conversation' }}
</span>
<span class="date">
{{ conversation.lastMessageDate | date: 'dd/MM/yyyy' }}
</span>
<span class="description">
{{ conversation.description || 'No description' }}
</span>
<input type="text" [(ngModel)]="conversation.name"
[ngClass]="{'is-visible': conversation.visibleInput}">
</div>
<div class="active-peak">
<svg width="12" height="14" viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 7L0 13.9282V0.0717969L12 7Z" fill="#3B87CC" fill-opacity="0.1"/>
</svg>
</div>
</div>

View file

@ -0,0 +1,186 @@
.conversation-item {
margin-bottom: 16px;
margin-top: 16px;
padding: 16px 16px 18px 32px;
cursor: pointer;
border-radius: 8px;
color: #6D717C;
.actions {
width: 28px;
height: 28px;
border-radius: 6px;
background: #B9D6ED;
position: relative;
top: 0;
right: 0;
float: right;
.menu {
cursor: pointer;
text-align: right;
i {
font-size: 1.2rem;
}
}
.dropdown {
.dropdown-menu {
right: 0;
left: auto;
}
.dropdown-item {
i {
margin-right: 0.5rem;
}
}
&.is-hoverable:hover {
.dropdown-menu {
display: block;
}
}
}
.trash {
color: red;
fill: red;
}
}
&:hover {
background: #3B87CC1A;
}
&.is-active {
background: rgba(#3B87CC1A, 10%);
font-weight: 600;
.active-peak {
position: relative;
right: calc(-100% - 16px);
top: -35px;
visibility: visible;
}
}
.pinned-icon {
position: relative;
left: -1.7em;
i {
color: #FEC553;
fill: #FEC553;
}
}
.active-peak {
visibility: hidden;
}
.name {
color: #1E1F22;
font-size: 14px;
font-weight: 600;
display: block;
margin-bottom: 4px;
margin-top: -1.5em;
margin-left: 0;
}
.description {
color: #6D717C;
font-size: 12px;
font-weight: 400;
line-height: 20px;
margin-right: 4px;
}
.date {
color: rgba(#5F5F5F99, 60%);
float: right;
text-align: right;
font-family: Barlow;
font-size: 10px;
font-style: normal;
font-weight: 400;
line-height: 8px;
margin-top: -1.5em;
}
input {
display: none;
&.is-visible {
display: block;
}
}
}
// Dropdown styles
.dropdown {
position: relative;
display: inline-block;
&.is-active,
&.is-hoverable:hover {
.dropdown-menu {
display: block;
}
}
.dropdown-trigger {
display: inline-block;
}
.dropdown-menu {
display: none;
position: absolute;
z-index: 20;
top: 100%;
right: 0;
min-width: 12rem;
background-color: white;
border-radius: 4px;
box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02);
padding-bottom: 0.5rem;
padding-top: 0.5rem;
margin-top: 0.25rem;
}
.dropdown-content {
padding: 0.5rem 0;
}
.dropdown-item {
color: #4a4a4a;
display: block;
font-size: 0.875rem;
line-height: 1.5;
padding: 0.375rem 1rem;
position: relative;
cursor: pointer;
&:hover {
background-color: #f5f5f5;
color: #0a0a0a;
}
&.is-active {
background-color: #3273dc;
color: white;
}
}
}
// LLM avatar
.llm-avatar {
background: white;
width: 24px;
height: 24px;
border-radius: 8px;
background-size: contain;
margin-right: 10px;
}

View file

@ -0,0 +1,75 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ConversationItem } from './conversation-item';
import { moduleMetadata } from '@storybook/angular';
import { NgClass, NgIf, DatePipe } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ChatbotConversation } from '../../services/conversations.service';
// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
const meta: Meta<ConversationItem> = {
title: 'Chatbot/Conversation/ConversationItem',
component: ConversationItem,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [NgClass, NgIf, DatePipe, FormsModule],
providers: []
})
],
argTypes: {
isActive: { control: 'boolean' },
onSelect: { action: 'selected' },
onShare: { action: 'shared' },
onRename: { action: 'renamed' },
onPin: { action: 'pinned' },
onDelete: { action: 'deleted' }
},
};
export default meta;
type Story = StoryObj<ConversationItem>;
// Create a mock conversation
const createMockConversation = (name: string, description: string, pinned: boolean = false): ChatbotConversation => {
const conversation = new ChatbotConversation();
conversation.name = name;
conversation.description = description;
conversation.pinned = pinned;
conversation.lastMessageDate = new Date();
return conversation;
};
// Default story
export const Default: Story = {
args: {
conversation: createMockConversation('Project Discussion', 'Latest updates on the project timeline'),
isActive: false
},
};
// Active conversation
export const Active: Story = {
args: {
conversation: createMockConversation('Project Discussion', 'Latest updates on the project timeline'),
isActive: true
},
};
// Pinned conversation
export const Pinned: Story = {
args: {
conversation: createMockConversation('Important Meeting', 'CEO quarterly update', true),
isActive: false
},
};
// Long name and description
export const LongContent: Story = {
args: {
conversation: createMockConversation(
'Very Long Conversation Name That Should Truncate',
'This is a very long description that should demonstrate how the component handles overflow text in the description area of the conversation item component',
),
isActive: false
},
};

View file

@ -0,0 +1,52 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { NgClass, NgIf, DatePipe } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ChatbotConversation } from '../../services/conversations.service';
@Component({
selector: 'app-conversation-item',
standalone: true,
imports: [NgClass, NgIf, DatePipe, FormsModule],
templateUrl: './conversation-item.html',
styleUrl: './conversation-item.scss'
})
export class ConversationItem {
@Input() conversation: ChatbotConversation = new ChatbotConversation();
@Input() isActive: boolean = false;
@Output() onSelect = new EventEmitter<ChatbotConversation>();
@Output() onShare = new EventEmitter<ChatbotConversation>();
@Output() onRename = new EventEmitter<ChatbotConversation>();
@Output() onPin = new EventEmitter<ChatbotConversation>();
@Output() onDelete = new EventEmitter<ChatbotConversation>();
isDropdownActive: boolean = false;
toggleDropdown() {
this.isDropdownActive = !this.isDropdownActive;
}
selectConversation() {
this.onSelect.emit(this.conversation);
}
shareConversation(event: Event) {
event.stopPropagation();
this.onShare.emit(this.conversation);
}
renameConversation(event: Event) {
event.stopPropagation();
this.onRename.emit(this.conversation);
}
pinConversation(event: Event) {
event.stopPropagation();
this.onPin.emit(this.conversation);
}
deleteConversation(event: Event) {
event.stopPropagation();
this.onDelete.emit(this.conversation);
}
}

View file

@ -0,0 +1,23 @@
<div class="dropdown" [ngClass]="{'is-active': isDropdownActive}">
<div class="dropdown-trigger">
<div class="export-chat-button is-clickable" (click)="toggleDropdown()">
<i class="ri-download-2-line"></i>
<span class="label">
Export chat
</span>
</div>
</div>
<div class="dropdown-menu" role="menu">
<div class="dropdown-content">
<a class="dropdown-item" (click)="exportAs('csv', $event)">
CSV
</a>
<a class="dropdown-item" (click)="exportAs('excel', $event)">
Excel
</a>
<a class="dropdown-item" (click)="exportAs('txt', $event)">
TXT
</a>
</div>
</div>
</div>

View file

@ -0,0 +1,85 @@
.export-chat-button {
position: relative;
right: 0;
display: inline-flex;
height: 44px;
padding: 0 20px;
justify-content: center;
align-items: center;
gap: 10px;
flex-shrink: 0;
border-radius: 8px;
border: 1px solid #005AA2;
color: #005AA2;
text-align: center;
font-size: 20px;
font-style: normal;
font-weight: 500;
line-height: 100px; /* 500% */
&:hover {
background: #005AA2;
color: white;
}
.label {
font-size: 14px;
line-height: normal;
}
}
// Dropdown styles
.dropdown {
position: relative;
display: inline-block;
&.is-active,
&.is-hoverable:hover {
.dropdown-menu {
display: block;
}
}
.dropdown-trigger {
display: inline-block;
}
.dropdown-menu {
display: none;
position: absolute;
z-index: 20;
top: 100%;
right: 0;
min-width: 12rem;
background-color: white;
border-radius: 4px;
box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02);
padding-bottom: 0.5rem;
padding-top: 0.5rem;
margin-top: 0.25rem;
}
.dropdown-content {
padding: 0.5rem 0;
}
.dropdown-item {
color: #4a4a4a;
display: block;
font-size: 0.875rem;
line-height: 1.5;
padding: 0.375rem 1rem;
position: relative;
cursor: pointer;
&:hover {
background-color: #f5f5f5;
color: #0a0a0a;
}
&.is-active {
background-color: #3273dc;
color: white;
}
}
}

View file

@ -0,0 +1,61 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { ExportChatButton } from './export-chat-button';
import { moduleMetadata } from '@storybook/angular';
import { NgClass } from '@angular/common';
// More on how to set up stories at: https://storybook.js.org/docs/angular/writing-stories/introduction
const meta: Meta<ExportChatButton> = {
title: 'Chatbot/Actions/ExportChatButton',
component: ExportChatButton,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [NgClass],
providers: []
})
],
argTypes: {
onExport: { action: 'exported' }
},
};
export default meta;
type Story = StoryObj<ExportChatButton>;
// Default state
export const Default: Story = {
args: {},
};
// Active dropdown
export const ActiveDropdown: Story = {
args: {},
play: async ({ canvasElement, component }) => {
// Simulate clicking the button to open the dropdown
component.isDropdownActive = true;
},
};
// Custom story to demonstrate hover state
export const HoverState: Story = {
args: {},
parameters: {
docs: {
description: {
story: 'Hover over the button to see the hover state. The button background changes to blue and text becomes white.'
}
}
}
};
// Custom story to demonstrate the export functionality
export const ExportFunctionality: Story = {
args: {},
parameters: {
docs: {
description: {
story: 'Click on the button to open the dropdown, then select a format to export. The onExport event will be emitted with the selected format.'
}
}
}
};

View file

@ -0,0 +1,27 @@
import { Component, Output, EventEmitter } from '@angular/core';
import { NgClass } from '@angular/common';
export type ExportFormat = 'csv' | 'excel' | 'txt';
@Component({
selector: 'app-export-chat-button',
standalone: true,
imports: [NgClass],
templateUrl: './export-chat-button.html',
styleUrl: './export-chat-button.scss'
})
export class ExportChatButton {
@Output() onExport = new EventEmitter<ExportFormat>();
isDropdownActive: boolean = false;
toggleDropdown() {
this.isDropdownActive = !this.isDropdownActive;
}
exportAs(format: ExportFormat, event: Event) {
event.stopPropagation();
this.onExport.emit(format);
this.isDropdownActive = false;
}
}

View file

@ -0,0 +1,67 @@
<div class="feedback-button" (click)="toggleModal()">
<span class="text">
Feedback
</span>
<i class="ri-message-2-line"></i>
</div>
<!-- Feedback Modal -->
@if (isModalOpen) {
<div class="feedback-modal-overlay">
<div class="feedback-modal">
<div class="modal-header">
<h3>Send Feedback</h3>
<button class="close-button" (click)="toggleModal()">
<i class="ri-close-line"></i>
</button>
</div>
<div class="modal-body">
<p class="modal-description">
Help us improve by sharing your feedback, suggestions, or reporting issues.
</p>
<textarea
[(ngModel)]="feedbackText"
placeholder="Enter your feedback here..."
[disabled]="isSubmitting"
rows="5"
></textarea>
@if (submitSuccess) {
<div class="success-message">
<i class="ri-check-line"></i> Thank you for your feedback!
</div>
}
@if (submitError) {
<div class="error-message">
<i class="ri-error-warning-line"></i> Failed to submit feedback. Please try again.
</div>
}
</div>
<div class="modal-footer">
<button
class="cancel-button"
(click)="toggleModal()"
[disabled]="isSubmitting"
>
Cancel
</button>
<button
class="submit-button"
(click)="submitFeedback()"
[disabled]="isSubmitting || !feedbackText.trim()"
>
@if (isSubmitting) {
<i class="ri-loader-4-line spinning"></i> Sending...
} @else {
Send Feedback
}
</button>
</div>
</div>
</div>
}

View file

@ -0,0 +1,191 @@
.feedback-button {
background: #ecf3fa;
color: #083b7d;
padding: 12px;
border-radius: 8px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
transform: rotate(270deg);
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
margin-right: -35px;
position: fixed;
right: 0;
top: 197px;
z-index: 100;
&:hover {
background: #d9e8f6;
}
i {
font-size: 16px;
}
}
// Modal styles
.feedback-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.feedback-modal {
background: white;
border-radius: 8px;
width: 90%;
max-width: 500px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
display: flex;
flex-direction: column;
max-height: 90vh;
overflow: hidden;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 20px;
border-bottom: 1px solid #eee;
h3 {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #083b7d;
}
.close-button {
background: none;
border: none;
cursor: pointer;
font-size: 20px;
color: #666;
padding: 4px;
&:hover {
color: #333;
}
}
}
.modal-body {
padding: 20px;
overflow-y: auto;
.modal-description {
margin-bottom: 16px;
color: #555;
}
textarea {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 4px;
resize: vertical;
font-family: inherit;
font-size: 14px;
&:focus {
outline: none;
border-color: #083b7d;
}
&:disabled {
background-color: #f5f5f5;
cursor: not-allowed;
}
}
.success-message, .error-message {
margin-top: 16px;
padding: 10px;
border-radius: 4px;
display: flex;
align-items: center;
gap: 8px;
i {
font-size: 18px;
}
}
.success-message {
background-color: #e6f7e6;
color: #2e7d32;
}
.error-message {
background-color: #fdecea;
color: #d32f2f;
}
}
.modal-footer {
padding: 16px 20px;
border-top: 1px solid #eee;
display: flex;
justify-content: flex-end;
gap: 12px;
button {
padding: 8px 16px;
border-radius: 4px;
font-weight: 500;
cursor: pointer;
&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
.cancel-button {
background: none;
border: 1px solid #ddd;
color: #555;
&:hover:not(:disabled) {
background-color: #f5f5f5;
}
}
.submit-button {
background-color: #083b7d;
color: white;
border: none;
display: flex;
align-items: center;
gap: 8px;
&:hover:not(:disabled) {
background-color: #062c5e;
}
}
}
// Spinner animation
.spinning {
animation: spin 1s linear infinite;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FeedbackButton } from './feedback-button';
describe('FeedbackButton', () => {
let component: FeedbackButton;
let fixture: ComponentFixture<FeedbackButton>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [FeedbackButton]
})
.compileComponents();
fixture = TestBed.createComponent(FeedbackButton);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,131 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { FeedbackButton } from './feedback-button';
import { moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Store, StoreModule } from '@ngrx/store';
import { ApiService } from '../../services/api-service';
import { reducers } from '../../reducers';
// Mock ApiService
class MockApiService {
async sendUserFeedback(feedback: string): Promise<any> {
// Simulate API call
return new Promise((resolve) => {
setTimeout(() => {
resolve({ success: true });
}, 1000);
});
}
}
const meta: Meta<FeedbackButton> = {
title: 'UI/Feedback/FeedbackButton',
component: FeedbackButton,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [
CommonModule,
FormsModule,
StoreModule.forRoot(reducers)
],
providers: [
Store,
{ provide: ApiService, useClass: MockApiService }
]
})
],
argTypes: {
isModalOpen: {
control: 'boolean',
description: 'Whether the feedback modal is open'
},
feedbackText: {
control: 'text',
description: 'The feedback text entered by the user'
},
isSubmitting: {
control: 'boolean',
description: 'Whether the feedback is being submitted'
},
submitSuccess: {
control: 'boolean',
description: 'Whether the feedback was submitted successfully'
},
submitError: {
control: 'boolean',
description: 'Whether there was an error submitting the feedback'
}
}
};
export default meta;
type Story = StoryObj<FeedbackButton>;
// Default state - just the button
export const Default: Story = {
args: {
isModalOpen: false,
feedbackText: '',
isSubmitting: false,
submitSuccess: false,
submitError: false
}
};
// Modal open state
export const ModalOpen: Story = {
args: {
isModalOpen: true,
feedbackText: '',
isSubmitting: false,
submitSuccess: false,
submitError: false
}
};
// Modal with text entered
export const WithFeedbackText: Story = {
args: {
isModalOpen: true,
feedbackText: 'This is some feedback text that the user has entered.',
isSubmitting: false,
submitSuccess: false,
submitError: false
}
};
// Submitting state
export const Submitting: Story = {
args: {
isModalOpen: true,
feedbackText: 'This is some feedback text that the user has entered.',
isSubmitting: true,
submitSuccess: false,
submitError: false
}
};
// Success state
export const SubmitSuccess: Story = {
args: {
isModalOpen: true,
feedbackText: 'This is some feedback text that the user has entered.',
isSubmitting: false,
submitSuccess: true,
submitError: false
}
};
// Error state
export const SubmitError: Story = {
args: {
isModalOpen: true,
feedbackText: 'This is some feedback text that the user has entered.',
isSubmitting: false,
submitSuccess: false,
submitError: true
}
};

View file

@ -0,0 +1,89 @@
import {Component} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {Store} from '@ngrx/store';
import {ApiService} from '../../services/api-service';
import {ActionTypes, StateInterface} from '../../reducers';
@Component({
selector: 'app-feedback-button',
imports: [CommonModule, FormsModule],
templateUrl: './feedback-button.html',
styleUrl: './feedback-button.scss'
})
export class FeedbackButton {
isModalOpen: boolean = false;
feedbackText: string = '';
isSubmitting: boolean = false;
submitSuccess: boolean = false;
submitError: boolean = false;
constructor(
private store: Store<StateInterface>,
private apiService: ApiService
) {
}
toggleModal() {
this.isModalOpen = !this.isModalOpen;
// Reset state when opening modal
if (this.isModalOpen) {
this.feedbackText = '';
this.submitSuccess = false;
this.submitError = false;
}
// Update app state to show/hide feedback panel
this.store.dispatch({
type: ActionTypes.UPDATE_APP,
payload: {
displayFeedBackPanel: this.isModalOpen,
feedBackInput: this.feedbackText
}
});
}
async submitFeedback() {
if (!this.feedbackText.trim()) {
return; // Don't submit empty feedback
}
this.isSubmitting = true;
this.submitSuccess = false;
this.submitError = false;
try {
// Update Redux state with feedback text
this.store.dispatch({
type: ActionTypes.UPDATE_APP,
payload: {
feedBackInput: this.feedbackText
}
});
// Dispatch action to send feedback
this.store.dispatch({
type: ActionTypes.SEND_USER_FEEDBACK,
payload: {
feedback: this.feedbackText
}
});
// Call API service directly
await this.apiService.sendUserFeedback(this.feedbackText);
this.submitSuccess = true;
// Close modal after a short delay
setTimeout(() => {
this.toggleModal();
}, 2000);
} catch (error) {
console.error('Error submitting feedback:', error);
this.submitError = true;
} finally {
this.isSubmitting = false;
}
}
}

View file

@ -0,0 +1 @@
<p>feedback-message works!</p>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FeedbackMessage } from './feedback-message';
describe('FeedbackMessage', () => {
let component: FeedbackMessage;
let fixture: ComponentFixture<FeedbackMessage>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [FeedbackMessage]
})
.compileComponents();
fixture = TestBed.createComponent(FeedbackMessage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-feedback-message',
imports: [],
templateUrl: './feedback-message.html',
styleUrl: './feedback-message.scss'
})
export class FeedbackMessage {
}

View file

@ -0,0 +1,9 @@
<div class="language-selector">
<button
(click)="switchToNextLanguage()"
class="language-selector__button"
title="Switch to next language">
<span class="language-selector__current-lang">{{ getLanguageDisplayName(currentLang) }}</span>
<span class="language-selector__icon">🌐</span>
</button>
</div>

View file

@ -0,0 +1,56 @@
.language-selector {
display: inline-block;
margin: 10px;
&__button {
display: flex;
align-items: center;
padding: 8px 12px;
background-color: #f0f0f0;
border: 1px solid #ccc;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s ease;
&:hover {
background-color: #e0e0e0;
}
&:active {
transform: translateY(1px);
}
}
&__current-lang {
margin-right: 8px;
text-transform: capitalize;
}
&__icon {
font-size: 1.2em;
}
}
// Language-specific styles that will be applied when the body has the corresponding class
:host-context(body.app-theme-light) {
.language-selector__button {
background-color: #f8f8f8;
color: #333;
}
}
:host-context(body.app-theme-dark) {
.language-selector__button {
background-color: #333;
color: #f8f8f8;
border-color: #555;
}
}
:host-context(body.app-theme-funky) {
.language-selector__button {
background-color: #ff00ff;
color: #00ffff;
border-color: #ffff00;
}
}

View file

@ -0,0 +1,57 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Store } from '@ngrx/store';
import { Subscription } from 'rxjs';
import { ActionTypes, StateInterface } from '../../reducers';
import { TranslationService } from '../../services/translation.service';
@Component({
selector: 'app-language-selector',
standalone: true,
imports: [CommonModule],
templateUrl: './language-selector.html',
styleUrl: './language-selector.scss'
})
export class LanguageSelector implements OnInit, OnDestroy {
currentLang: string = '';
langsList: string[] = [];
private storeSubscription: Subscription | null = null;
constructor(
private store: Store<StateInterface>,
private translationService: TranslationService
) {}
ngOnInit(): void {
// Subscribe to the store to get the current language and languages list
this.storeSubscription = this.store.select(state => state.app)
.subscribe(app => {
this.currentLang = app.lang;
this.langsList = app.langsList;
});
}
ngOnDestroy(): void {
// Unsubscribe to prevent memory leaks
if (this.storeSubscription) {
this.storeSubscription.unsubscribe();
}
}
// Method to switch to the next language
switchToNextLanguage(): void {
this.store.dispatch({ type: ActionTypes.SWITCH_TO_NEXT_LANGUAGE });
}
// Helper method to display a friendly language name
getLanguageDisplayName(langCode: string): string {
switch (langCode) {
case 'fr_FR':
return 'Français';
case 'en_US':
return 'English';
default:
return langCode;
}
}
}

View file

@ -0,0 +1,10 @@
<div class="loading-notification">
<div class="progress-container">
<div [style.animation-duration.ms]="averageResponseTime" class="progress-bar"></div>
</div>
<!-- <span class="text">-->
<!-- ça charge-->
<!-- </span>-->
</div>

View file

@ -0,0 +1,40 @@
.loading-notification {
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
.text {
margin-top: 8px;
font-size: 14px;
color: #666;
}
.progress-container {
width: 100%;
height: 4px;
background-color: #f0f0f0;
border-radius: 2px;
overflow: hidden;
margin-bottom: 8px;
}
.progress-bar {
height: 100%;
width: 100%;
background-color: #083b7d; // Same blue color as in the feedback button
transform: translateX(-100%);
animation-name: progress;
animation-timing-function: linear;
animation-fill-mode: forwards;
}
}
@keyframes progress {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LoadingNotification } from './loading-notification';
describe('LoadingNotification', () => {
let component: LoadingNotification;
let fixture: ComponentFixture<LoadingNotification>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [LoadingNotification]
})
.compileComponents();
fixture = TestBed.createComponent(LoadingNotification);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,27 @@
import {Component} from '@angular/core';
import {Store} from '@ngrx/store';
import {StateInterface} from '../../reducers';
import {CommonModule} from '@angular/common';
@Component({
selector: 'app-loading-notification',
imports: [CommonModule],
templateUrl: './loading-notification.html',
styleUrl: './loading-notification.scss'
})
export class LoadingNotification {
protected loading: boolean = false;
protected averageResponseTime: number = 500; // Default value
constructor(private store: Store<StateInterface>) {
// Subscribe to the app state to get the loading state
this.store.select(state => state.app.loading).subscribe(loading => {
this.loading = loading;
});
// Subscribe to the app state to get the average response time
this.store.select(state => state.app.averageResponseTime).subscribe(time => {
this.averageResponseTime = time;
});
}
}

View file

@ -0,0 +1,84 @@
<div class="message message-{{kind}} {{kind}}" id="message_{{id}}">
<div class="actions top-actions">
@if (kind === 'user') {
<button (click)="editMessage()" class="button edit">
<i class="ri-edit-box-line"></i>
</button>
}
<!-- @else {-->
<!-- <button (click)="toggleFullScreen()" class="button fullscreen">-->
<!-- <i class="ri-fullscreen-line"></i>-->
<!-- </button>-->
<!-- }-->
</div>
<div class="user-infos ">
<div class="avatar">
<!-- avatar-->
</div>
<div class="user-more-infos">
<span class="user-name ">
<!-- user name-->
@if (kind === 'user') {
You
} @else {
Response
}
</span>
<span class="time-ago">
<!-- time ago-->
Il y a 5 min
</span>
</div>
</div>
<div class="message-content is-{{kind}}">
@if (content) {
<div [innerHTML]="sanitizedContent"></div>
} @else {
@if (kind === 'llm') {
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur, consectetur cum eaque iure optio recusandae vel.
} @else {
Delectus, est, molestiae! Asperiores at consequatur cupiditate dicta iure neque pariatur perspiciatis, quia ut?
}
}
</div>
<div class="actions bottom-actions is-{{kind}}">
@if (kind === 'llm') {
<div class="action-feedback">
<app-feedback-button></app-feedback-button>
</div>
<div class=" has-text-right">
<button (click)="generateResponse()" class="button generate-response">
<i class="ri-refresh-line"></i>
<span class="label">
Generate Response
</span>
</button>
<app-copy [textToCopy]="content"></app-copy>
<button (click)="bookmark()" class="button bookmark">
<i class="ri-bookmark-line"></i>
</button>
<button (click)="toggleSources()" class="button sources">
<i class="ri-book-2-fill"></i>
@if (displaySourcesPanelLarge) {
hide sources
} @else {
see sources
}
</button>
</div>
}
</div>
<!-- <div [ngClass]="{'is-expanded': expanded}" class="expanded-message-fullscreen">-->
<!-- @if (content) {-->
<!-- <div [innerHTML]="sanitizedContent"></div>-->
<!-- }-->
<!-- </div>-->
</div>

View file

@ -0,0 +1,160 @@
@use 'sae-lib/src/styles/variables' as variables;
:host {
width: 100%;
}
.avatar {
width: 32px;
height: 32px;
flex-shrink: 0;
border-radius: 8px;
background-size: contain !important;
.user & {
background-size: contain;
background: yellow url('../../../../public/user.png');
}
.llm & {
background: yellow url('../../../../public/chatbot.png');
}
}
.message {
.user-more-infos {
margin-top: -35px;
margin-left: 39px;
}
&.user {
background: white;
color: #000;
}
&.llm {
.message-content {
color: #000;
}
.actions {
.button {
background: rgba(59, 135, 204, 0.7);
color: black;
}
}
}
.actions {
.fullscreen {
float: right;
}
}
.app-theme-light & {
background: #F5F5F5;
}
.app-theme-dark & {
background: #2c2c2c;
color: #d5d5d5;
.message {
&.user {
background: #232432;
color: #8b8ecf;
}
&.llm {
background: #232432;
.message-content {
color: #8b8ecf;
}
.actions {
.button {
background: #0d0e15;
color: grey;
}
}
}
}
}
.app-theme-funky & {
color: #1B1D27;
background: #ffe8e8;
.message {
.message-content {
color: #fff3f3;
}
&.user {
background: #d6a3a3;
color: #1B1D27;
}
&.llm {
background: #9f36bc;
color: #bba7d6;
.actions {
.button {
background: #b08eba;
color: #d4b4ff;
}
}
}
}
}
.message {
&.user {
background: variables.$neutral-white;
}
&.llm {
background: rgba(#3B87CC1A, 10%);
}
}
}
.expanded-message-fullscreen {
display: none;
width: 50%;
&.is-visible {
display: block;
padding: 20px;
background: #ccc;
border-radius: 3px;
position: relative;
top: 0;
left: 0;
z-index: 100;
}
}

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MessageBox } from './message-box';
describe('MessageBox', () => {
let component: MessageBox;
let fixture: ComponentFixture<MessageBox>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [MessageBox]
})
.compileComponents();
fixture = TestBed.createComponent(MessageBox);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,91 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { MessageBox } from './message-box';
import { moduleMetadata } from '@storybook/angular';
import { DomSanitizer, BrowserModule } from '@angular/platform-browser';
import { Copy } from 'sae-lib/buttons/copy/copy';
import { FeedbackButton } from '../feedback-button/feedback-button';
import { ChatbotMessage } from '../../services/chatbot.message.type';
const meta: Meta<MessageBox> = {
title: 'Chatbot/Messages/MessageBox',
component: MessageBox,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [Copy, FeedbackButton, BrowserModule],
providers: []
})
],
argTypes: {
kind: {
control: 'select',
options: ['user', 'llm'],
description: "Type de message (utilisateur ou IA)"
},
content: {
control: 'text',
description: "Contenu du message"
}
}
};
export default meta;
type Story = StoryObj<MessageBox>;
export const UserMessage: Story = {
args: {
kind: 'user',
content: 'Voici un message de l\'utilisateur pour tester l\'affichage.',
message: new ChatbotMessage({
kind: 'user',
user: {},
content: 'Voici un message de l\'utilisateur pour tester l\'affichage.',
name: 'User'
})
}
};
export const AIMessage: Story = {
args: {
kind: 'llm',
content: 'Je suis un assistant IA qui répond à vos questions. Voici une réponse détaillée qui peut contenir du <strong>HTML</strong> et des listes:<ul><li>Point 1</li><li>Point 2</li></ul>',
message: new ChatbotMessage({
kind: 'llm',
user: {},
content: 'Je suis un assistant IA qui répond à vos questions. Voici une réponse détaillée qui peut contenir du <strong>HTML</strong> et des listes:<ul><li>Point 1</li><li>Point 2</li></ul>',
name: 'Assistant'
})
}
};
export const AIMessageExpanded: Story = {
args: {
kind: 'llm',
content: 'Je suis un assistant IA qui répond à vos questions. Voici une réponse détaillée qui peut contenir du <strong>HTML</strong> et des listes:<ul><li>Point 1</li><li>Point 2</li></ul>',
message: new ChatbotMessage({
kind: 'llm',
user: {},
content: 'Je suis un assistant IA qui répond à vos questions. Voici une réponse détaillée qui peut contenir du <strong>HTML</strong> et des listes:<ul><li>Point 1</li><li>Point 2</li></ul>',
name: 'Assistant'
}),
expanded: true,
}
};
export const LongAIMessage: Story = {
args: {
kind: 'llm',
content: `<p>Voici une réponse longue avec beaucoup de contenu pour tester comment le composant gère les grands blocs de texte.</p>
<p>Les documents mettent également en évidence diverses mesures de sécurité post-incident mises en œuvre, notamment des procédures de formation améliorées, des protocoles de maintenance renforcés et des modifications de la conception des aéronefs. Des organismes de réglementation tels que le NTSB, le BEA, l'AAIB et d'autres ont participé à l'enquête sur ces incidents et ont formulé des recommandations de sécurité.</p>
<p>Ce résumé donne un aperçu des incidents aéronautiques importants, de leurs causes et de leurs conséquences, ce qui peut être utile pour comprendre les schémas d'accidents d'aéronefs et les domaines à améliorer en matière de sécurité aérienne.</p>
<br/>
<p>Pas de recherche Internet activée.<br/>
Aucune recherche Internet n'a é activée pour cette requête</p>
<br/>
<p>Résultats de recherche.</p>`,
message: new ChatbotMessage({
kind: 'llm',
user: {},
content: 'Contenu long...',
name: 'Assistant'
})
}
};

View file

@ -0,0 +1,80 @@
import {Component, Input, OnChanges, SimpleChanges} from '@angular/core';
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
import {Copy} from 'sae-lib/buttons/copy/copy';
import {FeedbackButton} from '../feedback-button/feedback-button';
import {ChatbotMessage} from '../../services/chatbot.message.type';
import {NgClass} from '@angular/common';
import {Store} from '@ngrx/store';
import {ActionTypes, StateInterface} from '../../reducers';
type MessageKind = "user" | "llm";
@Component({
selector: 'app-message-box',
imports: [
Copy,
FeedbackButton,
NgClass
],
templateUrl: './message-box.html',
styleUrl: './message-box.scss'
})
export class MessageBox implements OnChanges {
@Input() kind: MessageKind = <"user" | "llm">""
@Input() conf: any = {}
@Input() content: any = ""
@Input() message: ChatbotMessage = {} as ChatbotMessage;
id: string = "00122121221312";
sanitizedContent: SafeHtml = "";
expanded: boolean = true;
displaySourcesPanelLarge: boolean = false;
constructor(private sanitizer: DomSanitizer,
public store: Store<StateInterface>) {
this.store.select(state => state.app.displaySourcesPanelLarge).subscribe(value => {
this.displaySourcesPanelLarge = value;
});
}
ngOnChanges(changes: SimpleChanges): void {
if (changes['content']) {
this.sanitizeContent();
}
}
sanitizeContent(): void {
this.sanitizedContent = this.sanitizer.bypassSecurityTrustHtml(this.content);
}
bookmark() {
console.log("TODO bookmark")
}
generateResponse() {
console.log("TODO generateResponse")
}
editMessage() {
console.log("TODO editMessage")
}
toggleSources() {
console.log("TODO toggle sources")
this.store.dispatch({
type: ActionTypes.UPDATE_APP,
payload: {
displaySourcesPanelLarge: !this.displaySourcesPanelLarge
}
})
}
toggleFullScreen() {
console.log("TODO toggle fullscreen")
this.expanded = !this.expanded;
}
}

View file

@ -0,0 +1,16 @@
<div class="new-input">
<div class="main-conversation-container">
<div class="welcome-text">
<div class="welcome-icon">
<img alt="chatbot image" src="/chatbot.png">
</div>
How can we
<span class="emphasis">
assist
</span>
you today?
</div>
<app-tools-options [hideDisabledButtons]="false"></app-tools-options>
<app-prompt-input></app-prompt-input>
</div>
</div>

View file

@ -0,0 +1,25 @@
.new-input {
padding: 0 200px;
background: #f5f5f5;
border-radius: 10px;
min-height: 100vh;
.welcome-text {
margin: 100px;
font-size: 38px;
font-weight: 500;
letter-spacing: -7%;
}
.welcome-icon {
i {
font-size: 3rem;
}
margin-bottom: 1rem;
}
.emphasis {
color: #083b7d;
}
}

Some files were not shown because too many files have changed in this diff Show more