Compare commits
12 Commits
gradle-set
...
2d5962d7af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d5962d7af | ||
|
|
8791eebda8 | ||
|
|
64aecec4af | ||
|
|
c91bb7b720 | ||
|
|
a2de24fd93 | ||
|
|
ebe46a0d11 | ||
|
|
a3637faafa | ||
|
|
987d187c44 | ||
|
|
bf7e755c28 | ||
|
|
241f765648 | ||
|
|
20782cd45a | ||
| 1ca2f872f7 |
10
.gitignore
vendored
10
.gitignore
vendored
@@ -84,13 +84,3 @@ testem.log
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
**/ci/bin/
|
**/ci/bin/
|
||||||
|
|
||||||
|
|
||||||
# Linux start script should use lf
|
|
||||||
/gradlew text eol=lf
|
|
||||||
# These are Windows script files and should use crlf
|
|
||||||
*.bat text eol=crlf
|
|
||||||
# Binary files should be left untouched
|
|
||||||
*.jar binary
|
|
||||||
|
|
||||||
**/.gradle
|
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
FROM gradle:9.0.0-jdk21 AS builder
|
FROM maven:3.9.11-eclipse-temurin-21 AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY backend/gradlew /app/
|
COPY backend/pom.xml /app/
|
||||||
COPY backend/build.gradle.kts /app/
|
|
||||||
COPY backend/settings.gradle.kts /app/
|
|
||||||
COPY backend/codiki-application /app/codiki-application
|
COPY backend/codiki-application /app/codiki-application
|
||||||
COPY backend/codiki-domain /app/codiki-domain
|
COPY backend/codiki-domain /app/codiki-domain
|
||||||
COPY backend/codiki-exposition /app/codiki-exposition
|
COPY backend/codiki-exposition /app/codiki-exposition
|
||||||
COPY backend/codiki-infrastructure /app/codiki-infrastructure
|
COPY backend/codiki-infrastructure /app/codiki-infrastructure
|
||||||
COPY backend/codiki-launcher /app/codiki-launcher
|
COPY backend/codiki-launcher /app/codiki-launcher
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN gradle build jar
|
RUN mvn clean install -N
|
||||||
|
RUN mvn clean package
|
||||||
|
|
||||||
FROM eclipse-temurin:21-jre-alpine AS final
|
FROM eclipse-temurin:21-jre-alpine AS final
|
||||||
COPY --from=builder /app/codiki-launcher/build/libs/codiki-launcher.jar /app/codiki.jar
|
COPY --from=builder /app/codiki-launcher/target/*.jar /app/codiki.jar
|
||||||
CMD ["java", "-jar", "/app/codiki.jar"]
|
CMD ["java", "-jar", "/app/codiki.jar"]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:24-alpine AS builder
|
FROM node:25-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY frontend /app
|
COPY frontend /app
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
plugins {
|
|
||||||
kotlin("jvm") version "2.2.20"
|
|
||||||
kotlin("plugin.spring") version "2.2.20"
|
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "org.codiki"
|
|
||||||
version = "0.0.1-SNAPSHOT"
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain {
|
|
||||||
languageVersion = JavaLanguageVersion.of(21)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects {
|
|
||||||
apply(plugin = "java")
|
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.5.5"))
|
|
||||||
compileOnly("org.projectlombok:lombok:1.18.40")
|
|
||||||
annotationProcessor("org.projectlombok:lombok:1.18.40")
|
|
||||||
testImplementation("org.assertj:assertj-core:3.27.4")
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-params")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test> {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencyManagement {
|
|
||||||
imports {
|
|
||||||
mavenBom("org.springframework.boot:spring-boot-dependencies:3.5.5")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
compilerOptions {
|
|
||||||
freeCompilerArgs.addAll("-Xjsr305=strict")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Test> {
|
|
||||||
useJUnitPlatform()
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(project(":codiki-domain"))
|
|
||||||
implementation("org.springframework:spring-context")
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
|
||||||
implementation("com.auth0:java-jwt:4.5.0")
|
|
||||||
implementation("org.apache.commons:commons-lang3") //:3.18.0
|
|
||||||
}
|
|
||||||
56
backend/codiki-application/pom.xml
Normal file
56
backend/codiki-application/pom.xml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>codiki-application</artifactId>
|
||||||
|
|
||||||
|
<name>codiki-application</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-domain</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-params</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.assertj</groupId>
|
||||||
|
<artifactId>assertj-core</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
30
backend/codiki-domain/pom.xml
Normal file
30
backend/codiki-domain/pom.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>codiki-domain</artifactId>
|
||||||
|
|
||||||
|
<name>codiki-domain</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
</project>
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(project(":codiki-application"))
|
|
||||||
implementation(project(":codiki-domain"))
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-security")
|
|
||||||
implementation("org.apache.tika:tika-core:3.2.3")
|
|
||||||
}
|
|
||||||
37
backend/codiki-exposition/pom.xml
Normal file
37
backend/codiki-exposition/pom.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>codiki-exposition</artifactId>
|
||||||
|
|
||||||
|
<name>codiki-exposition</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-application</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -29,7 +29,7 @@ public class SecurityConfiguration {
|
|||||||
public SecurityFilterChain securityFilterChain(
|
public SecurityFilterChain securityFilterChain(
|
||||||
HttpSecurity httpSecurity,
|
HttpSecurity httpSecurity,
|
||||||
JwtAuthenticationFilter jwtAuthenticationFilter
|
JwtAuthenticationFilter jwtAuthenticationFilter
|
||||||
) throws Exception {
|
) {
|
||||||
httpSecurity
|
httpSecurity
|
||||||
.csrf(AbstractHttpConfigurer::disable)
|
.csrf(AbstractHttpConfigurer::disable)
|
||||||
.httpBasic(Customizer.withDefaults())
|
.httpBasic(Customizer.withDefaults())
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
|
||||||
// kotlin("plugin.jpa") version "2.1.20"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// implementation(kotlin("stdlib"))
|
|
||||||
implementation(project(":codiki-application"))
|
|
||||||
implementation(project(":codiki-domain"))
|
|
||||||
implementation("org.springframework:spring-context")
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
|
||||||
implementation("org.postgresql:postgresql:42.7.5")
|
|
||||||
}
|
|
||||||
60
backend/codiki-infrastructure/pom.xml
Normal file
60
backend/codiki-infrastructure/pom.xml
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>codiki-infrastructure</artifactId>
|
||||||
|
|
||||||
|
<name>codiki-infrastructure</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-domain</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-params</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.assertj</groupId>
|
||||||
|
<artifactId>assertj-core</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.codiki.infrastructure.configuration;
|
package org.codiki.infrastructure.configuration;
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
import org.springframework.boot.persistence.autoconfigure.EntityScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("org.springframework.boot") version "3.5.5"
|
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(project(":codiki-domain"))
|
|
||||||
implementation(project(":codiki-application"))
|
|
||||||
implementation(project(":codiki-infrastructure"))
|
|
||||||
implementation(project(":codiki-exposition"))
|
|
||||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
||||||
implementation("org.springframework.boot:spring-boot-devtools")
|
|
||||||
}
|
|
||||||
|
|
||||||
springBoot {
|
|
||||||
mainClass = "org.codiki.launcher.ApplicationLauncher"
|
|
||||||
}
|
|
||||||
57
backend/codiki-launcher/pom.xml
Normal file
57
backend/codiki-launcher/pom.xml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>codiki-launcher</artifactId>
|
||||||
|
|
||||||
|
<name>codiki-launcher</name>
|
||||||
|
<description>Demo project for Spring Boot</description>
|
||||||
|
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-exposition</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-application</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-domain</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-infrastructure</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
application:
|
application:
|
||||||
pictures:
|
pictures:
|
||||||
path: /Users/florian/Documents/Developpement/codiki-hexagonal/backend/pictures-folder/
|
path: /home/florian/Developpement/codiki-hexagonal/backend/pictures-folder/
|
||||||
temp-path : /Users/florian/Documents/Developpement/codiki-hexagonal/backend/pictures-folder/temp/
|
temp-path : /home/florian/Developpement/codiki-hexagonal/backend/pictures-folder/temp/
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ version: '3.9'
|
|||||||
services:
|
services:
|
||||||
codiki-database:
|
codiki-database:
|
||||||
container_name: "codiki-database"
|
container_name: "codiki-database"
|
||||||
image: "postgres:17"
|
image: "postgres:16"
|
||||||
ports:
|
ports:
|
||||||
- "50001:5432"
|
- "50001:5432"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
251
backend/gradlew
vendored
251
backend/gradlew
vendored
@@ -1,251 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright © 2015 the original authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
#
|
|
||||||
# Gradle start up script for POSIX generated by Gradle.
|
|
||||||
#
|
|
||||||
# Important for running:
|
|
||||||
#
|
|
||||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
||||||
# noncompliant, but you have some other compliant shell such as ksh or
|
|
||||||
# bash, then to run this script, type that shell name before the whole
|
|
||||||
# command line, like:
|
|
||||||
#
|
|
||||||
# ksh Gradle
|
|
||||||
#
|
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
|
||||||
# requires all of these POSIX shell features:
|
|
||||||
# * functions;
|
|
||||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
||||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
||||||
# * compound commands having a testable exit status, especially «case»;
|
|
||||||
# * various built-in commands including «command», «set», and «ulimit».
|
|
||||||
#
|
|
||||||
# Important for patching:
|
|
||||||
#
|
|
||||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
||||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
||||||
#
|
|
||||||
# The "traditional" practice of packing multiple parameters into a
|
|
||||||
# space-separated string is a well documented source of bugs and security
|
|
||||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
||||||
# options in "$@", and eventually passing that to Java.
|
|
||||||
#
|
|
||||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
||||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
||||||
# see the in-line comments for details.
|
|
||||||
#
|
|
||||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
||||||
# Darwin, MinGW, and NonStop.
|
|
||||||
#
|
|
||||||
# (3) This script is generated from the Groovy template
|
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
||||||
# within the Gradle project.
|
|
||||||
#
|
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
app_path=$0
|
|
||||||
|
|
||||||
# Need this for daisy-chained symlinks.
|
|
||||||
while
|
|
||||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
||||||
[ -h "$app_path" ]
|
|
||||||
do
|
|
||||||
ls=$( ls -ld "$app_path" )
|
|
||||||
link=${ls#*' -> '}
|
|
||||||
case $link in #(
|
|
||||||
/*) app_path=$link ;; #(
|
|
||||||
*) app_path=$APP_HOME$link ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# This is normally unused
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
APP_BASE_NAME=${0##*/}
|
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
||||||
MAX_FD=maximum
|
|
||||||
|
|
||||||
warn () {
|
|
||||||
echo "$*"
|
|
||||||
} >&2
|
|
||||||
|
|
||||||
die () {
|
|
||||||
echo
|
|
||||||
echo "$*"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
} >&2
|
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
|
||||||
cygwin=false
|
|
||||||
msys=false
|
|
||||||
darwin=false
|
|
||||||
nonstop=false
|
|
||||||
case "$( uname )" in #(
|
|
||||||
CYGWIN* ) cygwin=true ;; #(
|
|
||||||
Darwin* ) darwin=true ;; #(
|
|
||||||
MSYS* | MINGW* ) msys=true ;; #(
|
|
||||||
NONSTOP* ) nonstop=true ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CLASSPATH="\\\"\\\""
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
|
||||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
||||||
else
|
|
||||||
JAVACMD=$JAVA_HOME/bin/java
|
|
||||||
fi
|
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
JAVACMD=java
|
|
||||||
if ! command -v java >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
location of your Java installation."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
||||||
case $MAX_FD in #(
|
|
||||||
max*)
|
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC2039,SC3045
|
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
|
||||||
warn "Could not query maximum file descriptor limit"
|
|
||||||
esac
|
|
||||||
case $MAX_FD in #(
|
|
||||||
'' | soft) :;; #(
|
|
||||||
*)
|
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC2039,SC3045
|
|
||||||
ulimit -n "$MAX_FD" ||
|
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, stacking in reverse order:
|
|
||||||
# * args from the command line
|
|
||||||
# * the main class name
|
|
||||||
# * -classpath
|
|
||||||
# * -D...appname settings
|
|
||||||
# * --module-path (only if needed)
|
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if "$cygwin" || "$msys" ; then
|
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
||||||
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
for arg do
|
|
||||||
if
|
|
||||||
case $arg in #(
|
|
||||||
-*) false ;; # don't mess with options #(
|
|
||||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
||||||
[ -e "$t" ] ;; #(
|
|
||||||
*) false ;;
|
|
||||||
esac
|
|
||||||
then
|
|
||||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
||||||
fi
|
|
||||||
# Roll the args list around exactly as many times as the number of
|
|
||||||
# args, so each arg winds up back in the position where it started, but
|
|
||||||
# possibly modified.
|
|
||||||
#
|
|
||||||
# NB: a `for` loop captures its iteration list before it begins, so
|
|
||||||
# changing the positional parameters here affects neither the number of
|
|
||||||
# iterations, nor the values presented in `arg`.
|
|
||||||
shift # remove old arg
|
|
||||||
set -- "$@" "$arg" # push replacement arg
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
||||||
# and any embedded shellness will be escaped.
|
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
||||||
# treated as '${Hostname}' itself on the command line.
|
|
||||||
|
|
||||||
set -- \
|
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
||||||
-classpath "$CLASSPATH" \
|
|
||||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
|
||||||
if ! command -v xargs >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "xargs is not available"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
|
||||||
#
|
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
||||||
#
|
|
||||||
# In Bash we could simply go:
|
|
||||||
#
|
|
||||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
||||||
# set -- "${ARGS[@]}" "$@"
|
|
||||||
#
|
|
||||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
||||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
||||||
# character that might be a shell metacharacter, then use eval to reverse
|
|
||||||
# that process (while maintaining the separation between arguments), and wrap
|
|
||||||
# the whole thing up as a single "set" statement.
|
|
||||||
#
|
|
||||||
# This will of course break if any of these variables contains a newline or
|
|
||||||
# an unmatched quote.
|
|
||||||
#
|
|
||||||
|
|
||||||
eval "set -- $(
|
|
||||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
||||||
xargs -n1 |
|
|
||||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
||||||
tr '\n' ' '
|
|
||||||
)" '"$@"'
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
|
||||||
94
backend/gradlew.bat
vendored
94
backend/gradlew.bat
vendored
@@ -1,94 +0,0 @@
|
|||||||
@rem
|
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@rem See the License for the specific language governing permissions and
|
|
||||||
@rem limitations under the License.
|
|
||||||
@rem
|
|
||||||
@rem SPDX-License-Identifier: Apache-2.0
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
|
||||||
@rem ##########################################################################
|
|
||||||
@rem
|
|
||||||
@rem Gradle startup script for Windows
|
|
||||||
@rem
|
|
||||||
@rem ##########################################################################
|
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
|
||||||
@rem This is normally unused
|
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
||||||
|
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
|
||||||
|
|
||||||
echo. 1>&2
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
|
||||||
echo. 1>&2
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
||||||
echo location of your Java installation. 1>&2
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
|
||||||
|
|
||||||
echo. 1>&2
|
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
|
||||||
echo. 1>&2
|
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
||||||
echo location of your Java installation. 1>&2
|
|
||||||
|
|
||||||
goto fail
|
|
||||||
|
|
||||||
:execute
|
|
||||||
@rem Setup the command line
|
|
||||||
|
|
||||||
set CLASSPATH=
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
||||||
|
|
||||||
:end
|
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
98
backend/pom.xml
Normal file
98
backend/pom.xml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-parent</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
<name>codiki</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
|
<jakarta.servlet-api.version>6.1.0</jakarta.servlet-api.version>
|
||||||
|
<java-jwt.version>4.5.0</java-jwt.version>
|
||||||
|
<postgresql.version>42.7.8</postgresql.version>
|
||||||
|
<tika-core.version>3.2.3</tika-core.version>
|
||||||
|
<commons-lang3.version>3.20.0</commons-lang3.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>codiki-domain</module>
|
||||||
|
<module>codiki-application</module>
|
||||||
|
<module>codiki-infrastructure</module>
|
||||||
|
<module>codiki-exposition</module>
|
||||||
|
<module>codiki-launcher</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
|
<version>4.0.1</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-exposition</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-application</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-domain</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codiki</groupId>
|
||||||
|
<artifactId>codiki-infrastructure</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${jakarta.servlet-api.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.auth0</groupId>
|
||||||
|
<artifactId>java-jwt</artifactId>
|
||||||
|
<version>${java-jwt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<version>${postgresql.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
<version>${tika-core.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons-lang3.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
rootProject.name = "codiki-backend"
|
|
||||||
include("codiki-domain", "codiki-application", "codiki-exposition", "codiki-infrastructure", "codiki-launcher")
|
|
||||||
@@ -24,13 +24,13 @@
|
|||||||
},
|
},
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:application",
|
"builder": "@angular/build:application",
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/codiki",
|
"outputPath": "dist/codiki",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"browser": "src/main.ts",
|
"browser": "src/main.ts",
|
||||||
"polyfills": [
|
"polyfills": [
|
||||||
"zone.js"
|
"@angular/localize/init"
|
||||||
],
|
],
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
"defaultConfiguration": ""
|
"defaultConfiguration": ""
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular/build:dev-server",
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production-en": {
|
"production-en": {
|
||||||
"buildTarget": "codiki:build:production-en"
|
"buildTarget": "codiki:build:production-en"
|
||||||
@@ -123,17 +123,15 @@
|
|||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
},
|
},
|
||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
"builder": "@angular/build:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"buildTarget": "codiki:build"
|
"buildTarget": "codiki:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@angular-devkit/build-angular:karma",
|
"builder": "@angular/build:karma",
|
||||||
"options": {
|
"options": {
|
||||||
"polyfills": [
|
"polyfills": [
|
||||||
"zone.js",
|
|
||||||
"zone.js/testing"
|
|
||||||
],
|
],
|
||||||
"tsConfig": "tsconfig.spec.json",
|
"tsConfig": "tsconfig.spec.json",
|
||||||
"inlineStyleLanguage": "scss",
|
"inlineStyleLanguage": "scss",
|
||||||
@@ -153,5 +151,31 @@
|
|||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"analytics": false
|
"analytics": false
|
||||||
|
},
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"type": "component"
|
||||||
|
},
|
||||||
|
"@schematics/angular:directive": {
|
||||||
|
"type": "directive"
|
||||||
|
},
|
||||||
|
"@schematics/angular:service": {
|
||||||
|
"type": "service"
|
||||||
|
},
|
||||||
|
"@schematics/angular:guard": {
|
||||||
|
"typeSeparator": "."
|
||||||
|
},
|
||||||
|
"@schematics/angular:interceptor": {
|
||||||
|
"typeSeparator": "."
|
||||||
|
},
|
||||||
|
"@schematics/angular:module": {
|
||||||
|
"typeSeparator": "."
|
||||||
|
},
|
||||||
|
"@schematics/angular:pipe": {
|
||||||
|
"typeSeparator": "."
|
||||||
|
},
|
||||||
|
"@schematics/angular:resolver": {
|
||||||
|
"typeSeparator": "."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12967
frontend/package-lock.json
generated
12967
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,32 +17,26 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^18.2.5",
|
"@angular/animations": "^21.1.2",
|
||||||
"@angular/cdk": "^18.2.5",
|
"@angular/cdk": "^21.1.2",
|
||||||
"@angular/common": "^18.2.5",
|
"@angular/common": "^21.1.2",
|
||||||
"@angular/compiler": "^18.2.5",
|
"@angular/compiler": "^21.1.2",
|
||||||
"@angular/core": "^18.2.5",
|
"@angular/core": "^21.1.2",
|
||||||
"@angular/forms": "^18.2.5",
|
"@angular/forms": "^21.1.2",
|
||||||
"@angular/material": "^18.2.5",
|
"@angular/material": "^21.1.2",
|
||||||
"@angular/platform-browser": "^18.2.5",
|
"@angular/platform-browser": "^21.1.2",
|
||||||
"@angular/platform-browser-dynamic": "^18.2.5",
|
"@angular/platform-browser-dynamic": "^21.1.2",
|
||||||
"@angular/router": "^18.2.5",
|
"@angular/router": "^21.1.2",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.2",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.8.1"
|
||||||
"zone.js": "~0.14.10"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "^18.2.5",
|
"@angular/build": "^21.1.2",
|
||||||
"@angular/cli": "^18.2.5",
|
"@angular/cli": "^21.1.2",
|
||||||
"@angular/compiler-cli": "^18.2.5",
|
"@angular/compiler-cli": "^21.1.2",
|
||||||
"@angular/localize": "^18.2.5",
|
"@angular/localize": "^21.1.2",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.15",
|
||||||
"jasmine-core": "~5.1.0",
|
"jasmine-core": "~5.13.0",
|
||||||
"karma": "~6.4.0",
|
"typescript": "~5.9.3"
|
||||||
"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.5.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {RouterOutlet} from '@angular/router';
|
import {RouterOutlet} from '@angular/router';
|
||||||
import {HeaderComponent} from './components/header/header.component';
|
import {HeaderComponent} from './components/header/header.component';
|
||||||
@@ -6,9 +5,7 @@ import { FooterComponent } from './components/footer/footer.component';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
standalone: true,
|
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
RouterOutlet,
|
RouterOutlet,
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
FooterComponent
|
FooterComponent
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { APP_INITIALIZER, ApplicationConfig } from '@angular/core';
|
import {ApplicationConfig, inject, provideAppInitializer} from '@angular/core';
|
||||||
import {provideRouter, withRouterConfig} from '@angular/router';
|
import {provideRouter, withRouterConfig} from '@angular/router';
|
||||||
|
|
||||||
import {HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
import {HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi} from '@angular/common/http';
|
||||||
@@ -19,11 +19,9 @@ export const appConfig: ApplicationConfig = {
|
|||||||
provideAnimationsAsync(),
|
provideAnimationsAsync(),
|
||||||
provideHttpClient(withInterceptorsFromDi()),
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},
|
{provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true},
|
||||||
{
|
provideAppInitializer(() => {
|
||||||
provide: APP_INITIALIZER,
|
const initializerFn = ((authenticationService: AuthenticationService) => () => authenticationService.startAuthenticationCheckingProcess())(inject(AuthenticationService));
|
||||||
useFactory: (authenticationService: AuthenticationService) => () => authenticationService.startAuthenticationCheckingProcess(),
|
return initializerFn();
|
||||||
deps: [AuthenticationService],
|
})
|
||||||
multi: true
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, inject, Input } from "@angular/core";
|
import {Component, inject} from "@angular/core";
|
||||||
import {MatRippleModule} from "@angular/material/core";
|
import {MatRippleModule} from "@angular/material/core";
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||||
|
|
||||||
@@ -9,7 +9,6 @@ export interface ConfirmationDialogData {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-confirmation-dialog',
|
selector: 'app-confirmation-dialog',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './confirmation-dialog.component.html',
|
templateUrl: './confirmation-dialog.component.html',
|
||||||
styleUrl: './confirmation-dialog.component.scss',
|
styleUrl: './confirmation-dialog.component.scss',
|
||||||
imports: [MatRippleModule]
|
imports: [MatRippleModule]
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<div i18n>
|
<div i18n>
|
||||||
<span class="copy-left">©</span>
|
<span class="copy-left">©</span>
|
||||||
2016 - 2024 All rights reserved
|
2016 - 2026 All rights reserved
|
||||||
-
|
-
|
||||||
2.1
|
2.2
|
||||||
<a [routerLink]="['./']" matTooltip="Health checking will be available in future..." i18n-matTooltip>
|
<a [routerLink]="['./']" matTooltip="Health checking will be available in future..." i18n-matTooltip>
|
||||||
<mat-icon>favorite</mat-icon>
|
<mat-icon>favorite</mat-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -12,10 +12,12 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: .2em;
|
||||||
|
|
||||||
.copy-left {
|
.copy-left {
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: rgba(255, 255, 255, .6);
|
color: rgba(255, 255, 255, .6);
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ import { RouterModule } from '@angular/router';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-footer',
|
selector: 'app-footer',
|
||||||
standalone: true,
|
|
||||||
imports: [MatIconModule, MatTooltipModule, RouterModule],
|
imports: [MatIconModule, MatTooltipModule, RouterModule],
|
||||||
templateUrl: './footer.component.html',
|
templateUrl: './footer.component.html',
|
||||||
styleUrl: './footer.component.scss'
|
styleUrl: './footer.component.scss'
|
||||||
})
|
})
|
||||||
export class FooterComponent {
|
export class FooterComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import {Component, inject} from '@angular/core';
|
import {Component, inject} from '@angular/core';
|
||||||
import {FormControl, ReactiveFormsModule} from '@angular/forms';
|
import {FormControl, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MatButtonModule} from '@angular/material/button';
|
import {MatButtonModule} from '@angular/material/button';
|
||||||
@@ -13,9 +12,7 @@ import { SideMenuComponent } from '../side-menu/side-menu.component';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
standalone: true,
|
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
@@ -24,10 +21,10 @@ import { SideMenuComponent } from '../side-menu/side-menu.component';
|
|||||||
PublicationsSearchBarComponent,
|
PublicationsSearchBarComponent,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
SideMenuComponent,
|
SideMenuComponent
|
||||||
],
|
],
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
styleUrl: './header.component.scss',
|
styleUrl: './header.component.scss'
|
||||||
})
|
})
|
||||||
export class HeaderComponent {
|
export class HeaderComponent {
|
||||||
private authenticationService = inject(AuthenticationService);
|
private authenticationService = inject(AuthenticationService);
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export const PROGRAMMING_LANGUAGES: ProgramingLanguage[] = [
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-code-block-dialog',
|
selector: 'app-code-block-dialog',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './code-block-dialog.component.html',
|
templateUrl: './code-block-dialog.component.html',
|
||||||
styleUrl: './code-block-dialog.component.scss',
|
styleUrl: './code-block-dialog.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -10,13 +10,14 @@
|
|||||||
<h1 i18n>Select an illustration</h1>
|
<h1 i18n>Select an illustration</h1>
|
||||||
</header>
|
</header>
|
||||||
<div class="picture-container">
|
<div class="picture-container">
|
||||||
@if (isLoading) {
|
@if (isLoading()) {
|
||||||
<h2 i18n>Pictures loading...</h2>
|
<h2 i18n>Pictures loading...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner></mat-spinner>
|
||||||
} @else {
|
} @else {
|
||||||
@if (pictures.length) {
|
@if (pictures.length) {
|
||||||
@for (picture of pictures; track picture) {
|
@for (picture of pictures; track picture) {
|
||||||
<img src="/api/pictures/{{picture.id}}" (click)="selectPicture(picture)" matTooltip="Choose this illustration" i18n-matTooltip/>
|
<img src="/api/pictures/{{picture.id}}" (click)="selectPicture(picture)" matTooltip="Choose this illustration"
|
||||||
|
i18n-matTooltip/>
|
||||||
}
|
}
|
||||||
} @else {
|
} @else {
|
||||||
<h2 i18n>There is no any picture.</h2>
|
<h2 i18n>There is no any picture.</h2>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, inject, OnInit } from "@angular/core";
|
import {Component, inject, OnInit, signal} from "@angular/core";
|
||||||
import {Picture} from "../../../core/rest-services/picture/model/picture";
|
import {Picture} from "../../../core/rest-services/picture/model/picture";
|
||||||
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
@@ -10,7 +10,6 @@ import { MatTooltip } from "@angular/material/tooltip";
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-picture-selection',
|
selector: 'app-picture-selection',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './picture-selection-dialog.component.html',
|
templateUrl: './picture-selection-dialog.component.html',
|
||||||
styleUrl: './picture-selection-dialog.component.scss',
|
styleUrl: './picture-selection-dialog.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
@@ -18,19 +17,19 @@ import { MatTooltip } from "@angular/material/tooltip";
|
|||||||
MatRippleModule,
|
MatRippleModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
MatTooltip
|
MatTooltip
|
||||||
],
|
]
|
||||||
})
|
})
|
||||||
export class PictureSelectionDialog implements OnInit {
|
export class PictureSelectionDialog implements OnInit {
|
||||||
private readonly pictureRestService = inject(PictureRestService);
|
private readonly pictureRestService = inject(PictureRestService);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
private readonly dialogRef = inject(MatDialogRef<PictureSelectionDialog>);
|
private readonly dialogRef = inject(MatDialogRef<PictureSelectionDialog>);
|
||||||
|
|
||||||
isLoading: boolean = false;
|
isLoading = signal(false);
|
||||||
isLoaded: boolean = false;
|
isLoaded = signal(false);
|
||||||
pictures: Picture[] = [];
|
pictures: Picture[] = [];
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.isLoading = true;
|
this.isLoading.set(true);
|
||||||
this.pictureRestService.getAllOfCurrentUser()
|
this.pictureRestService.getAllOfCurrentUser()
|
||||||
.then(pictures => {
|
.then(pictures => {
|
||||||
this.pictures = pictures;
|
this.pictures = pictures;
|
||||||
@@ -39,14 +38,14 @@ export class PictureSelectionDialog implements OnInit {
|
|||||||
if (error.status === 401) {
|
if (error.status === 401) {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
} else {
|
} else {
|
||||||
const errorMessage = $localize`An error occured while loading pictures.`;
|
const errorMessage = $localize`An error occurred while loading pictures.`;
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isLoading = false;
|
this.isLoading.set(false);
|
||||||
this.isLoaded = true;
|
this.isLoaded.set(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +65,7 @@ export class PictureSelectionDialog implements OnInit {
|
|||||||
this.dialogRef.close(pictureId);
|
this.dialogRef.close(pictureId);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`A technical error occured while uploading your picture.`;
|
const errorMessage = $localize`A technical error occurred while uploading your picture.`;
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<form [formGroup]="publicationEditionForm" (submit)="save()" ngNativeValidate>
|
<form [formGroup]="publicationEditionForm" (submit)="save()" ngNativeValidate>
|
||||||
<header>
|
<header>
|
||||||
<h1>{{title}}</h1>
|
<h1>{{ title() }}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<mat-tab-group dynamicHeight (selectedIndexChange)="onTabChange($event)">
|
<mat-tab-group dynamicHeight (selectedIndexChange)="onTabChange($event)">
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="picture-container">
|
<div class="picture-container">
|
||||||
<img [src]="publication.illustrationId.length ? '/api/pictures/' + publication.illustrationId : '/assets/images/default-picture.png'"
|
<img
|
||||||
|
[src]="publication().illustrationId.length ? '/api/pictures/' + publication().illustrationId : '/assets/images/default-picture.png'"
|
||||||
(click)="displayPictureSectionDialog()"
|
(click)="displayPictureSectionDialog()"
|
||||||
matTooltip="Click to change illustration"
|
matTooltip="Click to change illustration"
|
||||||
i18n-matTooltip/>
|
i18n-matTooltip/>
|
||||||
@@ -103,24 +104,24 @@
|
|||||||
|
|
||||||
<mat-tab label="Previewing" i18n-label>
|
<mat-tab label="Previewing" i18n-label>
|
||||||
<div class="preview">
|
<div class="preview">
|
||||||
@if ((isPreviewing$ | async) === true) {
|
@if (isPreviewing()) {
|
||||||
<div class="preview-loading">
|
<div class="preview-loading">
|
||||||
<h2 i18n>Preview is loading...</h2>
|
<h2 i18n>Preview is loading...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner></mat-spinner>
|
||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<img class="illustration" src="/api/pictures/{{ publication.illustrationId }}" />
|
<img class="illustration" src="/api/pictures/{{ publication().illustrationId }}"/>
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ publication.title }}</h1>
|
<h1>{{ publication().title }}</h1>
|
||||||
<h2>{{ publication.description }}</h2>
|
<h2>{{ publication().description }}</h2>
|
||||||
</header>
|
</header>
|
||||||
<main [innerHTML]="publicationInEdition.parsedText"></main>
|
<main [innerHTML]="publicationInEdition().parsedText"></main>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
<footer>
|
<footer>
|
||||||
<app-submit-button [requestPending]="!!(isSaving$ | async)" i18n>Save</app-submit-button>
|
<app-submit-button [requestPending]="isSaving()" i18n>Save</app-submit-button>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="cod-button secondary"
|
class="cod-button secondary"
|
||||||
(click)="goPreviousLocation()"
|
(click)="goPreviousLocation()"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {CommonModule, Location} from "@angular/common";
|
import {CommonModule, Location} from "@angular/common";
|
||||||
import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, Output } from "@angular/core";
|
import {Component, effect, inject, input, output, signal} from "@angular/core";
|
||||||
import {FormGroup, ReactiveFormsModule} from "@angular/forms";
|
import {FormGroup, ReactiveFormsModule} from "@angular/forms";
|
||||||
import {MatDialogModule} from "@angular/material/dialog";
|
import {MatDialogModule} from "@angular/material/dialog";
|
||||||
import {MatIconModule} from "@angular/material/icon";
|
import {MatIconModule} from "@angular/material/icon";
|
||||||
@@ -8,18 +8,16 @@ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
|
|||||||
import {MatSelectModule} from "@angular/material/select";
|
import {MatSelectModule} from "@angular/material/select";
|
||||||
import {MatTabsModule} from "@angular/material/tabs";
|
import {MatTabsModule} from "@angular/material/tabs";
|
||||||
import {MatTooltipModule} from "@angular/material/tooltip";
|
import {MatTooltipModule} from "@angular/material/tooltip";
|
||||||
import { map, Observable, of, Subscription } from "rxjs";
|
import {map, Observable} from "rxjs";
|
||||||
import {Category} from "../../core/rest-services/category/model/category";
|
import {Category} from "../../core/rest-services/category/model/category";
|
||||||
import { Publication } from "../../core/rest-services/publications/model/publication";
|
import {DEFAULT_PUBLICATION, Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import {CategoryService} from "../../core/service/category.service";
|
import {CategoryService} from "../../core/service/category.service";
|
||||||
import {SubmitButtonComponent} from "../submit-button/submit-button.component";
|
import {SubmitButtonComponent} from "../submit-button/submit-button.component";
|
||||||
import { PictureSelectionDialog } from "./picture-selection-dialog/picture-selection-dialog.component";
|
|
||||||
import {PublicationEditionService} from "./publication-edition.service";
|
import {PublicationEditionService} from "./publication-edition.service";
|
||||||
import {MatRippleModule} from "@angular/material/core";
|
import {MatRippleModule} from "@angular/material/core";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-edition',
|
selector: 'app-publication-edition',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './publication-edition.component.html',
|
templateUrl: './publication-edition.component.html',
|
||||||
styleUrl: './publication-edition.component.scss',
|
styleUrl: './publication-edition.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
@@ -32,42 +30,42 @@ import { MatRippleModule } from "@angular/material/core";
|
|||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
PictureSelectionDialog,
|
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
SubmitButtonComponent
|
SubmitButtonComponent
|
||||||
],
|
],
|
||||||
providers: [PublicationEditionService]
|
providers: [PublicationEditionService]
|
||||||
})
|
})
|
||||||
export class PublicationEditionComponent implements OnChanges, OnDestroy {
|
export class PublicationEditionComponent {
|
||||||
@Input()
|
readonly #categoryService = inject(CategoryService);
|
||||||
publication!: Publication;
|
readonly #location = inject(Location);
|
||||||
@Input()
|
readonly #publicationEditionService = inject(PublicationEditionService);
|
||||||
title!: string;
|
|
||||||
@Input()
|
|
||||||
isSaving$: Observable<boolean> = of(false);
|
|
||||||
@Output()
|
|
||||||
publicationSave = new EventEmitter<Publication>();
|
|
||||||
|
|
||||||
publicationInEdition!: Publication;
|
publication = input.required<Publication>();
|
||||||
private readonly categoryService = inject(CategoryService);
|
title = input.required<string>();
|
||||||
private readonly location = inject(Location);
|
isSaving = input.required<boolean>();
|
||||||
private readonly publicationEditionService = inject(PublicationEditionService);
|
publicationSave = output<Publication>();
|
||||||
private subscriptions: Subscription[] = [];
|
|
||||||
|
isLoading = this.#publicationEditionService.isLoading;
|
||||||
|
isPreviewing = this.#publicationEditionService.isPreviewing;
|
||||||
|
publicationInEdition = signal<Publication>(DEFAULT_PUBLICATION);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
|
let publication = this.publication();
|
||||||
|
const publicationInEdition = this.publicationInEdition();
|
||||||
|
if (!publicationInEdition || publicationInEdition !== publication) {
|
||||||
|
this.publicationInEdition.set(publication);
|
||||||
|
this.#publicationEditionService.init(publication);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
get publicationEditionForm(): FormGroup {
|
get publicationEditionForm(): FormGroup {
|
||||||
return this.publicationEditionService.publicationEditionForm;
|
return this.#publicationEditionService.publicationEditionForm;
|
||||||
}
|
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
|
||||||
return this.publicationEditionService.isLoading$;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isPreviewing$(): Observable<boolean> {
|
|
||||||
return this.publicationEditionService.isPreviewing$;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get categories$(): Observable<Category[]> {
|
get categories$(): Observable<Category[]> {
|
||||||
return this.categoryService.categories$
|
return this.#categoryService.categories$
|
||||||
.pipe(
|
.pipe(
|
||||||
map(categories =>
|
map(categories =>
|
||||||
categories.filter(category => category.subCategories.length == 0)
|
categories.filter(category => category.subCategories.length == 0)
|
||||||
@@ -90,41 +88,28 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(): void {
|
|
||||||
this.ngOnDestroy();
|
|
||||||
|
|
||||||
if (!this.publicationInEdition || this.publicationInEdition !== this.publication) {
|
|
||||||
this.publicationInEdition = this.publication;
|
|
||||||
this.publicationEditionService.init(this.publicationInEdition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.subscriptions.forEach(subscription => subscription?.unsubscribe());
|
|
||||||
}
|
|
||||||
|
|
||||||
goPreviousLocation(): void {
|
goPreviousLocation(): void {
|
||||||
this.location.back();
|
this.#location.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
insertTitle(titleNumber: number): void {
|
insertTitle(titleNumber: number): void {
|
||||||
this.publicationEditionService.insertTitle(titleNumber);
|
this.#publicationEditionService.insertTitle(titleNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectAPicture(): void {
|
selectAPicture(): void {
|
||||||
this.publicationEditionService.selectAPicture();
|
this.#publicationEditionService.selectAPicture();
|
||||||
}
|
}
|
||||||
|
|
||||||
insertLink(): void {
|
insertLink(): void {
|
||||||
this.publicationEditionService.insertLink();
|
this.#publicationEditionService.insertLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
displayCodeBlockDialog(): void {
|
displayCodeBlockDialog(): void {
|
||||||
this.publicationEditionService.displayCodeBlockDialog();
|
this.#publicationEditionService.displayCodeBlockDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPictureSectionDialog(): void {
|
displayPictureSectionDialog(): void {
|
||||||
this.publicationEditionService.displayPictureSectionDialog();
|
this.#publicationEditionService.displayPictureSectionDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCursorPosition(event: KeyboardEvent | MouseEvent): void {
|
updateCursorPosition(event: KeyboardEvent | MouseEvent): void {
|
||||||
@@ -134,17 +119,17 @@ export class PublicationEditionComponent implements OnChanges, OnDestroy {
|
|||||||
const positionStart = textarea.selectionStart;
|
const positionStart = textarea.selectionStart;
|
||||||
const positionEnd = textarea.selectionEnd;
|
const positionEnd = textarea.selectionEnd;
|
||||||
|
|
||||||
this.publicationEditionService.editCursorPosition(positionStart, positionEnd);
|
this.#publicationEditionService.editCursorPosition(positionStart, positionEnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
save(): void {
|
save(): void {
|
||||||
this.publicationSave.emit(this.publicationEditionService.editedPublication);
|
this.publicationSave.emit(this.#publicationEditionService.editedPublication);
|
||||||
}
|
}
|
||||||
|
|
||||||
onTabChange(tabSelectedIndex: number): void {
|
onTabChange(tabSelectedIndex: number): void {
|
||||||
if (tabSelectedIndex === 1) {
|
if (tabSelectedIndex === 1) {
|
||||||
this.publicationEditionService.loadPreview();
|
this.#publicationEditionService.loadPreview();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
import { inject, Injectable, OnDestroy } from "@angular/core";
|
import {inject, Injectable, OnDestroy, Signal, signal} from "@angular/core";
|
||||||
import {MatDialog} from "@angular/material/dialog";
|
import {MatDialog} from "@angular/material/dialog";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import {ActivatedRoute} from "@angular/router";
|
||||||
import { BehaviorSubject, debounceTime, distinctUntilChanged, Observable, Subscription } from "rxjs";
|
import {debounceTime, distinctUntilChanged, Subscription} from "rxjs";
|
||||||
import { Publication } from "../../core/rest-services/publications/model/publication";
|
import {DEFAULT_PUBLICATION, Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
||||||
import {copy} from "../../core/utils/ObjectUtils";
|
import {copy} from "../../core/utils/ObjectUtils";
|
||||||
import {CodeBlockDialog} from "./code-block-dialog/code-block-dialog.component";
|
import {CodeBlockDialog} from "./code-block-dialog/code-block-dialog.component";
|
||||||
@@ -31,23 +31,6 @@ export interface PublicationEditionState {
|
|||||||
cursorPosition: CursorPosition;
|
cursorPosition: CursorPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_PUBLICATION: Publication = {
|
|
||||||
id: '',
|
|
||||||
key: '',
|
|
||||||
title: '',
|
|
||||||
text: '',
|
|
||||||
parsedText: '',
|
|
||||||
description: '',
|
|
||||||
creationDate: new Date(),
|
|
||||||
illustrationId: '',
|
|
||||||
categoryId: '',
|
|
||||||
author: {
|
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
image: ''
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const DEFAULT_CURSOR_POSITION = new CursorPosition(0, 0);
|
const DEFAULT_CURSOR_POSITION = new CursorPosition(0, 0);
|
||||||
|
|
||||||
const DEFAULT_STATE: PublicationEditionState = {
|
const DEFAULT_STATE: PublicationEditionState = {
|
||||||
@@ -57,20 +40,20 @@ const DEFAULT_STATE: PublicationEditionState = {
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PublicationEditionService implements OnDestroy {
|
export class PublicationEditionService implements OnDestroy {
|
||||||
private readonly activatedRoute = inject(ActivatedRoute);
|
readonly #activatedRoute = inject(ActivatedRoute);
|
||||||
private readonly dialog = inject(MatDialog);
|
readonly #dialog = inject(MatDialog);
|
||||||
private readonly formBuilder = inject(FormBuilder);
|
readonly #formBuilder = inject(FormBuilder);
|
||||||
private readonly location = inject(Location);
|
readonly #location = inject(Location);
|
||||||
private readonly publicationRestService = inject(PublicationRestService);
|
readonly #publicationRestService = inject(PublicationRestService);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
readonly #snackBar = inject(MatSnackBar);
|
||||||
|
|
||||||
private isLoadingSubject = new BehaviorSubject<boolean>(false);
|
#isLoading = signal(false);
|
||||||
private stateSubject = new BehaviorSubject<PublicationEditionState>(copy(DEFAULT_STATE));
|
#state = signal<PublicationEditionState>(copy(DEFAULT_STATE));
|
||||||
private subscriptions: Subscription[] = [];
|
#isSaving = signal<boolean>(false);
|
||||||
private isSavingSubject = new BehaviorSubject<boolean>(false);
|
#isPreviewing = signal<boolean>(false);
|
||||||
private isPreviewingSubject = new BehaviorSubject<boolean>(false);
|
#subscriptions: Subscription[] = [];
|
||||||
|
|
||||||
publicationEditionForm: FormGroup = this.formBuilder.group({
|
publicationEditionForm: FormGroup = this.#formBuilder.group({
|
||||||
title: new FormControl<string | undefined>('', [Validators.required]),
|
title: new FormControl<string | undefined>('', [Validators.required]),
|
||||||
description: new FormControl<string | undefined>('', [Validators.required]),
|
description: new FormControl<string | undefined>('', [Validators.required]),
|
||||||
text: new FormControl<string | undefined>('', [Validators.required]),
|
text: new FormControl<string | undefined>('', [Validators.required]),
|
||||||
@@ -79,19 +62,11 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.subscriptions.forEach(subscription => subscription.unsubscribe());
|
this.#subscriptions.forEach(subscription => subscription.unsubscribe());
|
||||||
}
|
}
|
||||||
|
|
||||||
private get _state(): PublicationEditionState {
|
#updateForm(): void {
|
||||||
return this.stateSubject.value;
|
const state = this.#state();
|
||||||
}
|
|
||||||
|
|
||||||
private _save(state: PublicationEditionState): void {
|
|
||||||
this.stateSubject.next(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private _updateForm(): void {
|
|
||||||
const state = this._state;
|
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
this.publicationEditionForm.controls['title'].setValue(publication.title);
|
this.publicationEditionForm.controls['title'].setValue(publication.title);
|
||||||
@@ -101,56 +76,56 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
this.publicationEditionForm.controls['categoryId'].setValue(publication.categoryId);
|
this.publicationEditionForm.controls['categoryId'].setValue(publication.categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
get isLoading(): Signal<boolean> {
|
||||||
return this.isLoadingSubject.asObservable();
|
return this.#isLoading.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isSaving$(): Observable<boolean> {
|
get isSaving(): Signal<boolean> {
|
||||||
return this.isSavingSubject.asObservable();
|
return this.#isSaving.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isPreviewing$(): Observable<boolean> {
|
get isPreviewing(): Signal<boolean> {
|
||||||
return this.isPreviewingSubject.asObservable();
|
return this.#isPreviewing.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get state$(): Observable<PublicationEditionState> {
|
get state(): Signal<PublicationEditionState> {
|
||||||
return this.stateSubject.asObservable();
|
return this.#state.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get editedPublication(): Publication {
|
get editedPublication(): Publication {
|
||||||
return this._state.publication;
|
return this.#state().publication;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPublication(): void {
|
loadPublication(): void {
|
||||||
this.isLoadingSubject.next(true);
|
this.#isLoading.set(true);
|
||||||
|
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.#activatedRoute.paramMap.subscribe(params => {
|
||||||
const publicationId = params.get('publicationId');
|
const publicationId = params.get('publicationId');
|
||||||
if (publicationId == undefined) {
|
if (publicationId == undefined) {
|
||||||
this.snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, {duration: 5000});
|
||||||
this.location.back();
|
this.#location.back();
|
||||||
} else {
|
} else {
|
||||||
this.publicationRestService.getById(publicationId)
|
this.#publicationRestService.getById(publicationId)
|
||||||
.then(publication => {
|
.then(publication => {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
state.publication = publication;
|
state.publication = publication;
|
||||||
this.stateSubject.next(state);
|
this.#state.set(state);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`A technical error occurred while loading publication data.`;
|
const errorMessage = $localize`A technical error occurred while loading publication data.`;
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
console.error(errorMessage, error)
|
console.error(errorMessage, error)
|
||||||
})
|
})
|
||||||
.finally(() => this.isLoadingSubject.next(false));
|
.finally(() => this.#isLoading.set(false));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
init(publication: Publication): void {
|
init(publication: Publication): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
state.publication = publication;
|
state.publication = publication;
|
||||||
this.stateSubject.next(state);
|
this.#state.set(state);
|
||||||
this._updateForm();
|
this.#updateForm();
|
||||||
|
|
||||||
const formValueChangesSubscription = this.publicationEditionForm.valueChanges
|
const formValueChangesSubscription = this.publicationEditionForm.valueChanges
|
||||||
.pipe(
|
.pipe(
|
||||||
@@ -158,7 +133,7 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
distinctUntilChanged()
|
distinctUntilChanged()
|
||||||
)
|
)
|
||||||
.subscribe(formValue => {
|
.subscribe(formValue => {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
publication.title = formValue.title;
|
publication.title = formValue.title;
|
||||||
@@ -166,19 +141,19 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
publication.categoryId = formValue.categoryId;
|
publication.categoryId = formValue.categoryId;
|
||||||
publication.text = formValue.text;
|
publication.text = formValue.text;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
})
|
});
|
||||||
this.subscriptions.push(formValueChangesSubscription);
|
this.#subscriptions.push(formValueChangesSubscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
private editIllustrationId(pictureId: string): void {
|
private editIllustrationId(pictureId: string): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
state.publication.illustrationId = pictureId
|
state.publication.illustrationId = pictureId
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
displayPictureSectionDialog(): void {
|
displayPictureSectionDialog(): void {
|
||||||
const dialogRef = this.dialog.open(PictureSelectionDialog);
|
const dialogRef = this.#dialog.open(PictureSelectionDialog);
|
||||||
|
|
||||||
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
||||||
.subscribe(newPictureId => {
|
.subscribe(newPictureId => {
|
||||||
@@ -186,11 +161,11 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
this.editIllustrationId(newPictureId);
|
this.editIllustrationId(newPictureId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.subscriptions.push(afterDialogCloseSubscription);
|
this.#subscriptions.push(afterDialogCloseSubscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
displayCodeBlockDialog(): void {
|
displayCodeBlockDialog(): void {
|
||||||
const dialogRef = this.dialog.open(CodeBlockDialog, { width: '60em' });
|
const dialogRef = this.#dialog.open(CodeBlockDialog, {width: '60em'});
|
||||||
|
|
||||||
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
||||||
.subscribe(codeBlockWithLanguage => {
|
.subscribe(codeBlockWithLanguage => {
|
||||||
@@ -198,21 +173,21 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
this.insertCodeBlock(codeBlockWithLanguage.programmingLanguage, codeBlockWithLanguage.codeBlock);
|
this.insertCodeBlock(codeBlockWithLanguage.programmingLanguage, codeBlockWithLanguage.codeBlock);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.subscriptions.push(afterDialogCloseSubscription);
|
this.#subscriptions.push(afterDialogCloseSubscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
editCursorPosition(positionStart: number, positionEnd: number): void {
|
editCursorPosition(positionStart: number, positionEnd: number): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
state.cursorPosition.start = positionStart;
|
state.cursorPosition.start = positionStart;
|
||||||
state.cursorPosition.end = positionEnd;
|
state.cursorPosition.end = positionEnd;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
insertTitle(titleNumber: number): void {
|
insertTitle(titleNumber: number): void {
|
||||||
if (titleNumber >= 1 && titleNumber <= 3) {
|
if (titleNumber >= 1 && titleNumber <= 3) {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
@@ -223,15 +198,15 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
|
|
||||||
publication.text = textWithTags;
|
publication.text = textWithTags;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
this._updateForm();
|
this.#updateForm();
|
||||||
} else {
|
} else {
|
||||||
console.error(`Bad value for parameter of function 'insertTitle': '${titleNumber}'.`);
|
console.error(`Bad value for parameter of function 'insertTitle': '${titleNumber}'.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectAPicture(): void {
|
selectAPicture(): void {
|
||||||
const dialogRef = this.dialog.open(PictureSelectionDialog);
|
const dialogRef = this.#dialog.open(PictureSelectionDialog);
|
||||||
|
|
||||||
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
const afterDialogCloseSubscription = dialogRef.afterClosed()
|
||||||
.subscribe(newPictureId => {
|
.subscribe(newPictureId => {
|
||||||
@@ -239,11 +214,11 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
this.insertPicture(newPictureId);
|
this.insertPicture(newPictureId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.subscriptions.push(afterDialogCloseSubscription);
|
this.#subscriptions.push(afterDialogCloseSubscription);
|
||||||
}
|
}
|
||||||
|
|
||||||
insertPicture(pictureId: string): void {
|
insertPicture(pictureId: string): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
@@ -253,12 +228,12 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
|
|
||||||
publication.text = textWithTags;
|
publication.text = textWithTags;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
this._updateForm();
|
this.#updateForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
insertLink(): void {
|
insertLink(): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
@@ -269,12 +244,12 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
|
|
||||||
publication.text = textWithTags;
|
publication.text = textWithTags;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
this._updateForm();
|
this.#updateForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
private insertCodeBlock(programmingLanguage: string, codeBlock: string): void {
|
private insertCodeBlock(programmingLanguage: string, codeBlock: string): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
const publication = state.publication;
|
const publication = state.publication;
|
||||||
|
|
||||||
@@ -285,28 +260,28 @@ export class PublicationEditionService implements OnDestroy {
|
|||||||
|
|
||||||
publication.text = textWithTags;
|
publication.text = textWithTags;
|
||||||
|
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
this._updateForm();
|
this.#updateForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPreview(): void {
|
loadPreview(): void {
|
||||||
const state = this._state;
|
const state = this.#state();
|
||||||
|
|
||||||
this.isPreviewingSubject.next(true);
|
this.#isPreviewing.set(true);
|
||||||
const request: PreviewContentRequest = {
|
const request: PreviewContentRequest = {
|
||||||
text: state.publication.text
|
text: state.publication.text
|
||||||
};
|
};
|
||||||
this.publicationRestService.preview(request)
|
this.#publicationRestService.preview(request)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
state.publication.parsedText = response.text;
|
state.publication.parsedText = response.text;
|
||||||
this._save(state);
|
this.#state.set(state);
|
||||||
setTimeout(() => Prism.highlightAll(), 1000);
|
setTimeout(() => Prism.highlightAll(), 1000);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isPreviewingSubject.next(false);
|
this.#isPreviewing.set(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@for(publication of publications$ | async; track publication) {
|
@for (publication of publications(); track publication.id) {
|
||||||
<a [routerLink]="['/publications/' + publication.id]" class="publication">
|
<a [routerLink]="['/publications/' + publication.id]" class="publication">
|
||||||
<img src="/api/pictures/{{ publication.illustrationId }}"/>
|
<img src="/api/pictures/{{ publication.illustrationId }}"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
|
|||||||
@@ -1,18 +1,15 @@
|
|||||||
import { Component, Input } from "@angular/core";
|
import {Component, input} from "@angular/core";
|
||||||
import {Publication} from "../../core/rest-services/publications/model/publication";
|
import {Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import { Observable } from "rxjs";
|
|
||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from "@angular/common";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {MatTooltipModule} from "@angular/material/tooltip";
|
import {MatTooltipModule} from "@angular/material/tooltip";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-list',
|
selector: 'app-publication-list',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './publication-list.component.html',
|
templateUrl: './publication-list.component.html',
|
||||||
styleUrl: './publication-list.component.scss',
|
styleUrl: './publication-list.component.scss',
|
||||||
imports: [CommonModule, RouterModule, MatTooltipModule]
|
imports: [CommonModule, RouterModule, MatTooltipModule]
|
||||||
})
|
})
|
||||||
export class PublicationListComponent {
|
export class PublicationListComponent {
|
||||||
@Input()
|
publications = input.required<Publication[]>();
|
||||||
publications$!: Observable<Publication[]>;
|
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,6 @@ import { Router } from "@angular/router";
|
|||||||
selector: 'app-publications-search-bar',
|
selector: 'app-publications-search-bar',
|
||||||
templateUrl: './publications-search-bar.component.html',
|
templateUrl: './publications-search-bar.component.html',
|
||||||
styleUrl: './publications-search-bar.component.scss',
|
styleUrl: './publications-search-bar.component.scss',
|
||||||
standalone: true,
|
|
||||||
imports: [
|
imports: [
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatRippleModule,
|
MatRippleModule,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { RouterModule } from "@angular/router";
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-categories-menu',
|
selector: 'app-categories-menu',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './categories-menu.component.html',
|
templateUrl: './categories-menu.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="menu {{ isOpenned ? 'displayed' : '' }}">
|
<div class="menu {{ isOpened() ? 'displayed' : '' }}">
|
||||||
<h1>
|
<h1>
|
||||||
<a [routerLink]="['/home']">
|
<a [routerLink]="['/home']">
|
||||||
<img src="assets/images/codiki.png" alt="logo"/>
|
<img src="assets/images/codiki.png" alt="logo"/>
|
||||||
@@ -16,4 +16,4 @@
|
|||||||
<h2 i18n>Categories</h2>
|
<h2 i18n>Categories</h2>
|
||||||
<app-categories-menu (categoryClicked)="close()"></app-categories-menu>
|
<app-categories-menu (categoryClicked)="close()"></app-categories-menu>
|
||||||
</div>
|
</div>
|
||||||
<div class="overlay {{ isOpenned ? 'displayed' : ''}}" (click)="close()"></div>
|
<div class="overlay {{ isOpened() ? 'displayed' : ''}}" (click)="close()"></div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import {Component, signal} from '@angular/core';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
@@ -7,7 +7,6 @@ import { MatRippleModule } from '@angular/material/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-side-menu',
|
selector: 'app-side-menu',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './side-menu.component.html',
|
templateUrl: './side-menu.component.html',
|
||||||
styleUrl: './side-menu.component.scss',
|
styleUrl: './side-menu.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
@@ -19,13 +18,13 @@ import { MatRippleModule } from '@angular/material/core';
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class SideMenuComponent {
|
export class SideMenuComponent {
|
||||||
isOpenned: boolean = false;
|
isOpened = signal(false);
|
||||||
|
|
||||||
open(): void {
|
open(): void {
|
||||||
this.isOpenned = true;
|
this.isOpened.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
close(): void {
|
||||||
this.isOpenned = false;
|
this.isOpened.set(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {MatSnackBar} from '@angular/material/snack-bar';
|
import {MatSnackBar} from '@angular/material/snack-bar';
|
||||||
import {BehaviorSubject, Observable} from 'rxjs';
|
import {BehaviorSubject, Observable} from 'rxjs';
|
||||||
import {CategoryRestService} from '../../core/rest-services/category/category.rest-service';
|
import {CategoryRestService} from '../../core/rest-services/category/category.rest-service';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="cod-button {{color}}"
|
class="cod-button {{color()}}"
|
||||||
[disabled]="disabled || requestPending"
|
[disabled]="disabled() || requestPending()"
|
||||||
(click)="click.emit()"
|
(click)="click.emit()"
|
||||||
matRipple>
|
matRipple>
|
||||||
@if (requestPending) {
|
@if (requestPending()) {
|
||||||
<mat-spinner class="spinner {{color}}" [diameter]="25"></mat-spinner>
|
<mat-spinner class="spinner {{color()}}" [diameter]="25"></mat-spinner>
|
||||||
}
|
}
|
||||||
<span>
|
<span>
|
||||||
<ng-content/>
|
<ng-content/>
|
||||||
|
|||||||
@@ -1,24 +1,20 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import {Component, input, output} from "@angular/core";
|
||||||
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
|
||||||
import {MatRippleModule} from "@angular/material/core";
|
import {MatRippleModule} from "@angular/material/core";
|
||||||
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-submit-button',
|
selector: 'app-submit-button',
|
||||||
standalone: true,
|
|
||||||
templateUrl: 'submit-button.component.html',
|
templateUrl: 'submit-button.component.html',
|
||||||
styleUrl: 'submit-button.component.scss',
|
styleUrl: 'submit-button.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
MatRippleModule,
|
MatRippleModule,
|
||||||
MatProgressSpinnerModule
|
MatProgressSpinnerModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class SubmitButtonComponent {
|
export class SubmitButtonComponent {
|
||||||
@Input() requestPending: boolean = false;
|
requestPending = input.required<boolean>();
|
||||||
@Input() label: string = '';
|
label = input<string>();
|
||||||
@Input() disabled: boolean = false;
|
disabled = input<boolean>(false);
|
||||||
@Input() color?: 'secondary';
|
color = input<'secondary' | undefined>('secondary');
|
||||||
@Output() click = new EventEmitter<void>();
|
click = output<void>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
|
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
|
||||||
import {inject, Injectable} from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {catchError, filter, Observable, Subject, switchMap, take, throwError} from 'rxjs';
|
import {catchError, filter, Observable, Subject, switchMap, take, throwError} from 'rxjs';
|
||||||
import { RefreshTokenRequest } from '../rest-services/user/model/refresh-token.model';
|
|
||||||
import {UserRestService} from '../rest-services/user/user.rest-service';
|
import {UserRestService} from '../rest-services/user/user.rest-service';
|
||||||
import {AuthenticationService} from '../service/authentication.service';
|
import {AuthenticationService} from '../service/authentication.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {lastValueFrom} from 'rxjs';
|
import {lastValueFrom} from 'rxjs';
|
||||||
import {Category} from './model/category';
|
import {Category} from './model/category';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { HttpClient, HttpParams } from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import {inject, Injectable} from "@angular/core";
|
import {inject, Injectable} from "@angular/core";
|
||||||
import {Picture} from "./model/picture";
|
import {Picture} from "./model/picture";
|
||||||
import {lastValueFrom} from "rxjs";
|
import {lastValueFrom} from "rxjs";
|
||||||
|
|||||||
@@ -12,3 +12,20 @@ export interface Publication {
|
|||||||
categoryId: string;
|
categoryId: string;
|
||||||
author: Author;
|
author: Author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const DEFAULT_PUBLICATION: Publication = {
|
||||||
|
id: '',
|
||||||
|
key: '',
|
||||||
|
title: '',
|
||||||
|
text: '',
|
||||||
|
parsedText: '',
|
||||||
|
description: '',
|
||||||
|
creationDate: new Date(),
|
||||||
|
illustrationId: '',
|
||||||
|
categoryId: '',
|
||||||
|
author: {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
image: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import { last, lastValueFrom } from 'rxjs';
|
import {lastValueFrom} from 'rxjs';
|
||||||
import {Publication} from './model/publication';
|
import {Publication} from './model/publication';
|
||||||
import {PreviewContentRequest, PreviewContentResponse} from './model/preview';
|
import {PreviewContentRequest, PreviewContentResponse} from './model/preview';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {HttpClient} from "@angular/common/http";
|
import {HttpClient} from "@angular/common/http";
|
||||||
import { Injectable, inject } from "@angular/core";
|
import {inject, Injectable} from "@angular/core";
|
||||||
import {LoginRequest, LoginResponse} from "./model/login.model";
|
import {LoginRequest, LoginResponse} from "./model/login.model";
|
||||||
import {lastValueFrom} from "rxjs";
|
import {lastValueFrom} from "rxjs";
|
||||||
import {SigninRequest} from "./model/signin.model";
|
import {SigninRequest} from "./model/signin.model";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {CategoryRestService} from '../rest-services/category/category.rest-service';
|
import {CategoryRestService} from '../rest-services/category/category.rest-service';
|
||||||
import {BehaviorSubject, Observable} from 'rxjs';
|
import {BehaviorSubject, Observable} from 'rxjs';
|
||||||
import {Category} from '../rest-services/category/model/category';
|
import {Category} from '../rest-services/category/model/category';
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { Component, OnInit, inject } from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
||||||
import {AuthenticationService} from '../../core/service/authentication.service';
|
import {AuthenticationService} from '../../core/service/authentication.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-disconnection',
|
selector: 'app-disconnection',
|
||||||
standalone: true,
|
|
||||||
imports: [MatProgressSpinnerModule],
|
imports: [MatProgressSpinnerModule],
|
||||||
templateUrl: './disconnection.component.html',
|
templateUrl: './disconnection.component.html',
|
||||||
styleUrl: './disconnection.component.scss'
|
styleUrl: './disconnection.component.scss'
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<h1 i18n>Last publications</h1>
|
<h1 i18n>Last publications</h1>
|
||||||
@if ((isLoading$ | async) === true) {
|
@if ((isLoading())) {
|
||||||
<h2 i18n>Publications loading...</h2>
|
<h2 i18n>Publications loading...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner/>
|
||||||
} @else {
|
} @else {
|
||||||
@if ((publications$ | async) != []) {
|
@if (publications(); as publications) {
|
||||||
<app-publication-list [publications$]="publications$"></app-publication-list>
|
<app-publication-list [publications]="publications"/>
|
||||||
} @else {
|
} @else {
|
||||||
<h2 i18n>No any publication.</h2>
|
<h2 i18n>No any publication.</h2>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
import { Component, OnInit, inject } from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import {PublicationListComponent} from '../../components/publication-list/publication-list.component';
|
import {PublicationListComponent} from '../../components/publication-list/publication-list.component';
|
||||||
import { Publication } from '../../core/rest-services/publications/model/publication';
|
|
||||||
import {HomeService} from './home.service';
|
import {HomeService} from './home.service';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
standalone: true,
|
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
@@ -19,17 +16,11 @@ import { CommonModule } from '@angular/common';
|
|||||||
providers: [HomeService]
|
providers: [HomeService]
|
||||||
})
|
})
|
||||||
export class HomeComponent implements OnInit {
|
export class HomeComponent implements OnInit {
|
||||||
private homeService = inject(HomeService);
|
readonly #homeService = inject(HomeService);
|
||||||
|
isLoading = this.#homeService.isLoading;
|
||||||
get isLoading$(): Observable<boolean> {
|
publications = this.#homeService.publications;
|
||||||
return this.homeService.isLoading$;
|
|
||||||
}
|
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
|
||||||
return this.homeService.publications$;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.homeService.startLatestPublicationsRetrieving();
|
this.#homeService.startLatestPublicationsRetrieving();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { Injectable, inject } from "@angular/core";
|
import {inject, Injectable, Signal, signal} from "@angular/core";
|
||||||
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
||||||
import { BehaviorSubject, Observable } from "rxjs";
|
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar"
|
import {MatSnackBar} from "@angular/material/snack-bar"
|
||||||
import {Publication} from "../../core/rest-services/publications/model/publication";
|
import {Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
|
|
||||||
@@ -9,27 +8,27 @@ export class HomeService {
|
|||||||
private publicationRestService = inject(PublicationRestService);
|
private publicationRestService = inject(PublicationRestService);
|
||||||
private snackBar = inject(MatSnackBar);
|
private snackBar = inject(MatSnackBar);
|
||||||
|
|
||||||
private publicationsSubject = new BehaviorSubject<Publication[]>([]);
|
#publications = signal<Publication[]>([]);
|
||||||
private isLoadingSubject = new BehaviorSubject<boolean>(false);
|
#isLoadingSubject = signal<boolean>(false);
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
get isLoading(): Signal<boolean> {
|
||||||
return this.isLoadingSubject.asObservable();
|
return this.#isLoadingSubject.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
get publications(): Signal<Publication[]> {
|
||||||
return this.publicationsSubject.asObservable();
|
return this.#publications.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
startLatestPublicationsRetrieving(): void {
|
startLatestPublicationsRetrieving(): void {
|
||||||
this.isLoadingSubject.next(true);
|
this.#isLoadingSubject.set(true);
|
||||||
|
|
||||||
this.publicationRestService.getLatest()
|
this.publicationRestService.getLatest()
|
||||||
.then(publications => this.publicationsSubject.next(publications))
|
.then(publications => this.#publications.set(publications))
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`An error occurred while retrieving latest publications...`;
|
const errorMessage = $localize`An error occurred while retrieving latest publications...`;
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
this.snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
})
|
})
|
||||||
.finally(() => this.isLoadingSubject.next(false));
|
.finally(() => this.#isLoadingSubject.set(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
||||||
import { Subscription, debounceTime, map } from 'rxjs';
|
import {debounceTime, map, Subscription} from 'rxjs';
|
||||||
import {LoginService} from './login.service';
|
import {LoginService} from './login.service';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
@@ -10,7 +10,6 @@ import { MatRippleModule } from '@angular/material/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './login.component.html',
|
templateUrl: './login.component.html',
|
||||||
styleUrl: './login.component.scss',
|
styleUrl: './login.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {BehaviorSubject, Observable} from 'rxjs';
|
import {BehaviorSubject, Observable} from 'rxjs';
|
||||||
import {copy} from '../../core/utils/ObjectUtils';
|
import {copy} from '../../core/utils/ObjectUtils';
|
||||||
import {FormError} from '../../core/model/FormError';
|
import {FormError} from '../../core/model/FormError';
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
+
|
+
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@if ((isLoading$ | async) === true) {
|
@if (isLoading()) {
|
||||||
<h2 i18n>Publication loading...</h2>
|
<h2 i18n>Publication loading...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner></mat-spinner>
|
||||||
} @else {
|
} @else {
|
||||||
@if ((isLoaded$ | async) === true) {
|
@if (isLoaded()) {
|
||||||
<app-publication-list [publications$]="publications$"></app-publication-list>
|
<app-publication-list [publications]="publications()"></app-publication-list>
|
||||||
} @else {
|
} @else {
|
||||||
<h2 i18n>There is no any publication...</h2>
|
<h2 i18n>There is no any publication...</h2>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import {Component, inject, OnInit} from "@angular/core";
|
import {Component, inject, OnInit} from "@angular/core";
|
||||||
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
|
||||||
import {MyPublicationsService} from "./my-publications.service";
|
import {MyPublicationsService} from "./my-publications.service";
|
||||||
import { Observable } from "rxjs";
|
|
||||||
import {PublicationListComponent} from "../../components/publication-list/publication-list.component";
|
import {PublicationListComponent} from "../../components/publication-list/publication-list.component";
|
||||||
import { Publication } from "../../core/rest-services/publications/model/publication";
|
|
||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from "@angular/common";
|
||||||
import {RouterModule} from "@angular/router";
|
import {RouterModule} from "@angular/router";
|
||||||
import {MatTooltipModule} from "@angular/material/tooltip";
|
import {MatTooltipModule} from "@angular/material/tooltip";
|
||||||
@@ -12,7 +10,6 @@ import { MatRippleModule } from "@angular/material/core";
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-my-component',
|
selector: 'app-my-component',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './my-publications.component.html',
|
templateUrl: './my-publications.component.html',
|
||||||
styleUrl: './my-publications.component.scss',
|
styleUrl: './my-publications.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
@@ -28,17 +25,9 @@ import { MatRippleModule } from "@angular/material/core";
|
|||||||
export class MyPublicationsComponent implements OnInit {
|
export class MyPublicationsComponent implements OnInit {
|
||||||
private readonly myPublicationsService = inject(MyPublicationsService);
|
private readonly myPublicationsService = inject(MyPublicationsService);
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
publications = this.myPublicationsService.publications;
|
||||||
return this.myPublicationsService.publications$;
|
isLoading = this.myPublicationsService.isLoading;
|
||||||
}
|
isLoaded = this.myPublicationsService.isLoaded;
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
|
||||||
return this.myPublicationsService.isLoading$;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isLoaded$(): Observable<boolean> {
|
|
||||||
return this.myPublicationsService.isLoaded$;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.myPublicationsService.loadAuthenticatedUserPublications();
|
this.myPublicationsService.loadAuthenticatedUserPublications();
|
||||||
|
|||||||
@@ -1,57 +1,56 @@
|
|||||||
import { inject, Injectable } from "@angular/core";
|
import {inject, Injectable, Signal, signal} from "@angular/core";
|
||||||
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
||||||
import {AuthenticationService} from "../../core/service/authentication.service";
|
import {AuthenticationService} from "../../core/service/authentication.service";
|
||||||
import { BehaviorSubject, Observable } from "rxjs";
|
|
||||||
import {Publication} from "../../core/rest-services/publications/model/publication";
|
import {Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import {Router} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MyPublicationsService {
|
export class MyPublicationsService {
|
||||||
private readonly authenticationService = inject(AuthenticationService);
|
readonly #authenticationService = inject(AuthenticationService);
|
||||||
private readonly publicationRestService = inject(PublicationRestService);
|
readonly #publicationRestService = inject(PublicationRestService);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
readonly #snackBar = inject(MatSnackBar);
|
||||||
private readonly router = inject(Router);
|
readonly #router = inject(Router);
|
||||||
private publicationsSubject = new BehaviorSubject<Publication[]>([]);
|
#publications = signal<Publication[]>([]);
|
||||||
private isLoadingSubject = new BehaviorSubject<boolean>(false);
|
#isLoading = signal(false);
|
||||||
private isLoadedSubject = new BehaviorSubject<boolean>(false);
|
#isLoaded = signal(false);
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
get publications(): Signal<Publication[]> {
|
||||||
return this.publicationsSubject.asObservable();
|
return this.#publications.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
get isLoading(): Signal<boolean> {
|
||||||
return this.isLoadingSubject.asObservable();
|
return this.#isLoading.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoaded$(): Observable<boolean> {
|
get isLoaded(): Signal<boolean> {
|
||||||
return this.isLoadedSubject.asObservable();
|
return this.#isLoaded.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadAuthenticatedUserPublications(): void {
|
loadAuthenticatedUserPublications(): void {
|
||||||
const authenticatedUser = this.authenticationService.getAuthenticatedUser();
|
const authenticatedUser = this.#authenticationService.getAuthenticatedUser();
|
||||||
if (authenticatedUser) {
|
if (authenticatedUser) {
|
||||||
this.isLoadingSubject.next(true);
|
this.#isLoading.set(true);
|
||||||
this.isLoadedSubject.next(false);
|
this.#isLoaded.set(false);
|
||||||
|
|
||||||
const query = `author_id=${authenticatedUser.id}`;
|
const query = `author_id=${authenticatedUser.id}`;
|
||||||
this.publicationRestService.search(query)
|
this.#publicationRestService.search(query)
|
||||||
.then(publications => {
|
.then(publications => {
|
||||||
this.publicationsSubject.next(publications);
|
this.#publications.set(publications);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`An error occurred while retrieving your publications...`;
|
const errorMessage = $localize`An error occurred while retrieving your publications...`;
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isLoadingSubject.next(false);
|
this.#isLoading.set(false);
|
||||||
this.isLoadedSubject.next(true);
|
this.#isLoaded.set(true);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.authenticationService.unauthenticate();
|
this.#authenticationService.unauthenticate();
|
||||||
this.snackBar.open($localize`You are unauthenticated. Please, log-in first.`, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open($localize`You are unauthenticated. Please, log-in first.`, $localize`Close`, {duration: 5000});
|
||||||
this.router.navigate(['/login']);
|
this.#router.navigate(['/login']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<app-publication-edition
|
<app-publication-edition
|
||||||
title="Creation of a new publication"
|
title="Creation of a new publication"
|
||||||
[publication]="publication"
|
[publication]="publication()"
|
||||||
[isSaving$]="isSaving$"
|
[isSaving]="isSaving()"
|
||||||
(publicationSave)="onPublicationSave($event)"
|
(publicationSave)="onPublicationSave($event)"
|
||||||
i18n-title>
|
i18n-title
|
||||||
</app-publication-edition>
|
/>
|
||||||
|
|||||||
@@ -1,76 +1,53 @@
|
|||||||
import { Component, inject, OnInit } from "@angular/core";
|
import {Component, inject, OnInit, signal} from "@angular/core";
|
||||||
import {PublicationEditionComponent} from "../../components/publication-edition/publication-edition.component";
|
import {PublicationEditionComponent} from "../../components/publication-edition/publication-edition.component";
|
||||||
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
import { BehaviorSubject, Observable, Subscription } from "rxjs";
|
import {DEFAULT_PUBLICATION, Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import { Publication } from "../../core/rest-services/publications/model/publication";
|
|
||||||
import {AuthenticationService} from "../../core/service/authentication.service";
|
import {AuthenticationService} from "../../core/service/authentication.service";
|
||||||
import {Author} from "../../core/rest-services/publications/model/author";
|
import {Author} from "../../core/rest-services/publications/model/author";
|
||||||
import { CommonModule } from "@angular/common";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-creation',
|
selector: 'app-publication-creation',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './publication-creation.component.html',
|
templateUrl: './publication-creation.component.html',
|
||||||
styleUrl: './publication-creation.component.scss',
|
styleUrl: './publication-creation.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
|
||||||
PublicationEditionComponent
|
PublicationEditionComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class PublicationCreationComponent implements OnInit {
|
export class PublicationCreationComponent implements OnInit {
|
||||||
private readonly authenticationService = inject(AuthenticationService);
|
readonly #authenticationService = inject(AuthenticationService);
|
||||||
private readonly publicationRestService = inject(PublicationRestService);
|
readonly #publicationRestService = inject(PublicationRestService);
|
||||||
private readonly router = inject(Router);
|
readonly #router = inject(Router);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
readonly #snackBar = inject(MatSnackBar);
|
||||||
private isSavingSubject = new BehaviorSubject<boolean>(false);
|
isSaving = signal(false);
|
||||||
private subscriptions: Subscription[] = [];
|
publication = signal<Publication>(DEFAULT_PUBLICATION);
|
||||||
publication!: Publication;
|
|
||||||
|
|
||||||
get isSaving$(): Observable<boolean> {
|
|
||||||
return this.isSavingSubject.asObservable();
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
const authenticatedUser = this.authenticationService.getAuthenticatedUser();
|
const authenticatedUser = this.#authenticationService.getAuthenticatedUser();
|
||||||
if (authenticatedUser) {
|
if (authenticatedUser) {
|
||||||
const author: Author = {
|
const author: Author = {
|
||||||
id: authenticatedUser.id,
|
id: authenticatedUser.id,
|
||||||
name: authenticatedUser.pseudo,
|
name: authenticatedUser.pseudo,
|
||||||
image: authenticatedUser.photoId ?? ''
|
image: authenticatedUser.photoId ?? ''
|
||||||
};
|
};
|
||||||
this.publication = {
|
const newPublication: Publication = {...DEFAULT_PUBLICATION, author};
|
||||||
id: '',
|
this.publication.set(newPublication);
|
||||||
key: '',
|
|
||||||
title: '',
|
|
||||||
text: '',
|
|
||||||
parsedText: '',
|
|
||||||
description: '',
|
|
||||||
creationDate: new Date(),
|
|
||||||
illustrationId: '',
|
|
||||||
categoryId: '',
|
|
||||||
author
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.subscriptions.forEach(subscription => subscription?.unsubscribe());
|
|
||||||
}
|
|
||||||
|
|
||||||
onPublicationSave(publication: Publication): void {
|
onPublicationSave(publication: Publication): void {
|
||||||
this.isSavingSubject.next(true);
|
this.isSaving.set(true);
|
||||||
this.publicationRestService.create(publication)
|
this.#publicationRestService.create(publication)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.snackBar.open($localize`Publication created succesfully!`, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open($localize`Publication created succesfully!`, $localize`Close`, {duration: 5000});
|
||||||
this.router.navigate(['/my-publications']);
|
this.#router.navigate(['/my-publications']);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`An error occured while saving new publication.`;
|
const errorMessage = $localize`An error occured while saving new publication.`;
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
})
|
})
|
||||||
.finally(() => this.isSavingSubject.next(false));
|
.finally(() => this.isSaving.set(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
@if ((isLoading$ | async) == true) {
|
@if (isLoading()) {
|
||||||
<h2 i18n>Loading publication to edit...</h2>
|
<h2 i18n>Loading publication to edit...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner/>
|
||||||
}
|
} @else {
|
||||||
@else {
|
@if (publication(); as publication) {
|
||||||
@if (publication) {
|
|
||||||
<app-publication-edition
|
<app-publication-edition
|
||||||
title="Update publication {{ publication.title }}"
|
title="Update publication {{ publication.title }}"
|
||||||
[publication]="publication"
|
[publication]="publication"
|
||||||
[isSaving$]="isSaving$"
|
[isSaving]="isSaving()"
|
||||||
(publicationSave)="onPublicationSave($event)"
|
(publicationSave)="onPublicationSave($event)"
|
||||||
i18n-title>
|
i18n-title
|
||||||
</app-publication-edition>
|
/>
|
||||||
}
|
} @else {
|
||||||
@else {
|
|
||||||
<div class="loading-failed">
|
<div class="loading-failed">
|
||||||
<h1 i18n>Publication failed to load...</h1>
|
<h1 i18n>Publication failed to load...</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {CommonModule, Location} from '@angular/common';
|
import {CommonModule, Location} from '@angular/common';
|
||||||
import { Component, inject, OnDestroy, OnInit } from '@angular/core';
|
import {Component, effect, inject, Signal, signal} from '@angular/core';
|
||||||
import {ReactiveFormsModule} from '@angular/forms';
|
import {ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MatDialogModule} from '@angular/material/dialog';
|
import {MatDialogModule} from '@angular/material/dialog';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
@@ -9,16 +9,14 @@ import { MatSnackBar } from '@angular/material/snack-bar';
|
|||||||
import {MatTabsModule} from '@angular/material/tabs';
|
import {MatTabsModule} from '@angular/material/tabs';
|
||||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
|
|
||||||
import {PublicationEditionComponent} from '../../components/publication-edition/publication-edition.component';
|
import {PublicationEditionComponent} from '../../components/publication-edition/publication-edition.component';
|
||||||
import { SubmitButtonComponent } from '../../components/submit-button/submit-button.component';
|
|
||||||
import {Publication} from '../../core/rest-services/publications/model/publication';
|
import {Publication} from '../../core/rest-services/publications/model/publication';
|
||||||
import {PublicationRestService} from '../../core/rest-services/publications/publication.rest-service';
|
import {PublicationRestService} from '../../core/rest-services/publications/publication.rest-service';
|
||||||
import { PictureSelectionDialog } from '../../components/publication-edition/picture-selection-dialog/picture-selection-dialog.component';
|
import {toSignal} from "@angular/core/rxjs-interop";
|
||||||
|
import {map} from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-update',
|
selector: 'app-publication-update',
|
||||||
standalone: true,
|
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
@@ -27,71 +25,69 @@ import { PictureSelectionDialog } from '../../components/publication-edition/pic
|
|||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
MatTabsModule,
|
MatTabsModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
PictureSelectionDialog,
|
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
SubmitButtonComponent,
|
|
||||||
PublicationEditionComponent
|
PublicationEditionComponent
|
||||||
],
|
],
|
||||||
templateUrl: './publication-update.component.html',
|
templateUrl: './publication-update.component.html',
|
||||||
styleUrl: './publication-update.component.scss',
|
styleUrl: './publication-update.component.scss'
|
||||||
})
|
})
|
||||||
export class PublicationUpdateComponent implements OnInit, OnDestroy {
|
export class PublicationUpdateComponent {
|
||||||
private readonly publicationRestService = inject(PublicationRestService);
|
readonly #activatedRoute = inject(ActivatedRoute);
|
||||||
private readonly activatedRoute = inject(ActivatedRoute);
|
readonly #location = inject(Location);
|
||||||
private readonly location = inject(Location);
|
readonly #publicationRestService = inject(PublicationRestService);
|
||||||
private readonly router = inject(Router);
|
readonly #router = inject(Router);
|
||||||
private readonly snackBar = inject(MatSnackBar);
|
readonly #snackBar = inject(MatSnackBar);
|
||||||
private isLoadingSubject = new BehaviorSubject<boolean>(false);
|
#isLoading = signal(false);
|
||||||
private isSavingSubject = new BehaviorSubject<boolean>(false);
|
#isSavingSubject = signal(false);
|
||||||
private subscriptions: Subscription[] = [];
|
publication = signal<Publication | undefined>(undefined);
|
||||||
publication: Publication | undefined;
|
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
#publicationId$ = this.#activatedRoute.params
|
||||||
return this.isLoadingSubject.asObservable();
|
.pipe(map(queryParams => queryParams['publicationId']));
|
||||||
|
#publicationId = toSignal(this.#publicationId$, {initialValue: undefined});
|
||||||
|
|
||||||
|
get isLoading(): Signal<boolean> {
|
||||||
|
return this.#isLoading.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isSaving$(): Observable<boolean> {
|
get isSaving(): Signal<boolean> {
|
||||||
return this.isSavingSubject.asObservable();
|
return this.#isSavingSubject.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
constructor() {
|
||||||
this.isLoadingSubject.next(true);
|
effect(() => {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.#isLoading.set(true);
|
||||||
const publicationId = params.get('publicationId');
|
|
||||||
if (publicationId == undefined) {
|
const publicationId = this.#publicationId();
|
||||||
this.snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, { duration: 5000 });
|
if (publicationId) {
|
||||||
this.location.back();
|
this.#publicationRestService.getById(publicationId)
|
||||||
} else {
|
|
||||||
this.publicationRestService.getById(publicationId)
|
|
||||||
.then(publication => {
|
.then(publication => {
|
||||||
this.publication = publication;
|
this.publication.set(publication);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`A technical error occurred while loading publication data.`;
|
const errorMessage = $localize`A technical error occurred while loading publication data.`;
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
console.error(errorMessage, error)
|
console.error(errorMessage, error)
|
||||||
})
|
})
|
||||||
.finally(() => this.isLoadingSubject.next(false));
|
.finally(() => this.#isLoading.set(false));
|
||||||
|
} else {
|
||||||
|
this.#snackBar.open($localize`A technical error occurred while loading publication data.`, $localize`Close`, {duration: 5000});
|
||||||
|
this.#location.back();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.subscriptions.forEach(subscription => subscription?.unsubscribe());
|
|
||||||
}
|
|
||||||
|
|
||||||
onPublicationSave(publication: Publication): void {
|
onPublicationSave(publication: Publication): void {
|
||||||
this.isSavingSubject.next(true);
|
this.#isSavingSubject.set(true);
|
||||||
this.publicationRestService.update(publication)
|
this.#publicationRestService.update(publication)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.snackBar.open($localize`Publication updated succesfully!`, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open($localize`Publication updated succesfully!`, $localize`Close`, {duration: 5000});
|
||||||
this.router.navigate(['/home']);
|
this.#router.navigate(['/home']);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
const errorMessage = $localize`An error occured while saving publication modifications.`;
|
const errorMessage = $localize`An error occured while saving publication modifications.`;
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
})
|
})
|
||||||
.finally(() => this.isSavingSubject.next(false));
|
.finally(() => this.#isSavingSubject.set(false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
@if (isLoading) {
|
@if (isLoading()) {
|
||||||
<h2 i18n>Publication content loading...</h2>
|
<h2 i18n>Publication content loading...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner></mat-spinner>
|
||||||
} @else {
|
} @else {
|
||||||
@if (publication) {
|
@if (publication(); as publication) {
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img src="/api/pictures/{{ publication.illustrationId }}"/>
|
<img src="/api/pictures/{{ publication.illustrationId }}"/>
|
||||||
<header>
|
<header>
|
||||||
<h1>{{ publication.title }}</h1>
|
<h1>{{ publication.title }}</h1>
|
||||||
<h2>{{ publication.description }}</h2>
|
<h2>{{ publication.description }}</h2>
|
||||||
@if (isAuthorAndUserEquals) {
|
@if (isAuthorAndUserEquals()) {
|
||||||
<a [routerLink]="['edit']"
|
<a [routerLink]="['edit']"
|
||||||
class="button action"
|
class="button action"
|
||||||
matTooltip="Click to edit the publication"
|
matTooltip="Click to edit the publication"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (isAuthorAndUserEquals) {
|
@if (isAuthorAndUserEquals()) {
|
||||||
<button type="button"
|
<button type="button"
|
||||||
(click)="deletePublication()"
|
(click)="deletePublication()"
|
||||||
matTooltip="Click to delete the publication"
|
matTooltip="Click to delete the publication"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {CommonModule, Location} from '@angular/common';
|
import {CommonModule, Location} from '@angular/common';
|
||||||
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit, signal} from '@angular/core';
|
||||||
import {MatRippleModule} from '@angular/material/core';
|
import {MatRippleModule} from '@angular/material/core';
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import {MatIcon} from '@angular/material/icon';
|
import {MatIcon} from '@angular/material/icon';
|
||||||
@@ -17,7 +17,6 @@ declare let Prism: any;
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication',
|
selector: 'app-publication',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './publication.component.html',
|
templateUrl: './publication.component.html',
|
||||||
styleUrl: './publication.component.scss',
|
styleUrl: './publication.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
@@ -38,9 +37,9 @@ export class PublicationComponent implements OnInit, OnDestroy {
|
|||||||
private readonly snackBar = inject(MatSnackBar);
|
private readonly snackBar = inject(MatSnackBar);
|
||||||
private paramMapSubscription?: Subscription;
|
private paramMapSubscription?: Subscription;
|
||||||
private afterDialogCloseSubscription?: Subscription;
|
private afterDialogCloseSubscription?: Subscription;
|
||||||
isLoading: boolean = false;
|
isLoading = signal(false);
|
||||||
isAuthorAndUserEquals: boolean = false;
|
isAuthorAndUserEquals = signal(false);
|
||||||
publication?: Publication;
|
publication = signal<Publication | null>(null);
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.paramMapSubscription = this.activatedRoute
|
this.paramMapSubscription = this.activatedRoute
|
||||||
@@ -49,12 +48,12 @@ export class PublicationComponent implements OnInit, OnDestroy {
|
|||||||
const publicationId = params.get('publicationId');
|
const publicationId = params.get('publicationId');
|
||||||
|
|
||||||
if (publicationId) {
|
if (publicationId) {
|
||||||
this.isLoading = true;
|
this.isLoading.set(true);
|
||||||
|
|
||||||
this.publicationRestService.getById(publicationId)
|
this.publicationRestService.getById(publicationId)
|
||||||
.then(publication => {
|
.then(publication => {
|
||||||
this.publication = publication;
|
this.publication.set(publication);
|
||||||
this.isAuthorAndUserEquals = this.authenticationService.getAuthenticatedUser()?.id === this.publication.author.id;
|
this.isAuthorAndUserEquals.set(this.authenticationService.getAuthenticatedUser()?.id === this.publication()?.author.id);
|
||||||
setTimeout(() => Prism.highlightAll(), 100);
|
setTimeout(() => Prism.highlightAll(), 100);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@@ -63,7 +62,7 @@ export class PublicationComponent implements OnInit, OnDestroy {
|
|||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isLoading = false;
|
this.isLoading.set(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -87,8 +86,9 @@ export class PublicationComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.afterDialogCloseSubscription = dialogRef.afterClosed()
|
this.afterDialogCloseSubscription = dialogRef.afterClosed()
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
if (response && this.publication?.id) {
|
const publication = this.publication();
|
||||||
this.publicationRestService.delete(this.publication.id);
|
if (response && publication?.id) {
|
||||||
|
this.publicationRestService.delete(publication.id);
|
||||||
this.snackBar.open($localize`Publication deleted`, $localize`Close`, {duration: 5000});
|
this.snackBar.open($localize`Publication deleted`, $localize`Close`, {duration: 5000});
|
||||||
this.location.back();
|
this.location.back();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<h1 i18n>Search results</h1>
|
<h1 i18n>Search results</h1>
|
||||||
@if((isLoading$ | async) === true) {
|
@if (isLoading()) {
|
||||||
<h2 i18n>Search in progress...</h2>
|
<h2 i18n>Search in progress...</h2>
|
||||||
<mat-spinner></mat-spinner>
|
<mat-spinner/>
|
||||||
} @else if((isLoaded$ | async) === true) {
|
} @else if (isLoaded()) {
|
||||||
@if((publications$ | async)?.length) {
|
@if (publications().length) {
|
||||||
<app-publication-list [publications$]="publications$"></app-publication-list>
|
<app-publication-list [publications]="publications()"/>
|
||||||
} @else {
|
} @else {
|
||||||
<span i18n>No any result.</span>
|
<span i18n>No any result.</span>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,30 @@
|
|||||||
import {CommonModule} from "@angular/common";
|
import {CommonModule} from "@angular/common";
|
||||||
import { Component, inject, OnDestroy, OnInit } from "@angular/core";
|
import {Component, effect, inject} from "@angular/core";
|
||||||
import {MatProgressSpinner} from "@angular/material/progress-spinner";
|
import {MatProgressSpinner} from "@angular/material/progress-spinner";
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import {ActivatedRoute} from "@angular/router";
|
||||||
import { Observable, Subscription } from "rxjs";
|
|
||||||
import {PublicationListComponent} from "../../components/publication-list/publication-list.component";
|
import {PublicationListComponent} from "../../components/publication-list/publication-list.component";
|
||||||
import { Publication } from "../../core/rest-services/publications/model/publication";
|
|
||||||
import {SearchPublicationsService} from "./search-publications.service";
|
import {SearchPublicationsService} from "./search-publications.service";
|
||||||
|
import {toSignal} from "@angular/core/rxjs-interop";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-search-publications',
|
selector: 'app-search-publications',
|
||||||
templateUrl: './search-publications.component.html',
|
templateUrl: './search-publications.component.html',
|
||||||
styleUrl: './search-publications.component.scss',
|
styleUrl: './search-publications.component.scss',
|
||||||
standalone: true,
|
|
||||||
imports: [CommonModule, MatProgressSpinner, PublicationListComponent],
|
imports: [CommonModule, MatProgressSpinner, PublicationListComponent],
|
||||||
providers: [SearchPublicationsService]
|
providers: [SearchPublicationsService]
|
||||||
})
|
})
|
||||||
export class SearchPublicationsComponent implements OnInit, OnDestroy {
|
export class SearchPublicationsComponent {
|
||||||
private searchPublicationsService = inject(SearchPublicationsService);
|
private searchPublicationsService = inject(SearchPublicationsService);
|
||||||
private activatedRoute = inject(ActivatedRoute);
|
private activatedRoute = inject(ActivatedRoute);
|
||||||
private queryParamsSubscription?: Subscription;
|
publications = this.searchPublicationsService.publications;
|
||||||
|
isLoading = this.searchPublicationsService.isLoading;
|
||||||
|
isLoaded = this.searchPublicationsService.isLoaded;
|
||||||
|
|
||||||
ngOnInit(): void {
|
constructor() {
|
||||||
this.queryParamsSubscription = this.activatedRoute.queryParamMap
|
const queryParams = toSignal(this.activatedRoute.queryParamMap);
|
||||||
.subscribe(params => {
|
effect(() => {
|
||||||
|
let params = queryParams();
|
||||||
|
if (params) {
|
||||||
const categoryId = params.get('category-id');
|
const categoryId = params.get('category-id');
|
||||||
if (categoryId) {
|
if (categoryId) {
|
||||||
this.searchPublicationsService.loadPublications(`category_id=${categoryId}`);
|
this.searchPublicationsService.loadPublications(`category_id=${categoryId}`);
|
||||||
@@ -31,22 +33,7 @@ export class SearchPublicationsComponent implements OnInit, OnDestroy {
|
|||||||
if (query) {
|
if (query) {
|
||||||
this.searchPublicationsService.loadPublications(query);
|
this.searchPublicationsService.loadPublications(query);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
this.queryParamsSubscription?.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
|
||||||
return this.searchPublicationsService.publications$;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
|
||||||
return this.searchPublicationsService.isLoading$;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isLoaded$(): Observable<boolean> {
|
|
||||||
return this.searchPublicationsService.isLoaded$;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,49 +1,47 @@
|
|||||||
import { inject, Injectable } from "@angular/core";
|
import {inject, Injectable, Signal, signal} from "@angular/core";
|
||||||
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
import {PublicationRestService} from "../../core/rest-services/publications/publication.rest-service";
|
||||||
import { BehaviorSubject, Observable } from "rxjs";
|
|
||||||
import {Publication} from "../../core/rest-services/publications/model/publication";
|
import {Publication} from "../../core/rest-services/publications/model/publication";
|
||||||
import {MatSnackBar} from "@angular/material/snack-bar";
|
import {MatSnackBar} from "@angular/material/snack-bar";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SearchPublicationsService {
|
export class SearchPublicationsService {
|
||||||
private publicationRestService = inject(PublicationRestService);
|
#snackBar = inject(MatSnackBar);
|
||||||
private publicationsSubject = new BehaviorSubject<Publication[]>([]);
|
#publicationRestService = inject(PublicationRestService);
|
||||||
private isLoadingSubject = new BehaviorSubject<boolean>(false);
|
#publications = signal<Publication[]>([]);
|
||||||
private isLoadedSubject = new BehaviorSubject<boolean>(false);
|
#isLoading = signal(false);
|
||||||
private snackBar = inject(MatSnackBar);
|
#isLoaded = signal(false);
|
||||||
|
|
||||||
get publications$(): Observable<Publication[]> {
|
get publications(): Signal<Publication[]> {
|
||||||
return this.publicationsSubject.asObservable();
|
return this.#publications.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoading$(): Observable<boolean> {
|
get isLoading(): Signal<boolean> {
|
||||||
return this.isLoadingSubject.asObservable();
|
return this.#isLoading.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
get isLoaded$(): Observable<boolean> {
|
get isLoaded(): Signal<boolean> {
|
||||||
return this.isLoadedSubject.asObservable();
|
return this.#isLoaded.asReadonly();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPublications(searchCriteria: string): void {
|
loadPublications(searchCriteria: string): void {
|
||||||
this.isLoadingSubject.next(true);
|
this.#isLoading.set(true);
|
||||||
this.isLoadedSubject.next(false);
|
this.#isLoaded.set(false);
|
||||||
this.publicationsSubject.next([]);
|
this.#publications.set([]);
|
||||||
|
|
||||||
this.publicationRestService.search(searchCriteria)
|
this.#publicationRestService.search(searchCriteria)
|
||||||
.then(publications => {
|
.then(publications => {
|
||||||
this.publicationsSubject.next(publications);
|
this.#publications.set(publications);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error.status !== 404) {
|
if (error.status !== 404) {
|
||||||
const errorMessage = $localize`An error occured while retrieving publications.`;
|
const errorMessage = $localize`An error occured while retrieving publications.`;
|
||||||
console.error(errorMessage, error);
|
console.error(errorMessage, error);
|
||||||
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
|
this.#snackBar.open(errorMessage, $localize`Close`, {duration: 5000});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.isLoadingSubject.next(false);
|
this.#isLoading.set(false);
|
||||||
this.isLoadedSubject.next(true);
|
this.#isLoaded.set(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { Component, OnDestroy, OnInit, inject } from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import {MatIconModule} from '@angular/material/icon';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
import { Subscription, debounceTime, distinctUntilChanged, map } from 'rxjs';
|
import {debounceTime, distinctUntilChanged, map, Subscription} from 'rxjs';
|
||||||
import {SigninService} from './signin.service';
|
import {SigninService} from './signin.service';
|
||||||
import {LoginService} from '../login/login.service';
|
import {LoginService} from '../login/login.service';
|
||||||
import {FormError} from '../../core/model/FormError';
|
import {FormError} from '../../core/model/FormError';
|
||||||
@@ -11,7 +11,6 @@ import { MatRippleModule } from '@angular/material/core';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-signin',
|
selector: 'app-signin',
|
||||||
standalone: true,
|
|
||||||
templateUrl: './signin.component.html',
|
templateUrl: './signin.component.html',
|
||||||
styleUrl: './signin.component.scss',
|
styleUrl: './signin.component.scss',
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
import {inject, Injectable} from '@angular/core';
|
||||||
import {SigninRequest} from '../../core/rest-services/user/model/signin.model';
|
import {SigninRequest} from '../../core/rest-services/user/model/signin.model';
|
||||||
import {FormError} from '../../core/model/FormError';
|
import {FormError} from '../../core/model/FormError';
|
||||||
import {BehaviorSubject, Observable} from 'rxjs';
|
import {BehaviorSubject, Observable} from 'rxjs';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"translations": {
|
"translations": {
|
||||||
"3603720768157919481": "Non",
|
"3603720768157919481": "Non",
|
||||||
"4861926948802653243": "Oui",
|
"4861926948802653243": "Oui",
|
||||||
"6130235414952256120": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2024 Tous droits réservés - 2.1 {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
|
"9101236728284262962": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2026 Tous droits réservés - 2.2 {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
|
||||||
"9214089025589249203": "Les indicateurs de vie du site seront disponibles ultérieurement...",
|
"9214089025589249203": "Les indicateurs de vie du site seront disponibles ultérieurement...",
|
||||||
"1711651175531679766": "La documentation sera disponible ultérieurement...",
|
"1711651175531679766": "La documentation sera disponible ultérieurement...",
|
||||||
"6299155290121808295": "Développements realisés par",
|
"6299155290121808295": "Développements realisés par",
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
"4111988153902305972": "Choisir cette illustation",
|
"4111988153902305972": "Choisir cette illustation",
|
||||||
"4491342806775118195": "Il n'y a aucune image.",
|
"4491342806775118195": "Il n'y a aucune image.",
|
||||||
"5036131155743433968": "{$START_TAG_MAT_ICON}upload_file{$CLOSE_TAG_MAT_ICON} Ajouter une nouvelle 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.",
|
"2175978098886350409": "Une erreur est survenue lors du chargements de vos images.",
|
||||||
"6198966268398913224": "Une erreur technique est survenue lors de l'ajout de votre image.",
|
"2334964899406832924": "Une erreur technique est survenue lors de l'ajout de votre image.",
|
||||||
"3603937053948195893": "Édition",
|
"3603937053948195893": "Édition",
|
||||||
"5701618810648052610": "Titre",
|
"5701618810648052610": "Titre",
|
||||||
"4902817035128594900": "Description",
|
"4902817035128594900": "Description",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"translations": {
|
"translations": {
|
||||||
"3603720768157919481": " No ",
|
"3603720768157919481": " No ",
|
||||||
"4861926948802653243": " Yes ",
|
"4861926948802653243": " Yes ",
|
||||||
"6130235414952256120": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2024 All rights reserved - 2.1 {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
|
"9101236728284262962": "{$START_TAG_SPAN}©{$CLOSE_TAG_SPAN} 2016 - 2026 All rights reserved - 2.2 {$START_LINK}{$START_TAG_MAT_ICON}favorite{$CLOSE_TAG_MAT_ICON}{$CLOSE_LINK}",
|
||||||
"9214089025589249203": "Health checking will be available in future...",
|
"9214089025589249203": "Health checking will be available in future...",
|
||||||
"1711651175531679766": "Documentation will be available in future...",
|
"1711651175531679766": "Documentation will be available in future...",
|
||||||
"6299155290121808295": "Development realised by",
|
"6299155290121808295": "Development realised by",
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
"4111988153902305972": "Choose this illustration",
|
"4111988153902305972": "Choose this illustration",
|
||||||
"4491342806775118195": "There is no any picture.",
|
"4491342806775118195": "There is no any picture.",
|
||||||
"5036131155743433968": "{$START_TAG_MAT_ICON}upload_file{$CLOSE_TAG_MAT_ICON} Add new picture ",
|
"5036131155743433968": "{$START_TAG_MAT_ICON}upload_file{$CLOSE_TAG_MAT_ICON} Add new picture ",
|
||||||
"6852365376059142995": "An error occured while loading pictures.",
|
"2175978098886350409": "An error occurred while loading pictures.",
|
||||||
"6198966268398913224": "A technical error occured while uploading your picture.",
|
"2334964899406832924": "A technical error occurred while uploading your picture.",
|
||||||
"3603937053948195893": "Edition",
|
"3603937053948195893": "Edition",
|
||||||
"5701618810648052610": "Title",
|
"5701618810648052610": "Title",
|
||||||
"4902817035128594900": "Description",
|
"4902817035128594900": "Description",
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
@use './design_system/index.scss';
|
@use './design_system/index.scss';
|
||||||
|
|
||||||
html, body { height: 100%; }
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: Roboto, "Helvetica Neue", sans-serif;
|
font-family: Roboto, "Helvetica Neue", sans-serif;
|
||||||
|
|||||||
@@ -13,15 +13,11 @@
|
|||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "bundler",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ES2022",
|
"module": "ES2022",
|
||||||
"useDefineForClassFields": false,
|
"useDefineForClassFields": false
|
||||||
"lib": [
|
|
||||||
"ES2022",
|
|
||||||
"dom"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"enableI18nLegacyMessageIdFormat": false,
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
|||||||
Reference in New Issue
Block a user