diff --git a/src/main.ts b/src/main.ts index bbbb06a..14aaae1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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); +} \ No newline at end of file diff --git a/src/mocks/mock-account/constAccountMock.ts b/src/mocks/mock-account/constAccountMock.ts new file mode 100644 index 0000000..5beb139 --- /dev/null +++ b/src/mocks/mock-account/constAccountMock.ts @@ -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." + } +}; diff --git a/src/mocks/mock-account/interfacesAccountMock.ts b/src/mocks/mock-account/interfacesAccountMock.ts new file mode 100644 index 0000000..0834d4c --- /dev/null +++ b/src/mocks/mock-account/interfacesAccountMock.ts @@ -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; +} diff --git a/src/pages/account/account-component.ts b/src/pages/account/account-component.ts new file mode 100644 index 0000000..31c0413 --- /dev/null +++ b/src/pages/account/account-component.ts @@ -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 = ``; + this.shadowRoot.appendChild(accountElement); + } + } +} + +export { AccountComponent } +customElements.define('account-component', AccountComponent); diff --git a/src/pages/account/account.ts b/src/pages/account/account.ts index ddc151b..0a5c6fd 100755 --- a/src/pages/account/account.ts +++ b/src/pages/account/account.ts @@ -1,391 +1,124 @@ +declare global { + interface Window { + localStorage: Storage; + initAccount: () => void; + showContractPopup: (contractId: string) => void; + showPairing: () => void; + showWallet: () => void; + showData: () => void; + addWalletRow: () => void; + confirmWalletRow: () => void; + cancelWalletRow: () => void; + openAvatarPopup: () => void; + closeAvatarPopup: () => void; + editDeviceName: (cell: HTMLTableCellElement) => void; + showNotifications: (processName: string) => void; + closeNotificationPopup: (event: Event) => void; + markAsRead: (processName: string, messageId: number, element: HTMLElement) => void; + exportRecovery: () => void; + confirmDeleteAccount: () => void; + deleteAccount: () => void; + updateNavbarBanner: (bannerUrl: string) => void; + saveBannerToLocalStorage: (bannerUrl: string) => void; + loadSavedBanner: () => void; + cancelAddRow: () => void; + saveName: (cell: HTMLElement, input: HTMLInputElement) => void; + showProcessNotifications: (processName: string) => void; + handleLogout: () => void; + initializeEventListeners: () => void; + showProcess: () => void; + updateNavbarName: (name: string) => void; + updateNavbarLastName: (lastName: string) => void; + showAlert: (title: string, text?: string, icon?: string) => void; + addRow: () => void; + confirmRow: () => void; + cancelRow: () => void; + deleteRow: (button: HTMLButtonElement) => void; + generateRecoveryWords: () => string[]; + exportUserData: () => void; + updateActionButtons: () => void; + } +} + import Swal from 'sweetalert2'; - - -//console.log("Account script loaded"); +import { STORAGE_KEYS, defaultRows, mockProcessRows, mockNotifications, notificationMessages, mockDataRows, mockContracts, ALLOWED_ROLES } from '../../mocks/mock-account/constAccountMock'; +import { Row, WalletRow, DataRow, Notification, Contract, NotificationMessage } from '../../mocks/mock-account/interfacesAccountMock'; +import { addressToEmoji } from '../../utils/sp-address.utils'; +import { getCorrectDOM } from '../../utils/document.utils'; let isAddingRow = false; let currentRow: HTMLTableRowElement | null = null; let currentMode: keyof typeof STORAGE_KEYS = 'pairing'; -interface Row { - column1: string; - column2: string; - column3: string; -} - -// Types supplémentaires nécessaires -interface Contract { - title: string; - date: string; - parties: string[]; - terms: string[]; - content: string; -} - -interface WalletRow { - column1: string; // Label - column2: string; // Wallet - column3: string; // Type -} - -interface DataRow { - column1: string; // Name - column2: string; // Visibility - column3: string; // Role - column4: string; // Duration - column5: string; // Legal - column6: string; // Contract - processName: string; - zone: string; -} - -const ALLOWED_ROLES = ['User', 'Member', 'Peer', 'Payment', 'Deposit', 'Artefact', 'Resolve', 'Backup']; - -const STORAGE_KEYS = { - pairing: 'pairingRows', - wallet: 'walletRows', - process: 'processRows', - data: 'dataRows' -}; - -// Initialiser le stockage des lignes par défaut dans le localStorage -const defaultRows = [ - { - column1: "sprt1qqwtvg5q5vcz0reqvmld98u7va3av6gakwe9yxw9yhnpj5djcunn4squ68tuzn8dz78dg4adfv0dekx8hg9sy0t6s9k5em7rffgxmrsfpyy7gtyrz", - column2: "🎊😑🎄😩", - column3: "Laptop" - }, - { - column1: "sprt1qqwtvg5q5vcz0reqvmld98u7va3av6gakwe9yxw9yhnpj5djcunn4squ68tuzn8dz78dg4adfv0dekx8hg9sy0t6s9k5em7rffgxmrsfpyy7gtyrx", - column2: "🎏🎕😧🌥", - column3: "Phone" } -]; - -// Vérifier si les lignes sont déjà dans le localStorage -if (!localStorage.getItem('rows')) { - localStorage.setItem('rows', JSON.stringify(defaultRows)); -} - -// Add this interface -interface Notification { - message: string; - timestamp: string; - isRead: boolean; -} - -// Update the declaration -const mockNotifications: { [key: string]: Notification[] } = {}; - -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" -]; - -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 function showAlert(message: string): void { + // Créer la popup si elle n'existe pas + let alertPopup = document.querySelector('.alert-popup'); + if (!alertPopup) { + alertPopup = document.createElement('div'); + alertPopup.className = 'alert-popup'; + document.body.appendChild(alertPopup); } -]; -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" } - ] + // Définir le message et afficher la popup + alertPopup.textContent = message; + (alertPopup as HTMLElement).style.display = 'block'; + + // Cacher la popup après 3 secondes + setTimeout(() => { + (alertPopup as HTMLElement).style.display = 'none'; + }, 3000); +} + +class AccountElement extends HTMLElement { + private dom: Node; + + + + + constructor() { + super(); + this.attachShadow({ mode: 'open' }); + this.dom = getCorrectDOM('account-element'); + + + window.showPairing = () => this.showPairing(); + window.showWallet = () => this.showWallet(); + window.showProcess = () => this.showProcess(); + window.showData = () => this.showData(); + window.addWalletRow = () => this.addWalletRow(); + window.confirmWalletRow = () => this.confirmWalletRow(); + window.cancelWalletRow = () => this.cancelWalletRow(); + window.editDeviceName = (cell: HTMLTableCellElement) => this.editDeviceName(cell); + window.showProcessNotifications = (processName: string) => this.showProcessNotifications(processName); + window.handleLogout = () => this.handleLogout(); + window.confirmDeleteAccount = () => this.confirmDeleteAccount(); + window.showContractPopup = (contractId: string) => this.showContractPopup(contractId); + window.addRow = () => this.addRow(); + window.deleteRow = (button: HTMLButtonElement) => this.deleteRow(button); + window.confirmRow = () => this.confirmRow(); + window.cancelRow = () => this.cancelRow(); + window.updateNavbarBanner = (bannerUrl: string) => this.updateNavbarBanner(bannerUrl); + window.saveBannerToLocalStorage = (bannerUrl: string) => this.saveBannerToLocalStorage(bannerUrl); + window.loadSavedBanner = () => this.loadSavedBanner(); + window.closeNotificationPopup = (event: Event) => this.closeNotificationPopup(event); + window.markAsRead = (processName: string, messageId: number, element: HTMLElement) => this.markAsRead(processName, messageId, element); + window.exportRecovery = () => this.exportRecovery(); + window.generateRecoveryWords = () => this.generateRecoveryWords(); + window.exportUserData = () => this.exportUserData(); + window.updateActionButtons = () => this.updateActionButtons(); + window.openAvatarPopup = () => this.openAvatarPopup(); + window.closeAvatarPopup = () => this.closeAvatarPopup(); + + if (!localStorage.getItem('rows')) { + localStorage.setItem('rows', JSON.stringify(defaultRows)); } } -]; - -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." - } -}; - -// Fonctions de gestion des comptes et de l'interface utilisateur -function confirmDeleteAccount(): void { - const modal = document.createElement('div'); - modal.className = 'confirm-delete-modal'; - modal.innerHTML = ` + // Fonctions de gestion des comptes et de l'interface utilisateur + private confirmDeleteAccount(): void { + const modal = document.createElement('div'); + modal.className = 'confirm-delete-modal'; + modal.innerHTML = `
Are you sure you want to delete your account? This action cannot be undone.