${this.getCurrentTabTitle()}
${this.getCurrentTabDescription()}
/** * EDC Management Component (Refactored) * * Main application shell for managing Eclipse Dataspace Connector resources. * This version uses extracted feature components for better modularity and maintainability. * * @customElement edc-management */ import { html, LitElement, nothing } from "lit"; import { customElement, property, state } from "lit/decorators.js"; import { classMap } from "lit/directives/class-map.js"; import { msg } from '@lit/localize'; import './language-selector.js'; // Import feature components import './features/assets/edc-assets-management.js'; import './features/policies/edc-policies-management.js'; import './features/contracts/edc-contracts-management.js'; // Import types and services import type { TabId, Tab, ConnectionStatus, EdcStoreInterface } from '../types/edc-types'; import { createEdcStore } from '../services/store-factory'; // Import styles import { layoutStyles } from '../styles/layout-styles'; import { managementStyles } from '../styles/management-styles'; import { buttonStyles, formStyles } from '../styles/shared-styles'; import { responsiveStyles } from '../styles/responsive-styles'; @customElement("edc-management") export class EdcManagement extends LitElement { // ============================================================================ // Properties // ============================================================================ @property({ attribute: "api-endpoint" }) apiEndpoint?: string; @property({ attribute: "api-key" }) apiKey?: string; @property({ attribute: "participant-id" }) participantId?: string; // ============================================================================ // State // ============================================================================ @state() private activeTab: TabId = 'assets'; @state() private connectionStatus: ConnectionStatus = 'mock'; @state() private isLoading: boolean = false; // ============================================================================ // Private Properties // ============================================================================ private store!: EdcStoreInterface; private get tabs(): Tab[] { return [ { id: 'assets', label: msg('Assets', { id: 's2ea91b543c17d318' }), icon: '📦', description: msg('Manage data assets in the connector', { id: 's5b05c52215b75bd2' }) }, { id: 'policies', label: msg('Policies', { id: 's8cb7bb82e96d5d77' }), icon: '📋', description: msg('Define and manage access policies', { id: 'sace09165c81b1816' }) }, { id: 'contracts', label: msg('Contract Definitions', { id: 's3bc572e386a2b67d' }), icon: '📝', description: msg('Create and manage contract definitions', { id: 'sbc2baca40846dfdd' }) }, { id: 'negotiations', label: msg('Negotiations', { id: 'sbe2c9616bee67b33' }), icon: '🤝', description: msg('Monitor active contract negotiations', { id: 's2e547b157b4ccda1' }) } ]; } // ============================================================================ // Lifecycle Methods // ============================================================================ connectedCallback() { super.connectedCallback(); console.log('🚀 EDC Management Interface initializing...'); this.initializeStore(); // Listen for locale changes from language selector this.addEventListener('locale-changed', this.handleLocaleChange); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener('locale-changed', this.handleLocaleChange); } // ============================================================================ // Store Initialization // ============================================================================ private initializeStore() { const { store, status } = createEdcStore({ apiEndpoint: this.apiEndpoint, apiKey: this.apiKey, participantId: this.participantId }); this.store = store; this.connectionStatus = status; console.log(`✅ EDC store initialized (status: ${status})`); } // ============================================================================ // Event Handlers // ============================================================================ private handleLocaleChange = (event: CustomEvent) => { console.log('Locale changed to:', event.detail.locale); this.requestUpdate(); }; private switchTab(tabId: TabId) { console.log(`🔄 Switching to tab: ${tabId}`); this.activeTab = tabId; } // ============================================================================ // Utility Methods // ============================================================================ private getCurrentTabTitle(): string { const currentTab = this.tabs.find(tab => tab.id === this.activeTab); return currentTab ? currentTab.label : 'EDC Management'; } private getCurrentTabDescription(): string { const currentTab = this.tabs.find(tab => tab.id === this.activeTab); return currentTab ? currentTab.description : 'Select a section from the sidebar'; } // ============================================================================ // Render Methods // ============================================================================ render() { return html`
${this.getCurrentTabDescription()}
${status}