diff --git a/backend/internal/entity/user/methods.go b/backend/internal/entity/user/methods.go index 85b2ac0..65a754f 100644 --- a/backend/internal/entity/user/methods.go +++ b/backend/internal/entity/user/methods.go @@ -12,6 +12,7 @@ import ( func GetByID(id uint) (Model, error) { var m Model err := m.LoadByID(id) + m.generateGravatar() return m, err } diff --git a/frontend/src/components/SiteWrapper.tsx b/frontend/src/components/SiteWrapper.tsx index 1f4dc07..65443f2 100644 --- a/frontend/src/components/SiteWrapper.tsx +++ b/frontend/src/components/SiteWrapper.tsx @@ -2,7 +2,6 @@ import { useEffect, ReactNode } from "react"; import { Box, Container, useToast } from "@chakra-ui/react"; import { useQueryClient } from "@tanstack/react-query"; - import { getSSEToken, SSEMessage } from "src/api/npm"; import { Footer, Navigation } from "src/components"; import { intl } from "src/locale"; @@ -26,6 +25,7 @@ function SiteWrapper({ children }: Props) { eventSource.onmessage = (e: any) => { const j: SSEMessage = JSON.parse(e.data); if (j) { + console.log("SSE Message:", j); if (j.affects) { queryClient.invalidateQueries({ queryKey: [j.affects] }); } diff --git a/frontend/src/pages/Certificates/Table.tsx b/frontend/src/pages/Certificates/Table.tsx index a75e3b7..b41759a 100644 --- a/frontend/src/pages/Certificates/Table.tsx +++ b/frontend/src/pages/Certificates/Table.tsx @@ -8,6 +8,7 @@ import { ActionsFormatter, CertificateStatusFormatter, CertificateTypeFormatter, + DomainsFormatter, GravatarFormatter, IDFormatter, MonospaceFormatter, @@ -59,7 +60,14 @@ function Table({ Cell: MonospaceFormatter(), }, { - Header: intl.formatMessage({ id: "column.validation-type" }), + Header: intl.formatMessage({ id: "column.domain-names" }), + accessor: "domainNames", + sortable: true, + Filter: TextFilter, + Cell: DomainsFormatter(), + }, + { + Header: intl.formatMessage({ id: "column.type" }), accessor: "type", sortable: true, Cell: CertificateTypeFormatter(), diff --git a/test/cypress/e2e/api/Certificates.cy.js b/test/cypress/e2e/api/Certificates.cy.js index 4dfba36..b60ef9d 100644 --- a/test/cypress/e2e/api/Certificates.cy.js +++ b/test/cypress/e2e/api/Certificates.cy.js @@ -37,11 +37,14 @@ describe('Certificates endpoints', () => { it('Should be able to get a certificate', function() { cy.task('backendApiGet', { token: token, - path: '/api/certificates/' + certID + path: '/api/certificates/' + certID + '?expand=user' }).then((data) => { // Check the swagger schema: cy.validateSwaggerSchema('get', 200, '/certificates/{certificateID}', data); expect(data.result).to.have.property('id', certID); + expect(data.result).to.have.property('user'); + expect(data.result.user).to.have.property('gravatar_url'); + expect(data.result.user.gravatar_url).to.include('gravatar.com'); }); }); @@ -63,12 +66,15 @@ describe('Certificates endpoints', () => { it('Should be able to get all certificates', function() { cy.task('backendApiGet', { token: token, - path: '/api/certificates' + path: '/api/certificates?expand=user' }).then((data) => { cy.validateSwaggerSchema('get', 200, '/certificates', data); expect(data).to.have.property('result'); expect(data.result).to.have.property('items'); expect(data.result.items.length).to.be.greaterThan(0); + expect(data.result.items[0]).to.have.property('user'); + expect(data.result.items[0].user).to.have.property('gravatar_url'); + expect(data.result.items[0].user.gravatar_url).to.include('gravatar.com'); }); });