28 Commits

Author SHA1 Message Date
Florian THIERRY
dee473fe46 Add interceptor to inject correlation id in http requests. 2024-09-26 10:38:52 +02:00
Florian THIERRY
5647a5a959 Implementation of jpa saving for traffic traces. 2024-09-26 10:21:20 +02:00
Florian THIERRY
c817371a15 Add skeletton to save traces. 2024-09-25 21:30:25 +02:00
ff52a198dc Upgrade to angular 18. 2024-09-24 22:47:15 +02:00
Florian THIERRY
f3d59a0ef3 conf cleaning. 2024-09-22 13:18:08 +02:00
Florian THIERRY
d84485e52b test 2024-09-22 13:03:39 +02:00
Florian THIERRY
f789d89995 test 2024-09-22 12:53:55 +02:00
Florian THIERRY
7e0174bcc2 test 2024-09-22 12:46:41 +02:00
Florian THIERRY
fe1d59a3bb test 2024-09-22 12:37:01 +02:00
Florian THIERRY
69a99c9312 test 2024-09-22 12:34:02 +02:00
Florian THIERRY
a6414ae64d test 2024-09-22 12:30:18 +02:00
Florian THIERRY
9cf47f0e2a test 2024-09-22 12:27:59 +02:00
Florian THIERRY
6c89562dc3 test 2024-09-22 12:14:04 +02:00
Florian THIERRY
e85eabbed5 test 2024-09-22 12:01:05 +02:00
Florian THIERRY
1ec4ba8212 test conf prod. 2024-09-22 11:10:01 +02:00
Florian THIERRY
a1ff181443 test conf prod. 2024-09-22 11:09:14 +02:00
Florian THIERRY
ee8f48bc43 Fix prod fr configuration. 2024-09-22 10:55:49 +02:00
Florian THIERRY
7ec1aee884 test 2024-09-21 23:39:46 +02:00
Florian THIERRY
a3adfa8ee0 Fix bug of preview content. 2024-09-21 22:20:00 +02:00
Florian THIERRY
d893afa1f3 i18n 2024-09-21 21:43:09 +02:00
Florian THIERRY
d984128176 i18n 2024-09-21 21:40:49 +02:00
Florian THIERRY
f8d73c9ed0 i18n 2024-09-21 21:34:16 +02:00
Florian THIERRY
208b935ffa i18n for some components. 2024-09-21 21:17:31 +02:00
Florian THIERRY
f12dfc7029 i18n for files in core package. 2024-09-21 21:09:36 +02:00
Florian THIERRY
98a890e915 i18n for signin page. 2024-09-21 21:06:47 +02:00
Florian THIERRY
0c1b52d734 i18n for publication search page. 2024-09-21 21:03:34 +02:00
Florian THIERRY
3f6764dd7d i18n for publication update page. 2024-09-21 21:00:59 +02:00
Florian THIERRY
67c3d0b3e6 i18n of publication creation page. 2024-09-21 20:57:05 +02:00
62 changed files with 3350 additions and 2807 deletions

View File

@@ -7,6 +7,6 @@ RUN npm run build-prod-fr
FROM nginx:1.27-alpine AS final
WORKDIR /app
COPY --from=builder /app/dist/codiki-ng/en/browser /usr/share/nginx/html/en/
COPY --from=builder /app/dist/codiki-ng/fr/browser /usr/share/nginx/html/fr/
COPY --from=builder /app/dist/codiki/en/browser /usr/share/nginx/html/en/
COPY --from=builder /app/dist/codiki/fr/browser/fr /usr/share/nginx/html/fr/
COPY frontend/conf/nginx.conf /etc/nginx/nginx.conf

View File

@@ -25,6 +25,10 @@ public class CustomUserDetails implements UserDetails {
.toList();
}
public User getUser() {
return user;
}
@Override
public String getUsername() {
return user.id().toString();

View File

@@ -0,0 +1,47 @@
package org.codiki.application.traffic;
import jakarta.annotation.Nullable;
import org.codiki.domain.traffic.exception.TrafficTraceCreationException;
import org.codiki.domain.traffic.model.TrafficEndpoint;
import org.codiki.domain.traffic.model.TrafficTrace;
import org.codiki.domain.traffic.port.TrafficTracePort;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.time.Clock;
import java.time.ZonedDateTime;
import java.util.UUID;
import static java.util.Objects.isNull;
import static org.codiki.domain.traffic.model.TrafficTrace.aTrafficTrace;
@Component
public class TrafficTraceUseCases {
private final TrafficTracePort trafficTracePort;
private final Clock clock;
public TrafficTraceUseCases(TrafficTracePort trafficTracePort, Clock clock) {
this.trafficTracePort = trafficTracePort;
this.clock = clock;
}
@Async
public void saveNewTrace(
TrafficEndpoint trafficEndpoint,
@Nullable UUID userId,
@Nullable String correlationId
) {
if (isNull(trafficEndpoint)) {
throw new TrafficTraceCreationException("Traffic endpoint should not be null.");
}
TrafficTrace newTrace = aTrafficTrace()
.withId(UUID.randomUUID())
.withDateTime(ZonedDateTime.now(clock))
.withEndpoint(trafficEndpoint)
.withUserId(userId)
.withCorrelationId(correlationId)
.build();
trafficTracePort.save(newTrace);
}
}

View File

@@ -87,9 +87,7 @@ public class UserUseCases {
.map(Authentication::getPrincipal)
.filter(CustomUserDetails.class::isInstance)
.map(CustomUserDetails.class::cast)
.map(CustomUserDetails::getUsername)
.map(UUID::fromString)
.flatMap(userPort::findById);
.map(CustomUserDetails::getUser);
}
private UserAuthenticationData generateAuthenticationData(User user) {

View File

@@ -0,0 +1,9 @@
package org.codiki.domain.traffic.exception;
import org.codiki.domain.exception.FunctionnalException;
public class TrafficTraceCreationException extends FunctionnalException {
public TrafficTraceCreationException(String message) {
super(message);
}
}

View File

@@ -0,0 +1,14 @@
package org.codiki.domain.traffic.model;
import java.util.Arrays;
import java.util.Optional;
public enum HttpMethod {
GET, POST, PUT, DELETE;
public static Optional<HttpMethod> fromString(String methodAsString) {
return Arrays.stream(values())
.filter(method -> method.name().equals(methodAsString))
.findFirst();
}
}

View File

@@ -0,0 +1,6 @@
package org.codiki.domain.traffic.model;
public record TrafficEndpoint(
HttpMethod method,
String path
) {}

View File

@@ -0,0 +1,55 @@
package org.codiki.domain.traffic.model;
import java.time.ZonedDateTime;
import java.util.UUID;
public record TrafficTrace(
UUID id,
ZonedDateTime dateTime,
TrafficEndpoint endpoint,
UUID userId,
String correlationId
) {
public static Builder aTrafficTrace() {
return new Builder();
}
public static class Builder {
private UUID id;
private ZonedDateTime dateTime;
private TrafficEndpoint endpoint;
private UUID userId;
private String correlationId;
private Builder() {}
public Builder withId(UUID id) {
this.id = id;
return this;
}
public Builder withDateTime(ZonedDateTime dateTime) {
this.dateTime = dateTime;
return this;
}
public Builder withEndpoint(TrafficEndpoint endpoint) {
this.endpoint = endpoint;
return this;
}
public Builder withUserId(UUID userId) {
this.userId = userId;
return this;
}
public Builder withCorrelationId(String correlationId) {
this.correlationId = correlationId;
return this;
}
public TrafficTrace build() {
return new TrafficTrace(id, dateTime, endpoint, userId, correlationId);
}
}
}

View File

@@ -0,0 +1,14 @@
package org.codiki.domain.traffic.port;
import org.codiki.domain.traffic.model.TrafficTrace;
import java.time.ZonedDateTime;
import java.util.List;
public interface TrafficTracePort {
void save(TrafficTrace trace);
List<TrafficTrace> getAllInPeriod(ZonedDateTime startDate, ZonedDateTime endDate);
List<TrafficTrace> getAllByCorrelationId(String correlationId);
Integer countAllInPeriod(ZonedDateTime startDate, ZonedDateTime endDate);
Integer countByCorrelationId(String correlationId);
}

View File

@@ -25,6 +25,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@@ -33,28 +37,5 @@
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-jpa</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-security</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.postgresql</groupId>-->
<!-- <artifactId>postgresql</artifactId>-->
<!-- <scope>runtime</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-test</artifactId>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.security</groupId>-->
<!-- <artifactId>spring-security-test</artifactId>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
</dependencies>
</project>

View File

@@ -0,0 +1,12 @@
package org.codiki.exposition.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
@Configuration
@EnableAspectJAutoProxy
@EnableAsync
public class TrafficTraceConfiguration {
}

View File

@@ -38,10 +38,6 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
.filter(authorizationHeader -> !isEmpty(authorizationHeader))
.filter(authorizationHeader -> authorizationHeader.startsWith(BEARER_PREFIX))
.map(authorizationHeader -> authorizationHeader.substring(BEARER_PREFIX.length()))
.filter(token -> {
String authorizationHeader = request.getHeader(AUTHORIZATION);
return !isEmpty(authorizationHeader) && authorizationHeader.startsWith(BEARER_PREFIX);
})
.filter(jwtService::isValid)
.flatMap(jwtService::extractUser)
.map(CustomUserDetails::new)

View File

@@ -1,29 +1,22 @@
package org.codiki.exposition.publication;
import org.codiki.application.publication.PublicationUseCases;
import org.codiki.domain.publication.exception.NoPublicationSearchResultException;
import org.codiki.domain.publication.exception.PublicationNotFoundException;
import org.codiki.domain.publication.model.Publication;
import org.codiki.domain.publication.model.PublicationEditionRequest;
import org.codiki.exposition.publication.model.PreviewContentRequest;
import org.codiki.exposition.publication.model.PreviewContentResponse;
import org.codiki.exposition.publication.model.PublicationDto;
import org.codiki.exposition.publication.model.PublicationEditionRequestDto;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
import static org.springframework.http.HttpStatus.CREATED;
import static org.springframework.http.HttpStatus.NO_CONTENT;
import static org.springframework.util.ObjectUtils.isEmpty;
import org.codiki.application.publication.PublicationUseCases;
import org.codiki.domain.publication.exception.NoPublicationSearchResultException;
import org.codiki.domain.publication.exception.PublicationNotFoundException;
import org.codiki.domain.publication.model.Publication;
import org.codiki.domain.publication.model.PublicationEditionRequest;
import org.codiki.exposition.publication.model.PreviewContentRequest;
import org.codiki.exposition.publication.model.PublicationDto;
import org.codiki.exposition.publication.model.PublicationEditionRequestDto;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/publications")
@@ -93,8 +86,9 @@ public class PublicationController {
return publications;
}
@PostMapping("/preview")
public String previewPublicationContent(@RequestBody PreviewContentRequest request) {
return publicationUseCases.previewContent(request.text());
@PostMapping(value = "/preview")
public PreviewContentResponse previewPublicationContent(@RequestBody PreviewContentRequest request) {
String previewContent = publicationUseCases.previewContent(request.text());
return new PreviewContentResponse(previewContent);
}
}

View File

@@ -0,0 +1,5 @@
package org.codiki.exposition.publication.model;
public record PreviewContentResponse(
String text
) {}

View File

@@ -0,0 +1,75 @@
package org.codiki.exposition.traffic;
import jakarta.servlet.http.HttpServletRequest;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.codiki.application.traffic.TrafficTraceUseCases;
import org.codiki.application.user.UserUseCases;
import org.codiki.domain.traffic.model.HttpMethod;
import org.codiki.domain.traffic.model.TrafficEndpoint;
import org.codiki.domain.user.model.User;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.util.Optional;
import java.util.UUID;
@Component
@Aspect
public class ApiCallsLoggerAspect {
private static final String HTTP_HEADER_CORRELATION_ID = "x-correlation-id";
private final TrafficTraceUseCases trafficTraceUseCases;
private final UserUseCases userUseCases;
public ApiCallsLoggerAspect(
TrafficTraceUseCases trafficTraceUseCases,
UserUseCases userUseCases
) {
this.trafficTraceUseCases = trafficTraceUseCases;
this.userUseCases = userUseCases;
}
@Before("@annotation(org.springframework.web.bind.annotation.GetMapping)")
public void logGetApiCall(JoinPoint joinPoint) {
logApiCall();
}
@Before("@annotation(org.springframework.web.bind.annotation.PostMapping)")
public void logPostApiCall(JoinPoint joinPoint) {
logApiCall();
}
@Before("@annotation(org.springframework.web.bind.annotation.PutMapping)")
public void logPutApiCall(JoinPoint joinPoint) {
logApiCall();
}
@Before("@annotation(org.springframework.web.bind.annotation.DeleteMapping)")
public void logDeleteApiCall(JoinPoint joinPoint) {
logApiCall();
}
private void logApiCall() {
getHttpServletRequest().ifPresent(request ->
Optional.of(request.getMethod())
.flatMap(HttpMethod::fromString)
.ifPresent(queryHttpMethod -> {
String queryUriPath = request.getRequestURI();
TrafficEndpoint endpoint = new TrafficEndpoint(queryHttpMethod, queryUriPath);
UUID userId = userUseCases.getAuthenticatedUser()
.map(User::id)
.orElse(null);
String correlationId = request.getHeader(HTTP_HEADER_CORRELATION_ID);
trafficTraceUseCases.saveNewTrace(endpoint, userId, correlationId);
})
);
}
private static Optional<HttpServletRequest> getHttpServletRequest() {
return Optional.ofNullable(RequestContextHolder.getRequestAttributes())
.filter(ServletRequestAttributes.class::isInstance)
.map(ServletRequestAttributes.class::cast)
.map(ServletRequestAttributes::getRequest);
}
}

View File

@@ -0,0 +1,45 @@
package org.codiki.infrastructure.traffic;
import org.codiki.domain.traffic.model.TrafficTrace;
import org.codiki.domain.traffic.port.TrafficTracePort;
import org.codiki.infrastructure.traffic.model.TrafficTraceEntity;
import org.codiki.infrastructure.traffic.repository.TrafficTraceEntityJpaRepository;
import org.springframework.stereotype.Component;
import java.time.ZonedDateTime;
import java.util.List;
@Component
public class TrafficTraceJpaAdapter implements TrafficTracePort {
private final TrafficTraceEntityJpaRepository repository;
public TrafficTraceJpaAdapter(TrafficTraceEntityJpaRepository repository) {
this.repository = repository;
}
@Override
public void save(TrafficTrace trace) {
TrafficTraceEntity entity = new TrafficTraceEntity(trace);
repository.save(entity);
}
@Override
public List<TrafficTrace> getAllInPeriod(ZonedDateTime startDate, ZonedDateTime endDate) {
return List.of();
}
@Override
public List<TrafficTrace> getAllByCorrelationId(String correlationId) {
return List.of();
}
@Override
public Integer countAllInPeriod(ZonedDateTime startDate, ZonedDateTime endDate) {
return 0;
}
@Override
public Integer countByCorrelationId(String correlationId) {
return 0;
}
}

View File

@@ -0,0 +1,25 @@
package org.codiki.infrastructure.traffic.model;
import org.codiki.domain.traffic.model.HttpMethod;
public enum HttpMethodEntity {
GET, POST, PUT, DELETE;
public HttpMethod toDomain() {
return switch (this) {
case GET -> HttpMethod.GET;
case POST -> HttpMethod.POST;
case PUT -> HttpMethod.PUT;
case DELETE -> HttpMethod.DELETE;
};
}
public static HttpMethodEntity fromDomain(HttpMethod method) {
return switch (method) {
case HttpMethod.GET -> GET;
case HttpMethod.POST -> POST;
case HttpMethod.PUT -> PUT;
case HttpMethod.DELETE -> DELETE;
};
}
}

View File

@@ -0,0 +1,56 @@
package org.codiki.infrastructure.traffic.model;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.codiki.domain.traffic.model.TrafficEndpoint;
import org.codiki.domain.traffic.model.TrafficTrace;
import java.time.ZonedDateTime;
import java.util.UUID;
import static org.codiki.domain.traffic.model.TrafficTrace.aTrafficTrace;
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@Entity
@Table(name = "traffic")
public class TrafficTraceEntity {
@Id
private UUID id;
@Column(nullable = false)
private ZonedDateTime dateTime;
@Column(nullable = false)
@Enumerated
private HttpMethodEntity endpointMethod;
@Column(nullable = false)
private String endpointPath;
private UUID userId;
private String correlationId;
public TrafficTraceEntity(TrafficTrace trace) {
id = trace.id();
dateTime = trace.dateTime();
endpointMethod = HttpMethodEntity.fromDomain(trace.endpoint().method());
endpointPath = trace.endpoint().path();
userId = trace.userId();
correlationId = trace.correlationId();
}
public TrafficTrace toDomain() {
return aTrafficTrace()
.withId(id)
.withDateTime(dateTime)
.withEndpoint(new TrafficEndpoint(
endpointMethod.toDomain(),
endpointPath
))
.withUserId(userId)
.withCorrelationId(correlationId)
.build();
}
}

View File

@@ -0,0 +1,12 @@
package org.codiki.infrastructure.traffic.repository;
import org.codiki.infrastructure.traffic.model.TrafficTraceEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.UUID;
@Repository
public interface TrafficTraceEntityJpaRepository extends JpaRepository<TrafficTraceEntity, UUID> {
}

View File

@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS traffic (
id UUID NOT NULL,
date_time TIMESTAMP WITH TIME ZONE NOT NULL,
endpoint_method SMALLINT NOT NULL,
endpoint_path VARCHAR NOT NULL,
user_id UUID,
correlation_id VARCHAR,
CONSTRAINT traffic_pk PRIMARY KEY (id),
CONSTRAINT traffic_user_id_fk FOREIGN KEY (user_id) REFERENCES "user" (id)
);
CREATE INDEX traffic_user_id_idx ON traffic (user_id);

View File

@@ -15,11 +15,11 @@
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
<jakarta.servlet-api.version>6.1.0</jakarta.servlet-api.version>
<java-jwt.version>4.4.0</java-jwt.version>
<postgresql.version>42.7.0</postgresql.version>
<tika-core.version>2.9.0</tika-core.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<postgresql.version>42.7.4</postgresql.version>
<commons-lang3.version>3.17.0</commons-lang3.version>
</properties>
<modules>
@@ -35,7 +35,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.2.0</version>
<version>3.3.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -84,8 +84,6 @@
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -0,0 +1,21 @@
meta {
name: Preview content
type: http
seq: 7
}
post {
url: {{url}}/api/publications/preview
body: json
auth: bearer
}
auth:bearer {
token: {{bearerToken}}
}
body:json {
{
"text" : "[h1]Test[/h1]"
}
}

View File

@@ -1,7 +1,7 @@
vars {
url: http://localhost:8987
publicationId: ec76602f-5501-4091-868e-b471611e63de
bearerToken: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1YWQ0NjJiOC04ZjllLTRhMjYtYmI4Ni1jNzRmZWY1ZDExYjYiLCJleHAiOjE3MTA4Mzc2ODQsInBzZXVkbyI6IlN0YW5kYXJkIHVzZXIiLCJlbWFpbCI6InN0YW5kYXJkLnVzZXJAY29kaWtpLm9yZyIsInJvbGVzIjoiU1RBTkRBUkQifQ.2HggC3T_4I14IpW02DZJiYfgYwc074kU8Y4AmuGf1mZzv0U8OUxpAw_xEhnKtn8NcaCozz_2vFv4o_CaBqS8Ag
bearerToken: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkMWQ1NTdhNi04OGIxLTQyNzQtOTk0ZS1mOWE5YTYwOTc5OTciLCJleHAiOjE3MjY5NTExNTgsInBob3RvSWQiOiI2MjhkYTFhNy0wNzAyLTRlNDktOGIwNi00ZDg2MGE2YTNkZTUiLCJwc2V1ZG8iOiJUYWtpZ3VjaGkiLCJlbWFpbCI6ImZsb3JpYW4udGhpZXJyeTcyQGdtYWlsLmNvbSIsInJvbGVzIjoiU1RBTkRBUkQifQ.4OQglB0cT2hTMO7_Bfxj7nQPYi42e0Gh06jmHj2q-SQTM6Md70Ii_BiKR__GxY14bahPAjLcIWfAYS2A0Tc1Vw
categoryId: 172fa901-3f4b-4540-92f3-1c15820e8ec9
pictureId: 65b660b7-66bb-4e4a-a62c-fd0ca101f972
}

View File

@@ -3,7 +3,7 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"codiki-ng": {
"codiki": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
@@ -14,16 +14,19 @@
"sourceRoot": "src",
"prefix": "app",
"i18n": {
"sourceLocale": "en-UK",
"sourceLocale": "en",
"locales": {
"fr": "src/locale/messages-fr.json"
"fr": {
"translation": "src/locale/messages-fr.json"
}
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/codiki-ng",
"outputPath": "dist/codiki",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
@@ -56,7 +59,7 @@
}
],
"outputHashing": "all",
"outputPath": "dist/codiki-ng/en/"
"outputPath": "dist/codiki/en/"
},
"production-fr": {
"budgets": [
@@ -71,8 +74,10 @@
"maximumError": "4kb"
}
],
"localize": ["fr"],
"i18nMissingTranslation": "error",
"outputHashing": "all",
"outputPath": "dist/codiki-ng/fr/"
"outputPath": "dist/codiki/fr/"
},
"development": {
"optimization": false,
@@ -80,13 +85,13 @@
"sourceMap": true
},
"en": {
"outputPath": "dist/codiki-ng/en/",
"outputPath": "dist/codiki/en/",
"optimization": false,
"extractLicenses": false,
"sourceMap": true
},
"fr": {
"outputPath": "dist/codiki-ng/fr/",
"outputPath": "dist/codiki/fr/",
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
@@ -100,19 +105,19 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production-en": {
"buildTarget": "codiki-ng:build:production-en"
"buildTarget": "codiki:build:production-en"
},
"production-fr": {
"buildTarget": "codiki-ng:build:production-fr"
"buildTarget": "codiki:build:production-fr"
},
"development": {
"buildTarget": "codiki-ng:build:development"
"buildTarget": "codiki:build:development"
},
"en": {
"buildTarget": "codiki-ng:build:en"
"buildTarget": "codiki:build:en"
},
"fr": {
"buildTarget": "codiki-ng:build:fr"
"buildTarget": "codiki:build:fr"
}
},
"defaultConfiguration": "development"
@@ -120,7 +125,7 @@
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "codiki-ng:build"
"buildTarget": "codiki:build"
}
},
"test": {

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
"start-fr": "ng serve --port 4201 --configuration=fr --proxy-config proxy.conf.json",
"build": "ng build",
"build-prod-en": "ng build --configuration=production-en --base-href /en/",
"build-prod-fr": "ng build --configuration=production-fr --base-href /fr/",
"build-prod-fr": "ng build --configuration=production-fr --base-href",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"i18n": "npm run i18n-ng-extraction && npm run i18n-fr-file-completion",
@@ -17,32 +17,34 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^17.0.0",
"@angular/cdk": "^17.3.1",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/material": "^17.3.1",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/router": "^17.0.0",
"@angular/animations": "^18.2.5",
"@angular/cdk": "^18.2.5",
"@angular/common": "^18.2.5",
"@angular/compiler": "^18.2.5",
"@angular/core": "^18.2.5",
"@angular/forms": "^18.2.5",
"@angular/material": "^18.2.5",
"@angular/platform-browser": "^18.2.5",
"@angular/platform-browser-dynamic": "^18.2.5",
"@angular/router": "^18.2.5",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
"uuid": "^10.0.0",
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.5",
"@angular/cli": "^17.0.5",
"@angular/compiler-cli": "^17.0.0",
"@angular/localize": "^17.3.12",
"@angular-devkit/build-angular": "^18.2.5",
"@angular/cli": "^18.2.5",
"@angular/compiler-cli": "^18.2.5",
"@angular/localize": "^18.2.5",
"@types/jasmine": "~5.1.0",
"@types/uuid": "^10.0.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.2.2"
"typescript": "~5.5.4"
}
}

View File

@@ -5,6 +5,7 @@ import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@a
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { routes } from './app.routes';
import { JwtInterceptor } from './core/interceptor/jwt.interceptor';
import { CorrelationIdInterceptor } from './core/interceptor/correlation-id.interceptor';
export const appConfig: ApplicationConfig = {
providers: [
@@ -18,5 +19,6 @@ export const appConfig: ApplicationConfig = {
provideAnimationsAsync(),
provideHttpClient(withInterceptorsFromDi()),
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
{ provide: HTTP_INTERCEPTORS, useClass: CorrelationIdInterceptor, multi: true },
]
};

View File

@@ -1,10 +1,10 @@
<h1>{{title}}</h1>
<h2>{{description}}</h2>
<footer>
<button type="button" class="secondary" (click)="closeDialog()">
<button type="button" class="secondary" (click)="closeDialog()" i18n>
No
</button>
<button type="button" (click)="closeAndValidate()">
<button type="button" (click)="closeAndValidate()" i18n>
Yes
</button>
</footer>

View File

@@ -1,14 +1,14 @@
<div>
<div i18n>
<span class="copy-left">&copy;</span>
2016 - 2024 Tous droits réservés
2016 - 2024 All rights reserved
-
2.0-alpha
<a [routerLink]="['./']" matTooltip="Health checking will be available in future...">
<a [routerLink]="['./']" matTooltip="Health checking will be available in future..." i18n-matTooltip>
<mat-icon>favorite</mat-icon>
</a>
</div>
<div>
<mat-icon matTooltip="Documentation will be available in future...">menu_book</mat-icon>
<mat-icon matTooltip="Documentation will be available in future..." i18n-matTooltip>menu_book</mat-icon>
-
veloppements réalisés par Florian THIERRY
<span i18n>Development realised by</span> Florian THIERRY
</div>

View File

@@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FooterComponent } from './footer.component';
describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [FooterComponent]
})
.compileComponents();
fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -1,5 +1,5 @@
<div class="left">
<button type="button" (click)="sideMenu.open()" matTooltip="Click to show side menu">
<button type="button" (click)="sideMenu.open()" matTooltip="Click to show side menu" i18n-matTooltip>
<mat-icon>menu</mat-icon>
</button>
<a [routerLink]="['/home']">
@@ -19,18 +19,18 @@
</button>
<mat-menu #authenticatedUserMenu="matMenu">
<div class="authenticated-user-menu">
<a [routerLink]="['/my-publications']" matRipple>
<a [routerLink]="['/my-publications']" matRipple i18n>
<mat-icon>description</mat-icon>
My publications
</a>
<a [routerLink]="['/disconnect']" matRipple class="disconnection">
<a [routerLink]="['/disconnect']" matRipple class="disconnection" i18n>
<mat-icon>logout</mat-icon>
Disconnect
</a>
</div>
</mat-menu>
} @else {
<a [routerLink]="['/login']" class="button" matRipple>Login</a>
<a [routerLink]="['/login']" class="button" matRipple i18n>Login</a>
}
</div>
<app-side-menu #sideMenu></app-side-menu>

View File

@@ -1,16 +1,15 @@
import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatRippleModule } from '@angular/material/core';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { MatTooltipModule } from '@angular/material/tooltip';
import { RouterModule } from '@angular/router';
import { AuthenticationService } from '../../core/service/authentication.service';
import { CommonModule } from '@angular/common';
import { SideMenuComponent } from '../side-menu/side-menu.component';
import { MatRippleModule } from '@angular/material/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { PublicationsSearchBarComponent } from '../publications-search-bar/publications-search-bar.component';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatMenuModule } from '@angular/material/menu';
import { User } from '../../core/model/User';
import { SideMenuComponent } from '../side-menu/side-menu.component';
@Component({
selector: 'app-header',

View File

@@ -2,12 +2,12 @@
<mat-icon>close</mat-icon>
</button>
<header>
<h1>Add a code block</h1>
<h1 i18n>Add a code block</h1>
</header>
<form [formGroup]="formGroup" (submit)="closeAndValidate()" ngNativeValidate>
<div class="form-content">
<mat-form-field>
<mat-label>Programming language</mat-label>
<mat-label i18n>Programming language</mat-label>
<mat-select #programmingLanguageSelect formControlName="programmingLanguage">
@for(programmingLanguage of programmingLanguages; track programmingLanguage) {
<mat-option [value]="programmingLanguage.code">
@@ -17,15 +17,15 @@
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>Code block</mat-label>
<mat-label i18n>Code block</mat-label>
<textarea matInput formControlName="codeBlock"></textarea>
</mat-form-field>
</div>
<div class="actions">
<button type="submit">
<button type="submit" i18n>
Validate
</button>
<button type="button" (click)="closeDialog()" class="secondary">
<button type="button" (click)="closeDialog()" class="secondary" i18n>
Cancel
</button>
</div>

View File

@@ -2,27 +2,27 @@
<mat-icon>close</mat-icon>
</button>
<header>
<h1>Select an illustration:</h1>
<h1 i18n>Select an illustration</h1>
</header>
<div class="picture-container">
@if (isLoading) {
<h2>Pictures loading...</h2>
<h2 i18n>Pictures loading...</h2>
<mat-spinner></mat-spinner>
} @else {
@if (pictures.length) {
@for(picture of pictures; track picture) {
<img src="/api/pictures/{{picture.id}}" (click)="selectPicture(picture)" matTooltip="Choose this illustration"/>
<img src="/api/pictures/{{picture.id}}" (click)="selectPicture(picture)" matTooltip="Choose this illustration" i18n-matTooltip/>
}
} @else {
<h2>There is no any picture.</h2>
<h2 i18n>There is no any picture.</h2>
}
}
</div>
<footer>
<button type="button" class="secondary" matRipple (click)="closeDialog()">
<button type="button" class="secondary" matRipple (click)="closeDialog()" i18n>
Cancel
</button>
<button type="button" (click)="fileUpload.click()" matRipple>
<button type="button" (click)="fileUpload.click()" matRipple i18n>
<mat-icon>upload_file</mat-icon>
Add new picture
</button>

View File

@@ -34,9 +34,9 @@ export class PictureSelectionDialog implements OnInit {
if (error.status === 401) {
this.dialogRef.close();
} else {
const errorMessage = 'An error occured while loading pictures.';
const errorMessage = $localize`An error occured while loading pictures.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
}
})
.finally(() => {
@@ -61,9 +61,9 @@ export class PictureSelectionDialog implements OnInit {
this.dialogRef.close(pictureId);
})
.catch(error => {
const errorMessage = 'A technical error occured while uploading your picture.';
const errorMessage = $localize`A technical error occured while uploading your picture.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
});
}
}

View File

@@ -16,9 +16,9 @@ export class PictureSelectionDialogService {
this.dialogRef.close(pictureId);
})
.catch(error => {
const errorMessage = 'An error occured while uploading a picture...';
const errorMessage = $localize`An error occured while uploading a picture...`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
});
}
}

View File

@@ -4,20 +4,20 @@
</header>
<mat-tab-group dynamicHeight (selectedIndexChange)="onTabChange($event)">
<mat-tab label="Edition">
<mat-tab label="Edition" i18n-label>
<div class="form-content">
<div class="first-part">
<div>
<mat-form-field>
<mat-label>Title</mat-label>
<mat-label i18n>Title</mat-label>
<input matInput type="text" formControlName="title" />
</mat-form-field>
<mat-form-field>
<mat-label>Description</mat-label>
<mat-label i18n>Description</mat-label>
<input matInput type="text" formControlName="description" />
</mat-form-field>
<mat-form-field>
<mat-label>Category</mat-label>
<mat-label i18n>Category</mat-label>
<mat-select formControlName="categoryId">
@for (category of categories$ | async; track category) {
<mat-option [value]="category.id">
@@ -31,35 +31,36 @@
<div class="picture-container">
<img [src]="publication.illustrationId.length ? '/api/pictures/' + publication.illustrationId : '/assets/images/default-picture.png'"
(click)="displayPictureSectionDialog()"
matTooltip="Click to change illustration"/>
matTooltip="Click to change illustration"
i18n-matTooltip/>
</div>
</div>
<div class="actions">
<button type="button" matTooltip="Click to insert a title 1 section" (click)="insertTitle(1)">
<button type="button" matTooltip="Click to insert a title 1 section" (click)="insertTitle(1)" i18n-matTooltip>
H1
</button>
<button type="button" matTooltip="Click to insert a title 2 section" (click)="insertTitle(2)">
<button type="button" matTooltip="Click to insert a title 2 section" (click)="insertTitle(2)" i18n-matTooltip>
H2
</button>
<button type="button" matTooltip="Click to insert a title 1 section" (click)="insertTitle(3)">
<button type="button" matTooltip="Click to insert a title 3 section" (click)="insertTitle(3)" i18n-matTooltip>
H3
</button>
<button type="button" matTooltip="Click to insert a picture" (click)="selectAPicture()">
<button type="button" matTooltip="Click to insert a picture" (click)="selectAPicture()" i18n-matTooltip>
<mat-icon>image</mat-icon>
</button>
<button type="button" matTooltip="Click to insert a link" (click)="insertLink()">
<button type="button" matTooltip="Click to insert a link" (click)="insertLink()" i18n-matTooltip>
<mat-icon>link</mat-icon>
</button>
<button type="button" matTooltip="Click to insert a code block" (click)="displayCodeBlockDialog()">
<button type="button" matTooltip="Click to insert a code block" (click)="displayCodeBlockDialog()" i18n-matTooltip>
<mat-icon>code</mat-icon>
</button>
<button type="button" disabled matTooltip="Click to display editor help">
<button type="button" disabled matTooltip="Click to display editor help" i18n-matTooltip>
<mat-icon>help</mat-icon>
</button>
</div>
<mat-form-field class="example-form-field">
<mat-label>Content</mat-label>
<mat-form-field>
<mat-label i18n>Content</mat-label>
<textarea
#textArea
matInput
@@ -72,11 +73,11 @@
</div>
</mat-tab>
<mat-tab label="Previewing">
<mat-tab label="Previewing" i18n-label>
<div class="preview">
@if ((isPreviewing$ | async) === true) {
<div class="preview-loading">
<h2>Preview is loading...</h2>
<h2 i18n>Preview is loading...</h2>
<mat-spinner></mat-spinner>
</div>
} @else {
@@ -85,14 +86,14 @@
<h1>{{ publication.title }}</h1>
<h2>{{ publication.description }}</h2>
</header>
<main [innerHTML]="publication.parsedText"></main>
<main [innerHTML]="publicationInEdition.parsedText"></main>
}
</div>
</mat-tab>
</mat-tab-group>
<footer>
<app-submit-button label="Save" [requestPending]="!!(isSaving$ | async)"></app-submit-button>
<button type="button" class="secondary" (click)="goPreviousLocation()">
<app-submit-button label="Save" [requestPending]="!!(isSaving$ | async)" i18n-label></app-submit-button>
<button type="button" class="secondary" (click)="goPreviousLocation()" i18n>
Cancel
</button>
</footer>

View File

@@ -1,20 +1,20 @@
import { CommonModule, Location } from "@angular/common";
import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output } from "@angular/core";
import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, Output } from "@angular/core";
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from "@angular/forms";
import { MatDialogModule } from "@angular/material/dialog";
import { MatIconModule } from "@angular/material/icon";
import { MatInputModule } from "@angular/material/input";
import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { MatSelectModule } from "@angular/material/select";
import { MatTabsModule } from "@angular/material/tabs";
import { MatTooltipModule } from "@angular/material/tooltip";
import { filter, map, Observable, of, Subscription } from "rxjs";
import { Publication } from "../../core/rest-services/publications/model/publication";
import { PictureSelectionDialog } from "./picture-selection-dialog/picture-selection-dialog.component";
import { SubmitButtonComponent } from "../submit-button/submit-button.component";
import { PublicationEditionService } from "./publication-edition.service";
import { MatSelectModule } from "@angular/material/select";
import { CategoryService } from "../../core/service/category.service";
import { map, Observable, of, Subscription } from "rxjs";
import { Category } from "../../core/rest-services/category/model/category";
import { Publication } from "../../core/rest-services/publications/model/publication";
import { CategoryService } from "../../core/service/category.service";
import { SubmitButtonComponent } from "../submit-button/submit-button.component";
import { PictureSelectionDialog } from "./picture-selection-dialog/picture-selection-dialog.component";
import { PublicationEditionService } from "./publication-edition.service";
@Component({
selector: 'app-publication-edition',
@@ -46,11 +46,11 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
@Output()
publicationSave = new EventEmitter<Publication>();
publicationInEdition!: Publication;
private readonly categoryService = inject(CategoryService);
private readonly formBuilder = inject(FormBuilder);
private readonly location = inject(Location);
private readonly publicationEditionService = inject(PublicationEditionService);
private publicationInEdition!: Publication;
private subscriptions: Subscription[] = [];
publicationEditionForm: FormGroup = this.formBuilder.group({
@@ -92,7 +92,7 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
}
return 0;
}
ngOnChanges(): void {
this.ngOnDestroy();
@@ -129,12 +129,13 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
this.subscriptions.push(categoryIdChangeSubscription);
const publicationSubscription = this.publicationEditionService.state$.subscribe(state => {
console.log(state.publication.parsedText.substring(0, 15));
this.publicationInEdition = state.publication;
this.publicationEditionForm.controls['title'].setValue(this.publication.title, { emitEvent: false });
this.publicationEditionForm.controls['description'].setValue(this.publication.description, { emitEvent: false });
this.publicationEditionForm.controls['text'].setValue(this.publication.text, { emitEvent: false });
this.publicationEditionForm.controls['illustrationId'].setValue(this.publication.illustrationId, { emitEvent: false });
this.publicationEditionForm.controls['categoryId'].setValue(this.publication.categoryId, { emitEvent: false });
this.publicationEditionForm.controls['title'].setValue(this.publicationInEdition.title, { emitEvent: false });
this.publicationEditionForm.controls['description'].setValue(this.publicationInEdition.description, { emitEvent: false });
this.publicationEditionForm.controls['text'].setValue(this.publicationInEdition.text, { emitEvent: false });
this.publicationEditionForm.controls['illustrationId'].setValue(this.publicationInEdition.illustrationId, { emitEvent: false });
this.publicationEditionForm.controls['categoryId'].setValue(this.publicationInEdition.categoryId, { emitEvent: false });
});
this.subscriptions.push(publicationSubscription);
}
@@ -178,8 +179,6 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
const positionStart = textarea.selectionStart;
const positionEnd = textarea.selectionEnd;
const selectedCharacterCount = positionEnd - positionStart;
console.log(`cursor position updated: [${positionStart}, ${positionEnd}] (${selectedCharacterCount})`);
this.publicationEditionService.editCursorPosition(positionStart, positionEnd);
}
}

View File

@@ -9,6 +9,7 @@ import { PublicationRestService } from "../../core/rest-services/publications/pu
import { copy } from "../../core/utils/ObjectUtils";
import { CodeBlockDialog } from "./code-block-dialog/code-block-dialog.component";
import { PictureSelectionDialog } from "./picture-selection-dialog/picture-selection-dialog.component";
import { PreviewContentRequest } from "../../core/rest-services/publications/model/preview";
declare let Prism: any;
@@ -76,7 +77,7 @@ export class PublicationEditionService implements OnDestroy {
}
private _save(state: PublicationEditionState): void {
this.stateSubject.next(state);
this.stateSubject.next(state);
}
get isLoading$(): Observable<boolean> {
@@ -101,7 +102,7 @@ export class PublicationEditionService implements OnDestroy {
this.activatedRoute.paramMap.subscribe(params => {
const publicationId = params.get('publicationId');
if (publicationId == undefined) {
this.snackBar.open('A technical error occurred while loading publication data.', 'Close', {duration: 5000});
this.snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, { duration: 5000 });
this.location.back();
} else {
this.publicationRestService.getById(publicationId)
@@ -111,8 +112,8 @@ export class PublicationEditionService implements OnDestroy {
this.stateSubject.next(state);
})
.catch(error => {
const errorMessage = 'A technical error occurred while loading publication data.';
this.snackBar.open(errorMessage, 'Close', {duration: 5000});
const errorMessage = $localize`A technical error occurred while loading publication data.`;
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
console.error(errorMessage, error)
})
.finally(() => this.isLoadingSubject.next(false));
@@ -268,9 +269,12 @@ export class PublicationEditionService implements OnDestroy {
const state = this._state;
this.isPreviewingSubject.next(true);
this.publicationRestService.preview(state.publication.text)
.then(parsedText => {
state.publication.parsedText = parsedText;
const request: PreviewContentRequest = {
text: state.publication.text
};
this.publicationRestService.preview(request)
.then(response => {
state.publication.parsedText = response.text;
this._save(state);
setTimeout(() => Prism.highlightAll(), 1000);
})

View File

@@ -1,5 +1,5 @@
<form [formGroup]="formGroup">
<input name="search-query" placeholder="Search something..." formControlName="criteria"/>
<input name="search-query" placeholder="Search something..." formControlName="criteria" i18n-placeholder/>
<button type="submit" (click)="searchPublications()">
<mat-icon>search</mat-icon>
</button>

View File

@@ -1,18 +0,0 @@
import { HttpParams } from "@angular/common/http";
import { inject, Injectable } from "@angular/core";
import { Router } from "@angular/router";
import { BehaviorSubject } from "rxjs";
@Injectable()
export class PublicationsSearchBarService {
private router = inject(Router);
private criteriaSubject = new BehaviorSubject<string>('');
private cri
searchPublications(): void {
let queryParams = new HttpParams();
queryParams = queryParams.set('query', this.criteriaSubject.value);
this.router.navigate(['/publications'], {queryParams});
}
}

View File

@@ -4,11 +4,11 @@
<img src="assets/images/codiki.png" alt="logo"/>
Codiki
</a>
<button type="button" (click)="close()" matTooltip="Close the menu">
<button type="button" (click)="close()" matTooltip="Close the menu" i18n-matTooltip>
<mat-icon>close</mat-icon>
</button>
</h1>
<h2>Catégories</h2>
<h2 i18n>Categories</h2>
<app-categories-menu (categoryClicked)="close()"></app-categories-menu>
</div>
<div class="overlay {{ isOpenned ? 'displayed' : ''}}" (click)="close()"></div>

View File

@@ -1,9 +1,8 @@
import { Injectable, OnDestroy, inject } from '@angular/core';
import { CategoryService } from '../../core/service/category.service';
import { BehaviorSubject, Observable, Subscription, map } from 'rxjs';
import { Category } from '../../core/rest-services/category/model/category';
import { CategoryRestService } from '../../core/rest-services/category/category.rest-service';
import { Injectable, inject } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { BehaviorSubject, Observable } from 'rxjs';
import { CategoryRestService } from '../../core/rest-services/category/category.rest-service';
import { Category } from '../../core/rest-services/category/model/category';
export interface DisplayableCategory {
id: string;
@@ -20,31 +19,13 @@ export interface DisplayableSubCategory {
@Injectable({
providedIn: 'root'
})
export class SideMenuService implements OnDestroy {
export class SideMenuService {
private categoryRestService = inject(CategoryRestService);
private snackBar = inject(MatSnackBar);
private categoriesSubject = new BehaviorSubject<DisplayableCategory[]>([]);
private isLoadingSubject = new BehaviorSubject<boolean>(false);
private isLoadedSubject = new BehaviorSubject<boolean>(false);
constructor() {
// this.categoriesSubscription = this.categoryService.categories$
// .pipe(
// map(categories =>
// categories
// .filter(category => category.subCategories?.length)
// .map(category =>
// this.mapToDisplayableCategory(category)
// )
// )
// )
// .subscribe(categories => this.categoriesSubject.next(categories));
}
ngOnDestroy(): void {
// this.categoriesSubscription?.unsubscribe();
}
private mapToDisplayableCategory(category: Category): DisplayableCategory {
return {
id: category.id,
@@ -89,9 +70,9 @@ export class SideMenuService implements OnDestroy {
this.categoriesSubject.next(displayableCategories);
})
.catch(error => {
const errorMessage = "An error occured while loading categories.";
const errorMessage = $localize`An error occured while loading categories.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
})
.finally(() => {
this.isLoadingSubject.next(false);

View File

@@ -12,7 +12,7 @@ export const authenticationGuard: CanActivateFn = () => {
return true;
} else {
router.navigate(['/login']);
snackBar.open('You are unauthenticated. Please, log-in first.', 'Close', { duration: 5000 });
snackBar.open($localize`You are unauthenticated. Please, log-in first.`, $localize`Close`, { duration: 5000 });
return false;
}
}

View File

@@ -0,0 +1,20 @@
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
import { inject, Injectable } from "@angular/core";
import { Observable } from "rxjs";
import { CorrelationIdService } from "../service/correlation-id.service";
@Injectable()
export class CorrelationIdInterceptor implements HttpInterceptor {
private readonly correlationIdService = inject(CorrelationIdService);
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const correlationId = this.correlationIdService.getCorrelationId();
const requestWithCorrelationId = request.clone({
headers: request.headers.set('x-correlation-id', correlationId)
});
return next.handle(requestWithCorrelationId);
}
}

View File

@@ -83,7 +83,7 @@ export class JwtInterceptor implements HttpInterceptor {
this.router.navigate(['/login']);
this.refreshTokenSubject.next(undefined);
this.authenticationService.unauthenticate();
this.snackBar.open('You are unauthenticated. Please, re-authenticate before retrying your action.', 'Close', { duration: 5000 });
this.snackBar.open($localize`You are unauthenticated. Please, re-authenticate before retrying your action.`, $localize`Close`, { duration: 5000 });
return throwError(() => initialError);
}
}

View File

@@ -0,0 +1,7 @@
export interface PreviewContentRequest {
text: string;
}
export interface PreviewContentResponse {
text: string;
}

View File

@@ -2,6 +2,7 @@ import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable, inject } from '@angular/core';
import { last, lastValueFrom } from 'rxjs';
import { Publication } from './model/publication';
import { PreviewContentRequest, PreviewContentResponse } from './model/preview';
@Injectable({
providedIn: 'root'
@@ -31,9 +32,8 @@ export class PublicationRestService {
return lastValueFrom(this.httpClient.get<Publication[]>('/api/publications', { params }));
}
preview(publicationText: string): Promise<string> {
const request = { text: publicationText };
return lastValueFrom(this.httpClient.post<string>('/api/publications/preview', request));
preview(request: PreviewContentRequest): Promise<PreviewContentResponse> {
return lastValueFrom(this.httpClient.post<PreviewContentResponse>('/api/publications/preview', request));
}
delete(publicationId: string): Promise<void> {

View File

@@ -18,7 +18,7 @@ export class CategoryService {
if (!this.categories?.length) {
this.categoryRestService.getCategories()
.then(categories => this.categoriesSubject.next(categories))
.catch(error => console.error('An error occured while loading categories.', error));
.catch(error => console.error($localize`An error occured while loading categories.`, error));
}
return this.categoriesSubject.asObservable();
}

View File

@@ -0,0 +1,27 @@
import { Injectable } from "@angular/core";
import * as uuid from 'uuid';
const CORRELATION_ID_KEY = 'correlationId';
@Injectable({
providedIn: 'root'
})
export class CorrelationIdService {
getCorrelationId(): string {
let correlationId = this.getCorrelationFromLocalStorage();
if (correlationId === undefined) {
correlationId = this.createNewCorrelationId();
}
return correlationId;
}
private getCorrelationFromLocalStorage(): string | undefined {
return localStorage.getItem(CORRELATION_ID_KEY) ?? undefined;
}
private createNewCorrelationId(): string {
const newCorrelationId = uuid.v4();
localStorage.setItem(CORRELATION_ID_KEY, newCorrelationId);
return newCorrelationId;
}
}

View File

@@ -1 +1,7 @@
<app-publication-edition title="Creation of a new publication" [publication]="publication" [isSaving$]="isSaving$" (publicationSave)="onPublicationSave($event)"></app-publication-edition>
<app-publication-edition
title="Creation of a new publication"
[publication]="publication"
[isSaving$]="isSaving$"
(publicationSave)="onPublicationSave($event)"
i18n-title>
</app-publication-edition>

View File

@@ -63,13 +63,13 @@ export class PublicationCreationComponent implements OnInit {
this.isSavingSubject.next(true);
this.publicationRestService.create(publication)
.then(() => {
this.snackBar.open('Publication created succesfully!', 'Close', { duration: 5000 });
this.snackBar.open($localize`Publication created succesfully!`, $localize`Close`, { duration: 5000 });
this.router.navigate(['/my-publications']);
})
.catch(error => {
const errorMessage = 'An error occured while saving new publication.';
const errorMessage = $localize`An error occured while saving new publication.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
})
.finally(() => this.isSavingSubject.next(false));
}

View File

@@ -1,13 +1,20 @@
@if ((isLoading$ | async) == true) {
<h2 i18n>Loading publication to edit...</h2>
<mat-spinner></mat-spinner>
}
@else {
@if (publication) {
<app-publication-edition title="Update publication {{ publication.title }}" [publication]="publication" [isSaving$]="isSaving$" (publicationSave)="onPublicationSave($event)"></app-publication-edition>
<app-publication-edition
title="Update publication {{ publication.title }}"
[publication]="publication"
[isSaving$]="isSaving$"
(publicationSave)="onPublicationSave($event)"
i18n-title>
</app-publication-edition>
}
@else {
<div class="loading-failed">
<h1>Publication failed to load...</h1>
<h1 i18n>Publication failed to load...</h1>
</div>
}
}

View File

@@ -59,7 +59,7 @@ export class PublicationUpdateComponent implements OnInit, OnDestroy {
this.activatedRoute.paramMap.subscribe(params => {
const publicationId = params.get('publicationId');
if (publicationId == undefined) {
this.snackBar.open('A technical error occurred while loading publication data.', 'Close', { duration: 5000 });
this.snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, { duration: 5000 });
this.location.back();
} else {
this.publicationRestService.getById(publicationId)
@@ -67,8 +67,8 @@ export class PublicationUpdateComponent implements OnInit, OnDestroy {
this.publication = publication;
})
.catch(error => {
const errorMessage = 'A technical error occurred while loading publication data.';
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
const errorMessage = $localize`A technical error occurred while loading publication data.`;
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
console.error(errorMessage, error)
})
.finally(() => this.isLoadingSubject.next(false));
@@ -84,13 +84,13 @@ export class PublicationUpdateComponent implements OnInit, OnDestroy {
this.isSavingSubject.next(true);
this.publicationRestService.update(publication)
.then(() => {
this.snackBar.open('Publication updated succesfully!', 'Close', { duration: 5000 });
this.snackBar.open($localize`Publication updated succesfully!`, $localize`Close`, { duration: 5000 });
this.router.navigate(['/home']);
})
.catch(error => {
const errorMessage = 'An error occured while saving publication modifications.';
const errorMessage = $localize`An error occured while saving publication modifications.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
})
.finally(() => this.isSavingSubject.next(false));
}

View File

@@ -12,7 +12,7 @@
<a [routerLink]="['edit']"
class="button action"
matTooltip="Click to edit the publication"
i18n-mapTooltip>
i18n-matTooltip>
<mat-icon>edit</mat-icon>
</a>
}
@@ -33,7 +33,7 @@
(click)="deletePublication()"
matTooltip="Click to delete the publication"
matTooltipPosition="left"
i18n-mapTooltip>
i18n-matTooltip>
<mat-icon>delete</mat-icon>
Delete
</button>

View File

@@ -1,13 +1,13 @@
<h1>Search results</h1>
<h1 i18n>Search results</h1>
@if((isLoading$ | async) === true) {
<h2>Search in progress...</h2>
<h2 i18n>Search in progress...</h2>
<mat-spinner></mat-spinner>
} @else if((isLoaded$ | async) === true) {
@if((publications$ | async)?.length) {
<app-publication-list [publications$]="publications$"></app-publication-list>
} @else {
No any result.
<span i18n>No any result.</span>
}
} @else {
No any result.
<span i18n>No any result.</span>
}

View File

@@ -36,9 +36,9 @@ export class SearchPublicationsService {
})
.catch(error => {
if (error.status !== 404) {
const errorMessage = 'An error occured while retrieving publications.';
const errorMessage = $localize`An error occured while retrieving publications.`;
console.error(errorMessage, error);
this.snackBar.open(errorMessage, 'Close', { duration: 5000 });
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
}
})
.finally(() => {

View File

@@ -1,8 +1,8 @@
<form [formGroup]="signinForm" (submit)="performSignin()" ngNativeValidate>
<h1>Signin</h1>
<h1 i18n>Signin</h1>
<div>
<mat-icon>person</mat-icon>
<label for="pseudo">
<label for="pseudo" i18n>
Pseudo
<span class="required">*</span>
</label>
@@ -10,7 +10,7 @@
</div>
<div>
<mat-icon>mail</mat-icon>
<label for="email">
<label for="email" i18n>
Email address
<span class="required">*</span>
</label>
@@ -18,7 +18,7 @@
</div>
<div>
<mat-icon>lock</mat-icon>
<label for="password">
<label for="password" i18n>
Password
<span class="required">*</span>
</label>
@@ -26,14 +26,14 @@
</div>
<div>
<mat-icon>lock</mat-icon>
<label for="confirm-password">
<label for="confirm-password" i18n>
Confirm password
<span class="required">*</span>
</label>
<input type="password" id="confirm-password" formControlName="confirmPassword" required />
</div>
<div class="actions">
<button type="submit">Send</button>
<a [routerLink]="['/login']">I already have an account</a>
<button type="submit" i18n>Send</button>
<a [routerLink]="['/login']" i18n>I already have an account</a>
</div>
</form>

View File

@@ -1,23 +0,0 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { SigninComponent } from './signin.component';
describe('SigninComponent', () => {
let component: SigninComponent;
let fixture: ComponentFixture<SigninComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SigninComponent]
})
.compileComponents();
fixture = TestBed.createComponent(SigninComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -76,7 +76,7 @@ export class SigninService {
if (state.request.password !== state.confirmPassword) {
const confirmPasswordError: FormError = {
fieldName: 'confirmPassword',
errorMessage: 'Typed password are different.'
errorMessage: $localize`Typed passwords are different.`
}
state.errors.filter(error => error.fieldName !== 'confirmPassword');
state.errors.push(confirmPasswordError)

View File

@@ -1,14 +1,58 @@
{
"locale": "fr-FR",
"translations": {
"3603720768157919481": "Non",
"4861926948802653243": "Oui",
"5277292207846698726": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2024 Tous droits réservés - 2.0-alpha {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
"9214089025589249203": "Les indicateurs de vie du site seront disponibles ultérieurement...",
"1711651175531679766": "La documentation sera disponible ultérieurement...",
"6299155290121808295": "Développements realisés par",
"6413533995205687351": "Cliquez pour afficher le menu",
"3394094310583807145": "{$START_TAG_MAT_ICON}description{$CLOSE_TAG_MAT_ICON} Mes publications",
"5690703874094076840": "{$START_TAG_MAT_ICON}logout{$CLOSE_TAG_MAT_ICON} Déconnexion",
"2454050363478003966": "Connexion",
"6379828571327118783": "Ajouter un bloc de code",
"933522671092765466": "Langage de programmation",
"5953425146193292178": "Bloc de code",
"7975252153657972743": "Valider",
"2330577642930707695": "Annuler",
"162921950259491830": "Sélectionnez une illustation",
"1678880547384144969": "Chargement des images...",
"4111988153902305972": "Choisir cette illustation",
"4491342806775118195": "Il n'y a aucune image.",
"5036131155743433968": "{$START_TAG_MAT_ICON}upload_file{$CLOSE_TAG_MAT_ICON} Ajouter une nouvelle image",
"6852365376059142995": "Une erreur est survenue lors du chargements de vos images.",
"7819314041543176992": "Fermer",
"6198966268398913224": "Une erreur technique est survenue lors de l'ajout de votre image.",
"3603937053948195893": "Édition",
"5701618810648052610": "Titre",
"4902817035128594900": "Description",
"1806667489382256324": "Categorie",
"4954740313142081867": "Cliquez pour changer l'illustation",
"382530603854484923": "Cliquez pour ajouter une section titre de niveau 1",
"7918008528690631661": "Cliquez pour ajouter une section titre de niveau 2",
"200884310255063303": "Cliquez pour ajouter une section titre de niveau 3",
"327371240590280003": "Cliquez pour ajouter une image",
"2615926469669796978": "Cliquez pour ajouter un lien",
"4689637499823680515": "Cliquez pour ajouter un bloc de code",
"1065684538660053227": "Cliquez pour afficher l'aide",
"6205355627445317276": "Contenu",
"725618658772732433": "Prévisualisation",
"1775659119052622417": "Chargement du rendu de la prévisualisation...",
"3768927257183755959": "Enregistrer",
"4580042433737768435": "Une erreur technique est survenue lors du chargement de la publication à modifier.",
"2578598149846191609": "Publication postée par {$INTERPOLATION}",
"6514394873612421064": "Rechercher quelque chose...",
"9122763438636464100": "Fermer le menu",
"1902100407096396858": "Catégories",
"6940115735259407353": "Une erreur est survenue lors du chargement des catégories.",
"3450287383703155559": "Vous n'êtes pas connecté. Veuillez vous connecter avant de réessayer.",
"5455465794443528807": "You n'êtes pas connecté. Veuillez vous connecter avant de réessayer votre opération.",
"4011987306265136481": "Déconnexion...",
"4869473828758837325": "Dernières publications",
"5148998676057880041": "Chargement des publications...",
"3688381096110057852": "Il n'y a aucune publication.",
"8393632007890629197": "Une erreur est survenue lors du chargement des dernières publications...",
"7819314041543176992": "Fermer",
"2454050363478003966": "Connexion",
"8138320902772264034": "Adresse email {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"9175472990822669391": "Mot de passe {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"6490688569532630280": "Valider",
@@ -20,12 +64,29 @@
"1519054954638405159": "Chargement de la liste de vos publications...",
"5982957837973242128": "Vous n'avez rien publié...",
"6147923540123489141": "Une erreur est survenue lors de la récupération de vos publications...",
"3450287383703155559": "Vous n'êtes pas connecté. Veuillez vous connecter avant de réessayer.",
"9035578711395348230": "Chargement du contenu de la publication...",
"2804059545779555969": "Rédaction d'une nouvelle publication",
"4229813881636784544": "Publication créée avec succès !",
"1772332295232318552": "Une erreur est survenue lors de l'enregistrement de la nouvelle publication.",
"5585500423922995936": "Chargement de la publication à modifier...",
"1487849090405054079": "Modification de la publication {$INTERPOLATION}",
"570282468314450588": "La publication n'a pas pu être chargée...",
"1766298802296530620": "Publication modifiée avec succès !",
"5690532907092398845": "Une erreur est survenue lors de l'enregistrement des modifications de la publication.",
"9035578711395348230": "Chargement du contenu de la publication...",
"1224244276514211842": "Cliquez pour modifier la publication",
"2759576657543552825": "Cliquez pour supprimer la publication",
"3861667381167371965": "Une erreur est survenue lors du chargement de la publication...",
"3189372093194446122": "Suppression de la publication",
"7149611045520326321": "Êtes vous sûr de vouloir supprimer cette publication ?",
"4353366709080867962": "Publication supprimée"
"4353366709080867962": "Publication supprimée",
"1460318440531551596": "Résultats de la recherche",
"886526241743571962": "Recherche des publications...",
"3467080651873197381": "Il n'y a aucun résultat.",
"8212807341111457015": "Une erreur est survenue lors de la recherche des publications..",
"2101902914887471883": "Créer un compte",
"963610942522043725": "Pseudo {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"5090593460426139718": "Confirmation du mot de passe {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"3461230574295546047": "J'ai déjà un compte",
"5052944271008222026": "Les mots de passe saisis sont différents."
}
}

View File

@@ -1,14 +1,58 @@
{
"locale": "en-UK",
"translations": {
"3603720768157919481": " No ",
"4861926948802653243": " Yes ",
"5277292207846698726": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2024 All rights reserved - 2.0-alpha {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
"9214089025589249203": "Health checking will be available in future...",
"1711651175531679766": "Documentation will be available in future...",
"6299155290121808295": "Development realised by",
"6413533995205687351": "Click to show side menu",
"3394094310583807145": "{$START_TAG_MAT_ICON}description{$CLOSE_TAG_MAT_ICON} My publications ",
"5690703874094076840": "{$START_TAG_MAT_ICON}logout{$CLOSE_TAG_MAT_ICON} Disconnect ",
"2454050363478003966": "Login",
"6379828571327118783": "Add a code block",
"933522671092765466": "Programming language",
"5953425146193292178": "Code block",
"7975252153657972743": " Validate ",
"2330577642930707695": " Cancel ",
"162921950259491830": "Select an illustration",
"1678880547384144969": "Pictures loading...",
"4111988153902305972": "Choose this illustration",
"4491342806775118195": "There is no any picture.",
"5036131155743433968": "{$START_TAG_MAT_ICON}upload_file{$CLOSE_TAG_MAT_ICON} Add new picture ",
"6852365376059142995": "An error occured while loading pictures.",
"7819314041543176992": "Close",
"6198966268398913224": "A technical error occured while uploading your picture.",
"3603937053948195893": "Edition",
"5701618810648052610": "Title",
"4902817035128594900": "Description",
"1806667489382256324": "Category",
"4954740313142081867": "Click to change illustration",
"382530603854484923": "Click to insert a title 1 section",
"7918008528690631661": "Click to insert a title 2 section",
"200884310255063303": "Click to insert a title 3 section",
"327371240590280003": "Click to insert a picture",
"2615926469669796978": "Click to insert a link",
"4689637499823680515": "Click to insert a code block",
"1065684538660053227": "Click to display editor help",
"6205355627445317276": "Content",
"725618658772732433": "Previewing",
"1775659119052622417": "Preview is loading...",
"3768927257183755959": "Save",
"4580042433737768435": "A technical error occurred while loading publication data.",
"2578598149846191609": "Publication posted by {$INTERPOLATION}",
"6514394873612421064": "Search something...",
"9122763438636464100": "Close the menu",
"1902100407096396858": "Categories",
"6940115735259407353": "An error occured while loading categories.",
"3450287383703155559": "You are unauthenticated. Please, log-in first.",
"5455465794443528807": "You are unauthenticated. Please, re-authenticate before retrying your action.",
"4011987306265136481": "Disconnection...",
"4869473828758837325": "Last publications",
"5148998676057880041": "Publications loading...",
"3688381096110057852": "No any publication.",
"8393632007890629197": "An error occurred while retrieving latest publications...",
"7819314041543176992": "Close",
"2454050363478003966": "Login",
"8138320902772264034": " Email address {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"9175472990822669391": " Password {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"6490688569532630280": "Send",
@@ -20,12 +64,29 @@
"1519054954638405159": "Publication loading...",
"5982957837973242128": "There is no any publication...",
"6147923540123489141": "An error occurred while retrieving your publications...",
"3450287383703155559": "You are unauthenticated. Please, log-in first.",
"9035578711395348230": "Publication content loading...",
"2804059545779555969": "Creation of a new publication",
"4229813881636784544": "Publication created succesfully!",
"1772332295232318552": "An error occured while saving new publication.",
"5585500423922995936": "Loading publication to edit...",
"1487849090405054079": "Update publication {$INTERPOLATION}",
"570282468314450588": "Publication failed to load...",
"1766298802296530620": "Publication updated succesfully!",
"5690532907092398845": "An error occured while saving publication modifications.",
"9035578711395348230": "Publication content loading...",
"1224244276514211842": "Click to edit the publication",
"2759576657543552825": "Click to delete the publication",
"3861667381167371965": "An error occurred while loading publication...",
"3189372093194446122": "Publication deletion",
"7149611045520326321": "Are you sure you want to delete this publication?",
"4353366709080867962": "Publication deleted"
"4353366709080867962": "Publication deleted",
"1460318440531551596": "Search results",
"886526241743571962": "Search in progress...",
"3467080651873197381": "No any result.",
"8212807341111457015": "An error occured while retrieving publications.",
"2101902914887471883": "Signin",
"963610942522043725": " Pseudo {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"5090593460426139718": " Confirm password {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}",
"3461230574295546047": "I already have an account",
"5052944271008222026": "Typed passwords are different."
}
}