diff --git a/.github/workflows/system-testing.yml b/.github/workflows/system-testing.yml index cc41ccac..45261318 100644 --- a/.github/workflows/system-testing.yml +++ b/.github/workflows/system-testing.yml @@ -5,7 +5,6 @@ on: types: [opened, reopened, synchronize] branches: - main - - slu/e2eExternal jobs: trigger-system-tests: @@ -89,7 +88,7 @@ jobs: echo " PR URL: ${{ github.event.pull_request.html_url }}" echo "" - # Trigger E2E tests in DOME-testing repository + # Trigger E2E tests in E2E-DOME-BAE repository echo "Triggering E2E tests..." curl -X POST \ -H "Authorization: token ${{ secrets.ADMIN }}" \ @@ -108,6 +107,6 @@ jobs: \"pull_request_url\": \"${{ github.event.pull_request.html_url }}\" } }" \ - https://api.github.com/repos/sluFicodes/DOME-testing/dispatches + https://api.github.com/repos/sluFicodes/E2E-DOME-BAE/dispatches echo "E2E tests triggered successfully!" diff --git a/cypress/e2e/catalog.cy.ts b/cypress/e2e/catalog.cy.ts index 0e9a5067..4cbe45a0 100644 --- a/cypress/e2e/catalog.cy.ts +++ b/cypress/e2e/catalog.cy.ts @@ -31,7 +31,7 @@ describe('/my-offerings',{ cy.visit('/my-offerings') cy.wait('@catalog') - cy.get('@catalog.all').should('have.length', 2) + cy.get('@catalog.all').should('have.length', 4) cy.getBySel('newCatalog').click() cy.getBySel('catalogName').type(name) cy.getBySel('catalogDsc').type(description) @@ -72,7 +72,7 @@ describe('/my-offerings',{ cy.visit('/my-offerings') cy.wait('@catalog') - cy.get('@catalog.all').should('have.length', 2) + cy.get('@catalog.all').should('have.length', 4) cy.getBySel('newCatalog').click() cy.getBySel('catalogName').type(name) cy.getBySel('catalogDsc').type(description) diff --git a/cypress/support/constants.ts b/cypress/support/constants.ts index a6d78a4c..9a446c3b 100644 --- a/cypress/support/constants.ts +++ b/cypress/support/constants.ts @@ -22,7 +22,8 @@ export const init_config = { 'domeRegister': 'https://dome-marketplace.github.io/onboarding/', 'domePublish': 'https://knowledgebase.dome-marketplace.org/shelves/company-onboarding-process', 'purchaseEnabled': false, - 'defaultId': 'urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6' + 'defaultId': 'urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6', + "theme": "DOME" } @@ -109,6 +110,21 @@ export const login_token = () => { } } +export const default_catalog = { + "id": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6", + "href": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6", + "lifecycleStatus": "Launched", + "name": "default", + "version": "1.0", + "category": [ + { + "id": "urn:ngsi-ld:category:26435cca-2707-4c89-8f0c-79464573c9e2", + "href": "urn:ngsi-ld:category:26435cca-2707-4c89-8f0c-79464573c9e2", + "name": "dft cat" + } + ] +} + export const catalog_launched = [ { "id": "urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6", @@ -194,7 +210,9 @@ export const local_items = { cy.intercept( {method:'GET', url: 'http://proxy.docker:8004/stats'}, init_stat).as('stats') //cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/catalog/productOffering?*'}, product_offering).as('productOffering') cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/config'}, init_config).as('config') - cy.intercept( {method:'GET', url: 'http://proxy.docker:8004/catalog/category?*'}, category_launched).as('category') + //cy.intercept('GET', '**/catalog/category/urn:ngsi-ld:category:*', category_dft).as('category'); + cy.intercept({method: 'GET', url: 'catalog/catalog/?*'}, default_catalog).as('catalog') + cy.intercept( {method: 'GET', url: 'http://proxy.docker:8004/catalog/category/?*'}, category_dft).as('category') // Verify mocks are called 1 time cy.visit('/', {onBeforeLoad(win) { win.localStorage.setItem('color-theme', 'dark'); @@ -205,6 +223,8 @@ export const local_items = { cy.get('@config.all').should('have.length', 1) //cy.wait('@productOffering') //cy.get('@productOffering.all').should('have.length', 1) + cy.wait('@catalog') + cy.get('@catalog.all').should('have.length', 1) cy.wait('@category') cy.get('@category.all').should('have.length', 1) // Verify header interactive elemements are displayed and work as expected @@ -277,6 +297,8 @@ export const loginAcc = () => { cy.get('@config.all').should('have.length', 2) //cy.wait('@productOffering') //cy.get('@productOffering.all').should('have.length', 2) + cy.wait('@catalog') + cy.get('@catalog.all').should('have.length', 2) cy.wait('@category') cy.get('@category.all').should('have.length', 2) cy.wait('@login_token') diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 10f768a5..d42cd461 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -102,10 +102,12 @@ const routes: Routes = [ component: BlogEntryDetailComponent }, { path: 'blog-entry', - component: EntryFormComponent + component: EntryFormComponent, + canActivate: [AuthGuard], data: { roles: ['admin'] } }, { path: 'blog-entry/:id', - component: EntryFormComponent + component: EntryFormComponent, + canActivate: [AuthGuard], data: { roles: ['admin'] } }, { path: '**', redirectTo: 'dashboard', pathMatch: 'full' }, ] diff --git a/src/app/app.component.css b/src/app/app.component.css index 463d9bcb..e69de29b 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -1,8 +0,0 @@ - - -.bae-content { - width: 100%; - min-height: calc(100vh - 100px) !important; - padding-top: 75px !important; - padding-bottom: 25px !important; -} diff --git a/src/app/app.component.html b/src/app/app.component.html index 24e84480..c714a878 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,11 +1,13 @@ - + @if(providerThemeName=='DOME') { - + } - + + + @if(isProduction){ } \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5e569362..991a4490 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -77,7 +77,7 @@ export class AppComponent implements OnInit { console.log(((info.expire - moment().unix()) - 4)) this.refreshApi.startInterval(((info.expire - moment().unix())-4)*1000, ev); - + initFlowbite(); //this.refreshApi.startInterval(3000, ev.value); } }) @@ -92,6 +92,7 @@ export class AppComponent implements OnInit { this.refreshApi.startInterval(((aux.expire - moment().unix())-4)*1000, aux); console.log('token') console.log(aux.token) + initFlowbite(); } this.router.events.subscribe(event => { if (event instanceof NavigationEnd) { diff --git a/src/app/chatbot-widget/chatbot-widget.component.html b/src/app/chatbot-widget/chatbot-widget.component.html index 494dd6dd..bed89750 100644 --- a/src/app/chatbot-widget/chatbot-widget.component.html +++ b/src/app/chatbot-widget/chatbot-widget.component.html @@ -32,7 +32,7 @@ DOME support } - + role.name === 'admin')){ + userRoles.push('admin') + } } } else { this.router.navigate(['/dashboard']); diff --git a/src/app/offerings/featured/featured.component.html b/src/app/offerings/featured/featured.component.html index 1f270a02..109d7cfd 100644 --- a/src/app/offerings/featured/featured.component.html +++ b/src/app/offerings/featured/featured.component.html @@ -16,7 +16,7 @@ - + diff --git a/src/app/offerings/featured/featured.component.ts b/src/app/offerings/featured/featured.component.ts index 10005d89..3780a2d0 100644 --- a/src/app/offerings/featured/featured.component.ts +++ b/src/app/offerings/featured/featured.component.ts @@ -23,7 +23,7 @@ export class FeaturedComponent implements OnInit { } ngOnInit(): void { - this.api.getLaunchedCategories().then(data => { + this.api.getDefaultCategories().then(data => { for(let i=0; i < data.length; i++){ if(data[i].isRoot==true){ this.categories.push(data[i]) diff --git a/src/app/pages/catalogs/catalogs.component.html b/src/app/pages/catalogs/catalogs.component.html index 5bb6d827..711cf968 100644 --- a/src/app/pages/catalogs/catalogs.component.html +++ b/src/app/pages/catalogs/catalogs.component.html @@ -70,7 +70,7 @@ - + Load more diff --git a/src/app/pages/checkout/checkout.component.html b/src/app/pages/checkout/checkout.component.html index acc757c7..43617b05 100644 --- a/src/app/pages/checkout/checkout.component.html +++ b/src/app/pages/checkout/checkout.component.html @@ -82,7 +82,7 @@ - @@ -185,7 +185,17 @@ {{ 'SHOPPING_CART._calculated' | translate }} --> - + @if(!validBillAddr){ + + + + + Info + + You need to create at least one valid billing address. + + + } {{ 'SHOPPING_CART._checkout' | translate }} diff --git a/src/app/pages/checkout/checkout.component.ts b/src/app/pages/checkout/checkout.component.ts index a373171f..e2949453 100644 --- a/src/app/pages/checkout/checkout.component.ts +++ b/src/app/pages/checkout/checkout.component.ts @@ -51,6 +51,7 @@ export class CheckoutComponent implements OnInit { showError: boolean = false; providerId:any = null; loadingItems:boolean=false; + orderNote: string = ''; constructor( private localStorage: LocalStorageService, @@ -66,7 +67,7 @@ export class CheckoutComponent implements OnInit { private route: ActivatedRoute) { // Bind the method to preserve context this.orderProduct = this.orderProduct.bind(this); - this.eventMessage.messages$.subscribe(ev => { + this.eventMessage.messages$.subscribe(async ev => { if (ev.type === 'BillAccChanged') { this.getBilling(); } @@ -74,7 +75,8 @@ export class CheckoutComponent implements OnInit { this.addBill = false; } if (ev.type === 'ChangedSession') { - this.initCheckoutData(); + console.log('changing session...') + await this.initCheckoutData(); } if(ev.type === 'AddedCartItem') { this.loadingItems=true; @@ -198,11 +200,11 @@ export class CheckoutComponent implements OnInit { console.log('Productos creados:', products); - const productOrder = this.createProductOrder(products); - console.log('--- order ---'); - console.log(productOrder); - try { + const productOrder = this.createProductOrder(products); + console.log('--- order ---'); + console.log(productOrder); + const response = await firstValueFrom(this.orderService.postProductOrder(productOrder)); const redirectUrl = response.headers.get('X-Redirect-URL'); @@ -254,22 +256,35 @@ export class CheckoutComponent implements OnInit { } private createProductOrder(products: any[]) { - return { - productOrderItem: products, - relatedParty: [ - { - id: this.relatedParty, - href: this.relatedParty, - role: 'Customer' - } - ], - priority: '4', - billingAccount: { - id: this.selectedBillingAddress.id, - href: this.selectedBillingAddress.id - }, - notificationContact: this.selectedBillingAddress.email - }; + + let po:any = { + productOrderItem: products, + relatedParty: [ + { + id: this.relatedParty, + href: this.relatedParty, + role: 'Customer' + } + ], + priority: '4', + billingAccount: { + id: this.selectedBillingAddress.id, + href: this.selectedBillingAddress.id + }, + notificationContact: this.selectedBillingAddress.email + }; + + if(this.orderNote!=''){ + const newNote = { + text: this.orderNote, + id: `urn:ngsi-ld:note:${uuidv4()}`, + author: this.relatedParty, + date: new Date().toISOString() + }; + po['note']=[newNote] + } + + return po } private async emptyShoppingCart() { @@ -348,7 +363,7 @@ export class CheckoutComponent implements OnInit { } } - initCheckoutData() { + async initCheckoutData() { this.providerId = this.route.snapshot.paramMap.get('id'); let aux = this.localStorage.getObject('login_items') as LoginInfo; if (aux) { @@ -365,7 +380,8 @@ export class CheckoutComponent implements OnInit { console.log('--- Login Info ---') console.log(aux) - this.cartService.getShoppingCart().then(async data => { + let data = await this.cartService.getShoppingCart(); + //this.cartService.getShoppingCart().then(async data => { console.log('---CARRITO API---') console.log(data) this.items = data; @@ -377,12 +393,12 @@ export class CheckoutComponent implements OnInit { this.cdr.detectChanges(); this.getTotalPrice(); console.log('------------------') - }) + //}) console.log('--- ITEMS ---') console.log(this.items) this.loading_baddrs = true; - this.getBilling(); + await this.getBilling(); } async getProviderInfo(){ @@ -405,10 +421,12 @@ export class CheckoutComponent implements OnInit { } - getBilling() { + async getBilling() { + this.selectedBillingAddress=null; let isBillSelected = false; this.billingAddresses = []; - this.account.getBillingAccount().then(data => { + let data = await this.account.getBillingAccount(); + //this.account.getBillingAccount().then(data => { for (let i = 0; i < data.length; i++) { isBillSelected = false; let email = '' @@ -455,17 +473,21 @@ export class CheckoutComponent implements OnInit { this.billingAddresses.push(baddr) if (isBillSelected) { this.selectedBillingAddress = baddr + this.cdr.detectChanges(); } } console.log('billing account...') console.log(this.billingAddresses) + this.loading_baddrs = false; if (this.billingAddresses.length > 0) { this.preferred = false; } else { this.preferred = true; } - }) + //}) + this.validBillAddr = !!this.selectedBillingAddress?.id; + this.cdr.detectChanges(); } async onSelected(baddr: billingAccountCart) { diff --git a/src/app/pages/contact-us/contact-us-form.component.html b/src/app/pages/contact-us/contact-us-form.component.html index e7febb00..ed2255c5 100644 --- a/src/app/pages/contact-us/contact-us-form.component.html +++ b/src/app/pages/contact-us/contact-us-form.component.html @@ -19,7 +19,7 @@ {{ 'CONTACTUS._fill' | translate }} - {{ 'CONTACTUS._email' | translate }} + {{ 'CONTACTUS._email' | translate }} (*) {{ 'CONTACTUS._fil } - {{ 'CONTACTUS._firstname' | translate }} + {{ 'CONTACTUS._firstname' | translate }} (*) {{ 'CONTACTUS._fil } - {{ 'CONTACTUS._lastname' | translate }} + {{ 'CONTACTUS._lastname' | translate }} (*) {{ 'CONTACTUS._fil - {{ 'CONTACTUS._organization' | translate }} + {{ 'CONTACTUS._organization' | translate }} (*) {{ 'CONTACTUS._fil } - {{ 'CONTACTUS._role' | translate }} + {{ 'CONTACTUS._role' | translate }} (*) {{ 'CONTACTUS._fil - {{ 'CONTACTUS._message' | translate }} + {{ 'CONTACTUS._message' | translate }} (*) - - - - - Distributed Open Marketplace for Europe (DOME) Project has received funding from - European Union’s Digital Europe Programme under the Grant Agreement No 101084071. - + @if(providerThemeName=='DOME'){ + + + + + + Distributed Open Marketplace for Europe (DOME) Project has received funding from + European Union’s Digital Europe Programme under the Grant Agreement No 101084071. + + + - + + } diff --git a/src/app/pages/dashboard/dashboard.component.ts b/src/app/pages/dashboard/dashboard.component.ts index 23dedbd3..d89bd139 100644 --- a/src/app/pages/dashboard/dashboard.component.ts +++ b/src/app/pages/dashboard/dashboard.component.ts @@ -36,6 +36,7 @@ export class DashboardComponent implements OnInit, OnDestroy { delay: number = 2000; currentTheme: ThemeConfig | null = null; private themeSubscription: Subscription = new Subscription(); + providerThemeName=environment.providerThemeName; //loginSubscription: Subscription = new Subscription();; constructor(private localStorage: LocalStorageService, @@ -111,6 +112,7 @@ export class DashboardComponent implements OnInit, OnDestroy { this.localStorage.addLoginInfo(info); this.eventMessage.emitLogin(info); + initFlowbite(); console.log('----') //this.refreshApi.stopInterval(); //this.refreshApi.startInterval(((data.expire - moment().unix())-4)*1000, data); diff --git a/src/app/pages/dome-blog/dome-blog.component.ts b/src/app/pages/dome-blog/dome-blog.component.ts index 10826baf..cca87431 100644 --- a/src/app/pages/dome-blog/dome-blog.component.ts +++ b/src/app/pages/dome-blog/dome-blog.component.ts @@ -33,36 +33,7 @@ export class DomeBlogComponent implements OnInit { partyId:any=''; checkAdmin:boolean=false; - entries:any[]=[ - { - id: '1', - title: 'First entry', - author: 'Author', - date: '2025-08-08T09:32:44.548Z', - content: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. ' - }, - { - id: '2', - title: 'Second entry', - author: 'Author', - date: '2025-09-08T09:32:44.548Z', - content: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. ' - }, - { - id: '3', - title: 'Third entry', - author: 'Author', - date: '2025-03-08T11:32:44.548Z', - content: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. ' - }, - { - id: '4', - title: 'Fourth entry', - author: 'Author', - date: '2025-03-08T11:32:44.548Z', - content: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. ' - } - ] + entries:any[]=[ ] async ngOnInit(): Promise { this.initPartyInfo(); @@ -77,16 +48,13 @@ export class DomeBlogComponent implements OnInit { console.log(aux) if(aux.logged_as==aux.id){ this.partyId = aux.partyId; - this.checkAdmin=aux.roles.some(role => - role.name === 'admin' - ); } else { let loggedOrg = aux.organizations.find((element: { id: any; }) => element.id == aux.logged_as) this.partyId = loggedOrg.partyId; - this.checkAdmin=loggedOrg.roles.some((role: { name: string; }) => - role.name === 'admin' || role.name === 'orgAdmin' - ); } + this.checkAdmin=aux.roles.some(role => + role.name === 'admin' + ); } } diff --git a/src/app/pages/product-details/product-details.component.html b/src/app/pages/product-details/product-details.component.html index 79267c05..d49df8b1 100644 --- a/src/app/pages/product-details/product-details.component.html +++ b/src/app/pages/product-details/product-details.component.html @@ -424,7 +424,7 @@ - {{att.name}} + {{att.name}} @@ -501,7 +501,7 @@ - {{rel.name}} + {{rel.name}} {{rel.relationshipType}} @if(rel.relationshipType == 'dependency'){ diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html index 218d6f8b..7f148753 100644 --- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html +++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.html @@ -97,7 +97,7 @@ } @else { @for (inv of inventory; track inv.id; let idx = $index) { - + @@ -120,7 +120,7 @@ {{inv.product?.name}} @if(inv.status == 'active'){ - + @@ -192,7 +192,7 @@ - + Load more @@ -258,22 +258,22 @@ {{ 'PRODUCT_INVENTORY._pricing' | translate }} - @if(selectedProduct?.productPrice != undefined){ + @if(productOff?.productOfferingPrice != undefined){ @if(checkCustom){ - - @for (price of selectedProduct?.productPrice; track price.id) { + + @for (price of productOff?.productOfferingPrice; track price.id) { @if (price.priceType == 'custom') { - {{price.name}} + {{price.name}} } } - @if(selectedProduct?.productPrice?.length==0){ + @if(productOff?.productOfferingPrice?.length==0){ - + {{ 'SHOPPING_CART._free' | translate }} @@ -281,45 +281,46 @@ - @for (price of selectedProduct?.productPrice; track price) { + + @for (price of productOff?.productOfferingPrice; track price.id) { @if (price.priceType == 'recurring') { - + - {{price.name}} + {{price.name}} + + + - {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}} - /{{price.recurringChargePeriodType}} - {{price?.description}} } @else if (price.priceType == 'usage') { - + {{price.name}} - {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}} - /{{price.unitOfMeasure}} - {{price?.description}} + + + } @else { - + {{price.name}} - {{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}} - {{price?.description}} + + + } } - @if(selectedProduct?.productPrice?.length==0){ - + @if(productOff?.productOfferingPrice?.length==0){ + {{ 'SHOPPING_CART._free' | translate }} {{ 'SHOPPING_CART._free_desc' | translate }} - + } } diff --git a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts index 5331ebcd..bbe5f6a8 100644 --- a/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts +++ b/src/app/pages/product-inventory/inventory-items/inventory-products/inventory-products.component.ts @@ -52,6 +52,7 @@ export class InventoryProductsComponent implements OnInit { selectedInv:any; selectedResources:any[]=[]; selectedServices:any[]=[]; + productOff:any; errorMessage:any=''; showError:boolean=false; @@ -231,37 +232,63 @@ export class InventoryProductsComponent implements OnInit { console.log(id) } - selectProduct(prod:any){ + async selectProduct(prod:any){ this.selectedProduct=prod; console.log('selecting prod') console.log(this.selectedProduct) this.selectedResources=[]; this.selectedServices=[]; - for(let i=0; i { - if(spec.serviceSpecification != undefined){ - for(let j=0; j < spec.serviceSpecification.length; j++){ - this.api.getServiceSpec(spec.serviceSpecification[j].id).then(serv => { - this.selectedServices.push(serv); - console.log(serv) - }) - } + let spec = await this.api.getProductSpecification(this.selectedProduct.product.productSpecification.id) + if(spec.serviceSpecification != undefined){ + for(let j=0; j < spec.serviceSpecification.length; j++){ + let serv = await this.api.getServiceSpec(spec.serviceSpecification[j].id); + this.selectedServices.push(serv); } - if(spec.resourceSpecification != undefined){ - for(let j=0; j < spec.resourceSpecification.length; j++){ - this.api.getResourceSpec(spec.resourceSpecification[j].id).then(res => { - this.selectedResources.push(res); - console.log(res) - }) + } + if(spec.resourceSpecification != undefined){ + for(let j=0; j < spec.resourceSpecification.length; j++){ + let res = await this.api.getResourceSpec(spec.resourceSpecification[j].id); + this.selectedResources.push(res); + } + } + console.log('--- spec') + console.log(spec) + + let prodOff = await this.api.getProductById(this.selectedProduct.productOffering.id); + let prodPrices: any[] | undefined= prodOff.productOfferingPrice; + let prices: any[]=[]; + if(prodPrices!== undefined){ + for(let j=0; j < prodPrices.length; j++){ + let price = await this.api.getProductPrice(prodPrices[j].id); + prices.push(price); + console.log(price) + if(price.priceType == 'custom'){ + this.checkCustom = true; } } - }) + } + + this.productOff={ + id: prodOff.id, + name: prodOff.name, + category: prodOff.category, + description: prodOff.description, + lastUpdate: prodOff.lastUpdate, + attachment: spec.attachment, + productOfferingPrice: prices, + productSpecification: prodOff.productSpecification, + productOfferingTerm: prodOff.productOfferingTerm, + serviceLevelAgreement: prodOff.serviceLevelAgreement, + version: prodOff.version + } this.showDetails=true; console.log(this.selectedProduct) diff --git a/src/app/pages/product-inventory/inventory-resources/inventory-resources.component.html b/src/app/pages/product-inventory/inventory-resources/inventory-resources.component.html index aedf137c..cd09c6d8 100644 --- a/src/app/pages/product-inventory/inventory-resources/inventory-resources.component.html +++ b/src/app/pages/product-inventory/inventory-resources/inventory-resources.component.html @@ -179,7 +179,7 @@ {{ 'OFFERINGS._order_by' | translate }} @if (!loading_more) { @if (page_check) { - + Load more diff --git a/src/app/pages/product-inventory/inventory-services/inventory-services.component.html b/src/app/pages/product-inventory/inventory-services/inventory-services.component.html index e07bcd41..8579dd6e 100644 --- a/src/app/pages/product-inventory/inventory-services/inventory-services.component.html +++ b/src/app/pages/product-inventory/inventory-services/inventory-services.component.html @@ -179,7 +179,7 @@ {{ 'OFFERINGS._order_by' | translate }} @if (!loading_more) { @if (page_check) { - + Load more diff --git a/src/app/pages/product-inventory/product-inventory.component.html b/src/app/pages/product-inventory/product-inventory.component.html index 0b06cffd..473ce463 100644 --- a/src/app/pages/product-inventory/product-inventory.component.html +++ b/src/app/pages/product-inventory/product-inventory.component.html @@ -19,7 +19,7 @@ - {{ 'PRODUCT_INVENTORY._products' | translate }} + {{ 'PRODUCT_INVENTORY._products' | translate }} {{ 'PRODUCT_INVENTORY._services' | translate }} @@ -33,13 +33,13 @@ - + {{ 'PRODUCT_INVENTORY._products' | translate }} - + {{ 'PRODUCT_INVENTORY._services' | translate }} - + {{ 'PRODUCT_INVENTORY._resources' | translate }} diff --git a/src/app/pages/product-orders/product-orders.component.html b/src/app/pages/product-orders/product-orders.component.html index 0049beda..2852d463 100644 --- a/src/app/pages/product-orders/product-orders.component.html +++ b/src/app/pages/product-orders/product-orders.component.html @@ -36,7 +36,7 @@ {{ 'PRODUCT_ORDERS._orders' | translate }} - + {{ 'PRODUCT_ORDERS._invoices' | translate }} diff --git a/src/app/pages/product-orders/sections/invoices-info/invoices-info.component.html b/src/app/pages/product-orders/sections/invoices-info/invoices-info.component.html index ea711f9f..cded41ab 100644 --- a/src/app/pages/product-orders/sections/invoices-info/invoices-info.component.html +++ b/src/app/pages/product-orders/sections/invoices-info/invoices-info.component.html @@ -59,7 +59,7 @@ @for (invoice of invoices; track invoice.id; let idx = $index) { - + {{invoice?.billDate | date:'EEEE, dd/MM/yy, HH:mm'}} @@ -136,7 +136,7 @@ @if (showInvoiceDetails){ - + {{ 'INVOICES._applied_billing_rates' | translate }} diff --git a/src/app/pages/product-orders/sections/order-info/order-info.component.html b/src/app/pages/product-orders/sections/order-info/order-info.component.html index 55ff0aaa..f88555f4 100644 --- a/src/app/pages/product-orders/sections/order-info/order-info.component.html +++ b/src/app/pages/product-orders/sections/order-info/order-info.component.html @@ -1,7 +1,7 @@ - @if(isSeller){ - {{order?.orderDate | date:'EEEE, dd/MM/yy, HH:mm'}} - + @@ -413,7 +413,7 @@ @if (!hasProcurementAutomaticTerm(item)) { @if (!item.productOrderItem.state && role == 'Seller') { - @@ -423,7 +423,7 @@ - } @else { @if(role == 'Seller'){ @if (item.productOrderItem.state === 'acknowledged') { - } @else if (item.productOrderItem.state === 'inProgress') { - @@ -501,12 +501,12 @@ - Yes, Confirm - diff --git a/src/app/pages/search-catalog/search-catalog.component.html b/src/app/pages/search-catalog/search-catalog.component.html index a92cfee1..e10555b5 100644 --- a/src/app/pages/search-catalog/search-catalog.component.html +++ b/src/app/pages/search-catalog/search-catalog.component.html @@ -73,10 +73,10 @@ } @else { - + diff --git a/src/app/pages/search-catalog/search-catalog.component.ts b/src/app/pages/search-catalog/search-catalog.component.ts index 025f721f..0f175556 100644 --- a/src/app/pages/search-catalog/search-catalog.component.ts +++ b/src/app/pages/search-catalog/search-catalog.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ChangeDetectorRef, HostListener } from '@angular/core'; +import { Component, OnInit, ChangeDetectorRef, HostListener, OnDestroy } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ApiServiceService } from 'src/app/services/product-service.service'; import { PriceServiceService } from 'src/app/services/price-service.service'; @@ -19,7 +19,7 @@ import * as moment from 'moment'; templateUrl: './search-catalog.component.html', styleUrl: './search-catalog.component.css' }) -export class SearchCatalogComponent implements OnInit{ +export class SearchCatalogComponent implements OnInit, OnDestroy{ constructor( private route: ActivatedRoute, private api: ApiServiceService, @@ -136,6 +136,13 @@ export class SearchCatalogComponent implements OnInit{ this.router.navigate([path]); } + ngOnDestroy(){ + let storedFilters = this.localStorage.getObject('selected_categories') as Category[] || []; + for(let i=0;i - + Load more diff --git a/src/app/pages/search/search.component.ts b/src/app/pages/search/search.component.ts index 87521b8f..886f16d2 100644 --- a/src/app/pages/search/search.component.ts +++ b/src/app/pages/search/search.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ChangeDetectorRef, SimpleChanges, OnChanges, HostListener, AfterViewInit } from '@angular/core'; +import { Component, OnInit, ChangeDetectorRef, SimpleChanges, OnChanges, HostListener, AfterViewInit, OnDestroy } from '@angular/core'; import { CommonModule } from '@angular/common'; import {CategoriesFilterComponent} from "../../shared/categories-filter/categories-filter.component"; import {components} from "../../models/product-catalog"; @@ -21,7 +21,7 @@ import * as moment from 'moment'; templateUrl: './search.component.html', styleUrl: './search.component.css' }) -export class SearchComponent implements OnInit { +export class SearchComponent implements OnInit, OnDestroy { products: ProductOffering[]=[]; nextProducts: ProductOffering[]=[]; @@ -159,6 +159,14 @@ export class SearchComponent implements OnInit { } } + ngOnDestroy(){ + let storedFilters = this.localStorage.getObject('selected_categories') as Category[] || []; + for(let i=0;i{{ 'OFFERINGS._order_by' | translate }} @if (!loading_more) { @if (page_check) { - + {{ 'OFFERINGS._load_more' | translate }} diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html index 1a7853a1..7ad1864e 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html @@ -567,17 +567,19 @@ There's no char } {{ 'CREATE_PROD_SPEC._type' | translate }} - String Number Number range + Credentials Configuration + Authorization Policy Boolean {{ 'CREATE_PROD_SPEC._product_description' | translate }} - @@ -682,8 +684,21 @@ There's no char - - + + + + } @else if (credentialsConfigSelected || policyConfigSelected){ + + {{ 'CREATE_PROD_SPEC._json_value' | translate }} + + + + + + {{ 'CREATE_PROD_SPEC._add_json' | translate }} + } @@ -730,8 +745,8 @@ {{ 'CREATE_ }@else{ - - + + @@ -830,8 +845,8 @@ {{ 'CREATE_ }@else{ - - + + diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts index 777c1421..09804bab 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts @@ -84,11 +84,13 @@ export class CreateProductSpecComponent implements OnInit { //CHARS INFO charsForm = new FormGroup({ name: new FormControl('', [Validators.required, Validators.maxLength(100), noWhitespaceValidator]), - description: new FormControl('') + description: new FormControl('', [Validators.maxLength(500)]) }); stringCharSelected:boolean=true; numberCharSelected:boolean=false; rangeCharSelected:boolean=false; + credentialsConfigSelected:boolean=false; + policyConfigSelected:boolean=false; booleanCharSelected:boolean=false; prodChars:ProductSpecificationCharacteristic[]=[]; finishChars:ProductSpecificationCharacteristic[]=[]; @@ -172,6 +174,7 @@ export class CreateProductSpecComponent implements OnInit { toValue: string = ''; booleanValue: boolean = false; rangeUnit: string = ''; + jsonValue: string = ''; filenameRegex = /^[A-Za-z0-9_.-]+$/; @@ -627,6 +630,8 @@ export class CreateProductSpecComponent implements OnInit { this.stringCharSelected=true; this.numberCharSelected=false; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.booleanCharSelected=false; this.showPreview=false; this.refreshChars(); @@ -932,9 +937,12 @@ export class CreateProductSpecComponent implements OnInit { this.fromValue = ''; this.toValue = ''; this.rangeUnit = ''; + this.jsonValue = ''; this.stringCharSelected=true; this.numberCharSelected=false; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.booleanCharSelected=false; this.creatingChars=[]; } @@ -999,24 +1007,48 @@ export class CreateProductSpecComponent implements OnInit { this.stringCharSelected=true; this.numberCharSelected=false; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.booleanCharSelected=false; this.charsForm.reset(); }else if (event.target.value=='number'){ this.stringCharSelected=false; this.numberCharSelected=true; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.booleanCharSelected=false; this.charsForm.reset(); - }else if (event.target.value=='range'){ + }else if(event.target.value=='range'){ this.stringCharSelected=false; this.numberCharSelected=false; this.rangeCharSelected=true; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; + this.booleanCharSelected=false; + this.charsForm.reset(); + }else if(event.target.value=='credentialsConfiguration'){ + this.stringCharSelected=false; + this.numberCharSelected=false; + this.rangeCharSelected=false; + this.credentialsConfigSelected=true; + this.policyConfigSelected=false; + this.booleanCharSelected=false; + this.charsForm.reset(); + }else if(event.target.value=='authorizationPolicy'){ + this.stringCharSelected=false; + this.numberCharSelected=false; + this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=true; this.booleanCharSelected=false; this.charsForm.reset(); } else { this.stringCharSelected=false; this.numberCharSelected=false; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.booleanCharSelected=true; // Set default only if not already selected if (!this.charsForm.get('name')?.value && this.nonBooleanChars.length > 0) { @@ -1044,7 +1076,7 @@ export class CreateProductSpecComponent implements OnInit { value:this.stringValue as any }) } - this.stringValue=''; + this.stringValue=''; } else if (this.numberCharSelected){ console.log('number') if(this.creatingChars.length==0){ @@ -1077,7 +1109,33 @@ export class CreateProductSpecComponent implements OnInit { valueFrom:this.fromValue as any, valueTo:this.toValue as any, unitOfMeasure:this.rangeUnit}) - } + } + this.fromValue=''; + this.toValue=''; + this.rangeUnit=''; + }else if(this.credentialsConfigSelected || this.policyConfigSelected){ + console.log('json') + try { + const jsonObj = JSON.parse(this.jsonValue); + if(this.creatingChars.length==0){ + this.creatingChars.push({ + isDefault:true, + value:jsonObj as any + }) + } else{ + this.creatingChars.push({ + isDefault:false, + value:jsonObj as any + }) + } + this.jsonValue=''; + } catch (e) { + this.errorMessage='Invalid JSON format'; + this.showError=true; + setTimeout(() => { + this.showError = false; + }, 3000); + } } else { console.log('boolean') if(this.creatingChars.length==0){ @@ -1115,22 +1173,32 @@ export class CreateProductSpecComponent implements OnInit { if(this.booleanCharSelected){ this.creatingChars=[ { - isDefault:true, + isDefault:false, value: true as any }, { - isDefault:false, + isDefault:true, value:false as any } ] } if(this.charsForm.value.name!=null){ - this.prodChars.push({ + let characteristic: any = { id: 'urn:ngsi-ld:characteristic:'+uuidv4(), name: this.charsForm.value.name, description: this.charsForm.value.description != null ? this.charsForm.value.description : '', productSpecCharacteristicValue: this.creatingChars - }) + }; + + if(this.credentialsConfigSelected){ + characteristic.valueType = 'credentialsConfiguration'; + characteristic['@schemaLocation'] = 'https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/main/schemas/credentials/credentialConfigCharacteristic.json'; + } else if(this.policyConfigSelected){ + characteristic.valueType = 'authorizationPolicy'; + characteristic['@schemaLocation'] = 'https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/policy-support/schemas/odrl/policyCharacteristic.json'; + } + + this.prodChars.push(characteristic); // Check if it's not a boolean-enabled characteristic if (!this.charsForm.value.name.endsWith('- enabled')) { @@ -1159,6 +1227,8 @@ export class CreateProductSpecComponent implements OnInit { this.stringCharSelected=true; this.numberCharSelected=false; this.rangeCharSelected=false; + this.credentialsConfigSelected=false; + this.policyConfigSelected=false; this.refreshChars(); this.cdr.detectChanges(); } diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html index 540070be..b8aaf27b 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html @@ -688,7 +688,7 @@ There's no char {{ 'UPDATE_PROD_SPEC._product_description' | translate }} - diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts index 0cfb55ad..84df4494 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts @@ -79,7 +79,7 @@ export class UpdateProductSpecComponent implements OnInit { //CHARS INFO charsForm = new FormGroup({ name: new FormControl('', [Validators.required, Validators.maxLength(100), noWhitespaceValidator]), - description: new FormControl('') + description: new FormControl('', [Validators.maxLength(500)]) }); stringCharSelected:boolean=true; numberCharSelected:boolean=false; @@ -332,6 +332,8 @@ export class UpdateProductSpecComponent implements OnInit { id: 'urn:ngsi-ld:characteristic:'+uuidv4(), name: this.prod.productSpecCharacteristic[i].name, description: this.prod.productSpecCharacteristic[i].description ? this.prod.productSpecCharacteristic[i].description : '', + valueType: this.prod.productSpecCharacteristic[i].valueType, + '@schemaLocation': this.prod.productSpecCharacteristic[i]['@schemaLocation'], productSpecCharacteristicValue: this.prod.productSpecCharacteristic[i].productSpecCharacteristicValue }); @@ -1329,11 +1331,11 @@ export class UpdateProductSpecComponent implements OnInit { if(this.booleanCharSelected){ this.creatingChars=[ { - isDefault:true, + isDefault:false, value: true as any }, { - isDefault:false, + isDefault:true, value:false as any } ] @@ -1476,11 +1478,10 @@ export class UpdateProductSpecComponent implements OnInit { lifecycleStatus: this.prodStatus, //isBundle: this.bundleChecked, //bundledProductSpecification: this.prodSpecsBundle, - productSpecCharacteristic: this.finishChars, productSpecificationRelationship: rels, attachment: this.prodAttachments, resourceSpecification: this.selectedResourceSpecs, - serviceSpecification: this.selectedServiceSpecs + serviceSpecification: this.selectedServiceSpecs } } this.selectStep('summary','summary-circle'); diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html index 411fa7e9..7cb9ec39 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html @@ -69,16 +69,16 @@ {{ 'CREATE_PROD_SPEC._finish' | tra {{ 'CREATE_RES_SPEC._general' | translate }} {{ 'CREATE_RES_SPEC._name' | translate }} - - + {{ 'CREATE_RES_SPEC._description' | translate }} - + - + {{ 'CREATE_RES_SPEC._next' | translate }} @@ -168,24 +168,24 @@ {{ 'CREATE_ } @if(showCreateChar==false){ - + {{ 'CREATE_RES_SPEC._new_char' | translate }} - + } @else { {{ 'CREATE_RES_SPEC._name' | translate }} - - + {{ 'CREATE_RES_SPEC._type' | translate }} - String Number @@ -194,7 +194,7 @@ {{ 'CREATE_ {{ 'CREATE_RES_SPEC._description' | translate }} - @@ -240,9 +240,9 @@ {{ 'CREATE_ {{ 'CREATE_RES_SPEC._add_values' | translate }} @if(stringCharSelected){ - - + @@ -254,22 +254,22 @@ {{ 'CREATE_ {{ 'CREATE_RES_SPEC._value' | translate }} - {{ 'CREATE_RES_SPEC._unit' | translate }} - - - - + + + - - + + } @else if (rangeCharSelected && creatingChars.length==0){ @@ -277,43 +277,43 @@ {{ 'CREATE_ {{ 'CREATE_RES_SPEC._from' | translate }} - {{ 'CREATE_RES_SPEC._to' | translate }} - {{ 'CREATE_RES_SPEC._unit' | translate }} - - + - - + + } - + {{ 'CREATE_RES_SPEC._save_char' | translate }} - + } - + {{ 'CREATE_RES_SPEC._next' | translate }} @@ -420,7 +420,7 @@ {{ 'CREATE_ } } - + {{ 'CREATE_RES_SPEC._create_res' | translate }} diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/seller-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/seller-resource-spec.component.html index 39c8b5fc..1f311920 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/seller-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/seller-resource-spec.component.html @@ -19,7 +19,7 @@ {{ 'OFFERINGS._res_spec' | t --> - + {{ 'OFFERINGS._add_new_res' | translate }} @@ -116,7 +116,7 @@ {{ 'OFFERINGS._order_by' | translate }} } @else { - + @@ -135,7 +135,7 @@ {{ 'OFFERINGS._order_by' | translate }} @for (res of resSpecs; track res.id) { - + {{res.name}} @@ -154,7 +154,7 @@ {{ 'OFFERINGS._order_by' | translate }} {{res.lastUpdate | date:'EEEE, dd/MM/yy, HH:mm'}} - + @@ -185,7 +185,7 @@ {{ 'OFFERINGS._order_by' | translate }} @if (!loading_more) { @if (page_check) { - + Load more diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html index d48de377..4bd689df 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html @@ -106,9 +106,9 @@ {{ 'UPDATE_ }@else{ - - + Launched @@ -156,7 +156,7 @@ {{ 'UPDATE_ - + {{ 'UPDATE_RES_SPEC._next' | translate }} @@ -428,7 +428,7 @@ - + {{ 'UPDATE_RES_SPEC._next' | translate }} @@ -535,7 +535,7 @@ {{ 'CREATE_ } } - + {{ 'UPDATE_RES_SPEC._update_res' | translate }} diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html index bf07814a..add1e2a8 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html @@ -69,16 +69,16 @@ {{ 'CREATE_PROD_SPEC._finish' | tra {{ 'CREATE_SERV_SPEC._general' | translate }} {{ 'CREATE_SERV_SPEC._name' | translate }} - {{ 'CREATE_SERV_SPEC._description' | translate }} - + - + {{ 'CREATE_SERV_SPEC._next' | translate }} @@ -169,24 +169,24 @@ {{ 'CREATE_ } @if(showCreateChar==false){ - + {{ 'CREATE_SERV_SPEC._new_char' | translate }} - + } @else { {{ 'PROFILE._name' | translate }} - - + {{ 'CREATE_SERV_SPEC._type' | translate }} - String Number @@ -195,7 +195,7 @@ {{ 'CREATE_ {{ 'CREATE_SERV_SPEC._description' | translate }} - @@ -241,13 +241,13 @@ {{ 'CREATE_ {{ 'CREATE_SERV_SPEC._add_values' | translate }} @if(stringCharSelected){ - - + - - + + } @else if (numberCharSelected){ @@ -255,22 +255,22 @@ {{ 'CREATE_ {{ 'CREATE_SERV_SPEC._value' | translate }} - {{ 'CREATE_SERV_SPEC._unit' | translate }} - - - - + + + - - + + } @else if (rangeCharSelected && creatingChars.length==0){ @@ -278,43 +278,43 @@ {{ 'CREATE_ {{ 'CREATE_SERV_SPEC._from' | translate }} - {{ 'CREATE_SERV_SPEC._to' | translate }} - {{ 'CREATE_SERV_SPEC._unit' | translate }} - - + - - + + } - + {{ 'CREATE_SERV_SPEC._save_char' | translate }} - + } - + {{ 'CREATE_SERV_SPEC._next' | translate }} @@ -421,7 +421,7 @@ {{ 'CREATE_ } } - + {{ 'CREATE_SERV_SPEC._create_serv' | translate }} diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/seller-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/seller-service-spec.component.html index 3bc0a3a2..a9867c62 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/seller-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/seller-service-spec.component.html @@ -19,7 +19,7 @@ {{ 'OFFERINGS._serv_spec' | --> - + {{ 'OFFERINGS._add_new_serv' | translate }} @@ -117,7 +117,7 @@ {{ 'OFFERINGS._order_by' | translate }} } @else { - + @@ -136,7 +136,7 @@ {{ 'OFFERINGS._order_by' | translate }} @for (serv of servSpecs; track serv.id) { - + {{serv.name}} @@ -155,7 +155,7 @@ {{ 'OFFERINGS._order_by' | translate }} {{serv.lastUpdate | date:'EEEE, dd/MM/yy, HH:mm'}} - + diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html index 5f192959..bddac745 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html @@ -106,9 +106,9 @@ {{ 'UPDATE_ }@else{ - - + Launched @@ -156,7 +156,7 @@ {{ 'UPDATE_ - + {{ 'UPDATE_SERV_SPEC._next' | translate }} @@ -391,7 +391,7 @@ {{ 'UPDATE_ } - + {{ 'UPDATE_SERV_SPEC._next' | translate }} @@ -498,7 +498,7 @@ {{ 'CREATE_ } } - + {{ 'UPDATE_SERV_SPEC._update_serv' | translate }} diff --git a/src/app/pages/seller-offerings/seller-offerings.component.html b/src/app/pages/seller-offerings/seller-offerings.component.html index 134995eb..ac9eb32a 100644 --- a/src/app/pages/seller-offerings/seller-offerings.component.html +++ b/src/app/pages/seller-offerings/seller-offerings.component.html @@ -52,10 +52,10 @@ {{ 'OFFERINGS._prod_spec' | translate }} - + {{ 'OFFERINGS._serv_spec' | translate }} - + {{ 'OFFERINGS._res_spec' | translate }} diff --git a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.html b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.html index 8114a98b..6c98af2d 100644 --- a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.html +++ b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.html @@ -33,6 +33,11 @@ {{ 'PROFILE._did' | translate }} + + {{ 'UPDATE_OFFER._description' | translate }} diff --git a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts index 3eaf0c4e..5b5a8596 100644 --- a/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts +++ b/src/app/pages/user-profile/profile-sections/org-info/org-info.component.ts @@ -35,7 +35,8 @@ export class OrgInfoComponent implements OnInit { name: new FormControl('', [Validators.required]), website: new FormControl(''), description: new FormControl(''), - country: new FormControl('',[Validators.required]), + country: new FormControl('', [Validators.required]), + did: new FormControl(''), }); mediumForm = new FormGroup({ email: new FormControl('', [Validators.required, Validators.email, Validators.pattern('^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$'), Validators.maxLength(320)]), @@ -189,7 +190,13 @@ export class OrgInfoComponent implements OnInit { chars.push({ name: 'country', value: this.profileForm.value.country - }) + }) + } + if(this.profileForm.value.did != ''){ + chars.push({ + name: 'did', + value: this.profileForm.value.did + }) } for(let i=0; i { - this.successVisibility = false - }, 2000); + this.successVisibility = false; + }, 2000); + this.mediumForm.reset(); }, error: error => { console.error('There was an error while updating!', error); @@ -309,9 +317,11 @@ export class OrgInfoComponent implements OnInit { this.profileForm.controls['description'].setValue(profile.partyCharacteristic[i].value); this.description=profile.partyCharacteristic[i].value; }else if(profile.partyCharacteristic[i].name=='website') { - this.profileForm.controls['website'].setValue(profile.partyCharacteristic[i].value); + this.profileForm.controls['website'].setValue(profile.partyCharacteristic[i].value); } else if(profile.partyCharacteristic[i].name=='country') { this.profileForm.controls['country'].setValue(profile.partyCharacteristic[i].value); + } else if(profile.partyCharacteristic[i].name=='did') { + this.profileForm.controls['did'].setValue(profile.partyCharacteristic[i].value); } } } diff --git a/src/app/services/app-init.service.ts b/src/app/services/app-init.service.ts index 8f4cfd7a..5bfe5c53 100644 --- a/src/app/services/app-init.service.ts +++ b/src/app/services/app-init.service.ts @@ -35,6 +35,7 @@ export class AppInitService { environment.analytics = config.analytics ?? 'https://analytics.dome-marketplace-sbx.org/', environment.feedbackCampaign = config.feedbackCampaign ?? false, environment.feedbackCampaignExpiration = config.feedbackCampaign ?? moment().add(1, 'week').unix() + environment.providerThemeName = config.theme ?? 'default'; resolve(config); }), error: (error) => { diff --git a/src/app/shared/characteristic/characteristic.component.html b/src/app/shared/characteristic/characteristic.component.html index cf1f5f00..231ae9d1 100644 --- a/src/app/shared/characteristic/characteristic.component.html +++ b/src/app/shared/characteristic/characteristic.component.html @@ -4,7 +4,7 @@ {{ characteristic.name }} - + @if(!isDisabled){ @if (isSlider()){ @@ -32,6 +32,7 @@ {{ charact } + } } @else { diff --git a/src/app/shared/characteristic/characteristic.component.ts b/src/app/shared/characteristic/characteristic.component.ts index 4f06566d..0ed4214c 100644 --- a/src/app/shared/characteristic/characteristic.component.ts +++ b/src/app/shared/characteristic/characteristic.component.ts @@ -35,6 +35,8 @@ interface Characteristic { export class CharacteristicComponent implements OnInit { @Input() characteristic!: ProductSpecificationCharacteristic; @Input() readOnly: boolean = false; + @Input() isDisabled: boolean = false; + @Input() canBeDisabled: boolean = false; @Output() valueChange = new EventEmitter(); control = new FormControl(); diff --git a/src/app/shared/footer/footer.component.html b/src/app/shared/footer/footer.component.html index 7b419673..1f238973 100644 --- a/src/app/shared/footer/footer.component.html +++ b/src/app/shared/footer/footer.component.html @@ -1,7 +1,7 @@ -
+ You need to create at least one valid billing address. +
- Distributed Open Marketplace for Europe (DOME) Project has received funding from - European Union’s Digital Europe Programme under the Grant Agreement No 101084071. -
+ Distributed Open Marketplace for Europe (DOME) Project has received funding from + European Union’s Digital Europe Programme under the Grant Agreement No 101084071. +
{{rel.relationshipType}}
{{price.price?.taxIncludedAmount?.value}} {{price.price?.taxIncludedAmount?.unit}}
/{{price.recurringChargePeriodType}}
{{price?.description}}
/{{price.unitOfMeasure}}
{{ 'SHOPPING_CART._free_desc' | translate }}
{{ 'OFFERINGS._add_new_res' | translate }}
{{ 'OFFERINGS._add_new_serv' | translate }}