account_ok

This commit is contained in:
Pascal 2024-12-03 00:16:47 +01:00
parent 0d57a8cbfa
commit c150dab6ed
7 changed files with 774 additions and 848 deletions

View File

@ -2,13 +2,16 @@ import { SignatureComponent } from './pages/signature/signature-component';
import { SignatureElement } from './pages/signature/signature';
import { ChatComponent } from './pages/chat/chat-component';
import { ChatElement } from './pages/chat/chat';
import { AccountComponent } from './pages/account/account-component';
import { AccountElement } from './pages/account/account';
export {
SignatureComponent,
SignatureElement,
ChatComponent,
ChatElement
ChatElement,
AccountComponent,
AccountElement
};
@ -18,6 +21,8 @@ declare global {
'signature-element': SignatureElement;
'chat-component': ChatComponent;
'chat-element': ChatElement;
'account-component': AccountComponent;
'account-element': AccountElement;
}
}
@ -28,4 +33,6 @@ if ((import.meta as any).env.VITE_IS_INDEPENDANT_LIB) {
customElements.define('signature-element', SignatureElement);
customElements.define('chat-component', ChatComponent);
customElements.define('chat-element', ChatElement);
}
customElements.define('account-component', AccountComponent);
customElements.define('account-element', AccountElement);
}

View File

@ -0,0 +1,328 @@
export const ALLOWED_ROLES = ['User', 'Member', 'Peer', 'Payment', 'Deposit', 'Artefact', 'Resolve', 'Backup'];
export const STORAGE_KEYS = {
pairing: 'pairingRows',
wallet: 'walletRows',
process: 'processRows',
data: 'dataRows'
};
// Initialiser le stockage des lignes par défaut dans le localStorage
export const defaultRows = [
{
column1: "sprt1qqwtvg5q5vcz0reqvmld98u7va3av6gakwe9yxw9yhnpj5djcunn4squ68tuzn8dz78dg4adfv0dekx8hg9sy0t6s9k5em7rffgxmrsfpyy7gtyrz",
column2: "🎊😑🎄😩",
column3: "Laptop"
},
{
column1: "sprt1qqwtvg5q5vcz0reqvmld98u7va3av6gakwe9yxw9yhnpj5djcunn4squ68tuzn8dz78dg4adfv0dekx8hg9sy0t6s9k5em7rffgxmrsfpyy7gtyrx",
column2: "🎏🎕😧🌥",
column3: "Phone" }
];
export const mockNotifications: { [key: string]: Notification[] } = {};
export const notificationMessages = [
"CPU usage high",
"Memory threshold reached",
"New update available",
"Backup completed",
"Security check required",
"Performance optimization needed",
"System alert",
"Network connectivity issue",
"Storage space low",
"Process checkpoint reached"
];
export const mockDataRows = [
{
column1: "User Project",
column2: "private",
column3: "User",
column4: "6 months",
column5: "NDA signed",
column6: "Contract #123",
processName: "User Process",
zone: "A"
},
{
column1: "Process Project",
column2: "private",
column3: "Process",
column4: "1 year",
column5: "Terms accepted",
column6: "Contract #456",
processName: "Process Management",
zone: "B"
},
{
column1: "Member Project",
column2: "private",
column3: "Member",
column4: "3 months",
column5: "GDPR compliant",
column6: "Contract #789",
processName: "Member Process",
zone: "C"
},
{
column1: "Peer Project",
column2: "public",
column3: "Peer",
column4: "2 years",
column5: "IP rights",
column6: "Contract #101",
processName: "Peer Process",
zone: "D"
},
{
column1: "Payment Project",
column2: "confidential",
column3: "Payment",
column4: "1 year",
column5: "NDA signed",
column6: "Contract #102",
processName: "Payment Process",
zone: "E"
},
{
column1: "Deposit Project",
column2: "private",
column3: "Deposit",
column4: "6 months",
column5: "Terms accepted",
column6: "Contract #103",
processName: "Deposit Process",
zone: "F"
},
{
column1: "Artefact Project",
column2: "public",
column3: "Artefact",
column4: "1 year",
column5: "GDPR compliant",
column6: "Contract #104",
processName: "Artefact Process",
zone: "G"
},
{
column1: "Resolve Project",
column2: "private",
column3: "Resolve",
column4: "2 years",
column5: "IP rights",
column6: "Contract #105",
processName: "Resolve Process",
zone: "H"
},
{
column1: "Backup Project",
column2: "public",
column3: "Backup",
column4: "1 year",
column5: "NDA signed",
column6: "Contract #106",
processName: "Backup Process",
zone: "I"
}
];
export const mockProcessRows = [
{
process: "User Project",
role: "User",
notification: {
messages: [
{ id: 1, read: false, date: "2024-03-10", message: "New user joined the project" },
{ id: 2, read: false, date: "2024-03-09", message: "Project milestone reached" },
{ id: 3, read: false, date: "2024-03-08", message: "Security update required" },
{ id: 4, read: true, date: "2024-03-07", message: "Weekly report available" },
{ id: 5, read: true, date: "2024-03-06", message: "Team meeting scheduled" }
]
}
},
{
process: "Member Project",
role: "Member",
notification: {
messages: [
{ id: 6, read: true, date: "2024-03-10", message: "Member access granted" },
{ id: 7, read: true, date: "2024-03-09", message: "Documentation updated" },
{ id: 8, read: true, date: "2024-03-08", message: "Project status: on track" }
]
}
},
{
process: "Peer Project",
role: "Peer",
notification: {
unread: 2,
total: 4,
messages: [
{ id: 9, read: false, date: "2024-03-10", message: "New peer project added" },
{ id: 10, read: false, date: "2024-03-09", message: "Project milestone reached" },
{ id: 11, read: false, date: "2024-03-08", message: "Security update required" },
{ id: 12, read: true, date: "2024-03-07", message: "Weekly report available" },
{ id: 13, read: true, date: "2024-03-06", message: "Team meeting scheduled" }
]
}
},
{
process: "Deposit Project",
role: "Deposit",
notification: {
unread: 1,
total: 10,
messages: [
{ id: 14, read: false, date: "2024-03-10", message: "Deposit milestone reached" },
{ id: 15, read: false, date: "2024-03-09", message: "Security update required" },
{ id: 16, read: false, date: "2024-03-08", message: "Weekly report available" },
{ id: 17, read: true, date: "2024-03-07", message: "Team meeting scheduled" },
{ id: 18, read: true, date: "2024-03-06", message: "Project status: on track" }
]
}
},
{
process: "Artefact Project",
role: "Artefact",
notification: {
unread: 0,
total: 3,
messages: [
{ id: 19, read: false, date: "2024-03-10", message: "New artefact added" },
{ id: 20, read: false, date: "2024-03-09", message: "Security update required" },
{ id: 21, read: false, date: "2024-03-08", message: "Weekly report available" },
{ id: 22, read: true, date: "2024-03-07", message: "Team meeting scheduled" },
{ id: 23, read: true, date: "2024-03-06", message: "Project status: on track" }
]
}
},
{
process: "Resolve Project",
role: "Resolve",
notification: {
unread: 5,
total: 12,
messages: [
{ id: 24, read: false, date: "2024-03-10", message: "New issue reported" },
{ id: 25, read: false, date: "2024-03-09", message: "Security update required" },
{ id: 26, read: false, date: "2024-03-08", message: "Weekly report available" },
{ id: 27, read: true, date: "2024-03-07", message: "Team meeting scheduled" },
{ id: 28, read: true, date: "2024-03-06", message: "Project status: on track" }
]
}
}
];
export const mockContracts = {
'Contract #123': {
title: "User Project Agreement",
date: "2024-01-15",
parties: ["Company XYZ", "User Team"],
terms: [
"Data Protection",
"User Privacy",
"Access Rights",
"Service Level Agreement"
],
content: "This agreement establishes the terms and conditions for user project management."
},
'Contract #456': {
title: "Process Management Contract",
date: "2024-02-01",
parties: ["Company XYZ", "Process Team"],
terms: [
"Process Workflow",
"Quality Standards",
"Performance Metrics",
"Monitoring Procedures"
],
content: "This contract defines the process management standards and procedures."
},
'Contract #789': {
title: "Member Access Agreement",
date: "2024-03-15",
parties: ["Company XYZ", "Member Team"],
terms: [
"Member Rights",
"Access Levels",
"Security Protocol",
"Confidentiality Agreement"
],
content: "This agreement outlines the terms for member access and privileges."
},
'Contract #101': {
title: "Peer Collaboration Agreement",
date: "2024-04-01",
parties: ["Company XYZ", "Peer Network"],
terms: [
"Collaboration Rules",
"Resource Sharing",
"Dispute Resolution",
"Network Protocol"
],
content: "This contract establishes peer collaboration and networking guidelines."
},
'Contract #102': {
title: "Payment Processing Agreement",
date: "2024-05-01",
parties: ["Company XYZ", "Payment Team"],
terms: [
"Transaction Protocol",
"Security Measures",
"Fee Structure",
"Service Availability"
],
content: "This agreement defines payment processing terms and conditions."
},
'Contract #103': {
title: "Deposit Management Contract",
date: "2024-06-01",
parties: ["Company XYZ", "Deposit Team"],
terms: [
"Deposit Rules",
"Storage Protocol",
"Access Control",
"Security Standards"
],
content: "This contract outlines deposit management procedures and security measures."
},
'Contract #104': {
title: "Artefact Handling Agreement",
date: "2024-07-01",
parties: ["Company XYZ", "Artefact Team"],
terms: [
"Handling Procedures",
"Storage Guidelines",
"Access Protocol",
"Preservation Standards"
],
content: "This agreement establishes artefact handling and preservation guidelines."
},
'Contract #105': {
title: "Resolution Protocol Agreement",
date: "2024-08-01",
parties: ["Company XYZ", "Resolution Team"],
terms: [
"Resolution Process",
"Time Constraints",
"Escalation Protocol",
"Documentation Requirements"
],
content: "This contract defines the resolution process and protocol standards."
},
'Contract #106': {
title: "Backup Service Agreement",
date: "2024-09-01",
parties: ["Company XYZ", "Backup Team"],
terms: [
"Backup Schedule",
"Data Protection",
"Recovery Protocol",
"Service Reliability"
],
content: "This agreement outlines backup service terms and recovery procedures."
}
};

View File

@ -0,0 +1,45 @@
export interface Row {
column1: string;
column2: string;
column3: string;
}
// Types supplémentaires nécessaires
export interface Contract {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
}
export interface WalletRow {
column1: string; // Label
column2: string; // Wallet
column3: string; // Type
}
export interface DataRow {
column1: string; // Name
column2: string; // Visibility
column3: string; // Role
column4: string; // Duration
column5: string; // Legal
column6: string; // Contract
processName: string;
zone: string;
}
export interface Notification {
message: string;
timestamp: string;
isRead: boolean;
}
// Déplacer l'interface en dehors de la classe, au début du fichier
export interface NotificationMessage {
id: number;
read: boolean;
date: string;
message: string;
}

View File

@ -0,0 +1,59 @@
import { AccountElement } from './account';
import accountCss from '../../../public/style/account.css?raw'
import Services from '../../services/service.js'
class AccountComponent extends HTMLElement {
_callback: any
accountElement: AccountElement | null = null;
constructor() {
super();
console.log('INIT')
this.attachShadow({ mode: 'open' });
this.accountElement = this.shadowRoot?.querySelector('account-element') || null;
}
connectedCallback() {
console.log('CALLBACKs')
this.render();
this.fetchData();
if (!customElements.get('account-element')) {
customElements.define('account-element', AccountElement);
}
}
async fetchData() {
if ((import.meta as any).env.VITE_IS_INDEPENDANT_LIB === false) {
const data = await (window as any).myService?.getProcesses();
} else {
const service = await Services.getInstance()
const data = await service.getProcesses();
}
}
set callback(fn) {
if (typeof fn === 'function') {
this._callback = fn;
} else {
console.error('Callback is not a function');
}
}
get callback() {
return this._callback;
}
render() {
if(this.shadowRoot) {
// Créer l'élément chat-element
const accountElement = document.createElement('account-element');
this.shadowRoot.innerHTML = `<style>${accountCss}</style>`;
this.shadowRoot.appendChild(accountElement);
}
}
}
export { AccountComponent }
customElements.define('account-component', AccountComponent);

File diff suppressed because it is too large Load Diff

View File

@ -39,13 +39,6 @@ interface LocalNotification {
time: string;
}
export function initSignature() {
const signatureElement = document.createElement('signature-element');
const container = document.querySelector('.container');
if (container) {
container.appendChild(signatureElement);
}
}
class SignatureElement extends HTMLElement {
private selectedMemberId: string | null = null;

View File

@ -64,8 +64,15 @@ async function handleLocation(path: string) {
break;
case 'account':
const { initAccount } = await import('./pages/account/account');
initAccount();
const { AccountComponent } = await import('./pages/account/account-component');
const accountContainer = document.querySelector('.parameter-list');
if (accountContainer) {
if (!customElements.get('account-component')) {
customElements.define('account-component', AccountComponent);
}
const accountComponent = document.createElement('account-component');
accountContainer.appendChild(accountComponent);
}
break;
case 'chat':