diff --git a/.forgejo/workflows/ci-settings.xml b/.forgejo/workflows/ci-settings.xml deleted file mode 100644 index c206c4b..0000000 --- a/.forgejo/workflows/ci-settings.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - nexus - * - http://repo.oguerreiro.com/repository/maven-public/ - - - - - - nexus - default - default#123! - - - maven-releases - default - default#123! - - - maven-snapshots - default - default#123! - - - diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 7b8d83e..06f5207 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - name: Install system dependencies run: | apt-get update - apt-get install -y nodejs npm openjdk-17-jdk maven git jq + apt-get install -y nodejs npm openjdk-17-jdk maven git export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac)))) echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV @@ -22,7 +22,6 @@ jobs: run: | java -version mvn -v - mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout node -v npm -v @@ -53,106 +52,6 @@ jobs: git commit -am "Release ${{ steps.version.outputs.release_version }}" git push - # Create the release notes (closed issues) - # Must be here, before the new tag, to get closed issued from the LAST TAG to NOW - - name: Generate release notes from closed issues - id: generate_notes - run: | - REPO_OWNER="root" - REPO_NAME="resilient" - TOKEN="${{ secrets.FORGEJO_TOKEN }}" - VERSION="${{ steps.version.outputs.release_version }}" - API_BASE="https://git.oguerreiro.com/api/v1" - - # Step 1. Get the latest tag - echo "Step 1 : Fetching latest release tag..." - LATEST_TAG=$(curl -H "Authorization: token $TOKEN" \ - "$API_BASE/repos/$REPO_OWNER/$REPO_NAME/tags" \ - | jq -r '.[0].name') - - if [[ -z "$LATEST_TAG" || "$LATEST_TAG" == "null" ]]; then - # Doesn't have tag. Its the first release - echo "No previous tags found. Assuming first release." - CLOSED_ISSUES="" - else - # Tag found - echo "Latest tag is: $LATEST_TAG" - - # Step 2: Get the tag ref object - echo "Step 2 : Fetch tag ref object from tag = $LATEST_TAG" - TAG_REF=$(curl -H "Authorization: token $TOKEN" \ - "$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/refs/tags/$LATEST_TAG") - echo "... TAG_REF is: $TAG_REF" - - # Extract the first .object.sha (if it's an array) or directly if it's an object - if echo "$TAG_REF" | jq -e 'type == "array"' >/dev/null; then - echo "... is an array" - TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.[0].object.sha') - TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.[0].object.type') - else - echo "... is an object" - TAG_OBJECT_SHA=$(echo "$TAG_REF" | jq -r '.object.sha') - TAG_OBJECT_TYPE=$(echo "$TAG_REF" | jq -r '.object.type') - fi - - echo "... TAG SHA is (1): $TAG_OBJECT_SHA" - echo "... TAG TYPE is (1): $TAG_OBJECT_TYPE" - - # Resolve annotated tag to commit SHA - while [ "$TAG_OBJECT_TYPE" != "commit" ]; do - echo "..." - echo "... TAG OBJECT is not of type commit. Try : $API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/$TAG_OBJECT_TYPE/$TAG_OBJECT_SHA" - TAG_OBJECT=$(curl -H "Authorization: token $TOKEN" \ - "$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/tags/$TAG_OBJECT_SHA") - - if echo "$TAG_OBJECT" | jq -e 'type == "array"' >/dev/null; then - echo "... ... is an array" - TAG_OBJECT_SHA=$(echo "$v" | jq -r '.[0].object.sha') - TAG_OBJECT_TYPE=$(echo "$TAG_OBJECT" | jq -r '.[0].object.type') - else - echo "... ... is an object" - TAG_OBJECT_SHA=$(echo "$TAG_OBJECT" | jq -r '.object.sha') - TAG_OBJECT_TYPE=$(echo "$TAG_OBJECT" | jq -r '.object.type') - fi - - echo "... TAG_OBJECT_SHA is (2): $TAG_OBJECT_SHA" - echo "... TAG_OBJECT_TYPE is (2): $TAG_OBJECT_TYPE" - done - - echo "... commit found with SHA $TAG_OBJECT_SHA" - COMMIT_SHA=$TAG_OBJECT_SHA - - # Step 3: Get the commit date - echo "Step 3 : Get the commit date from commit = $COMMIT_SHA" - COMMIT_DATE=$(curl -H "Authorization: token $TOKEN" \ - "$API_BASE/repos/$REPO_OWNER/$REPO_NAME/git/commits/$COMMIT_SHA" \ - | jq -r '.commit.committer.date') - echo "... Fetching closed issues since $COMMIT_DATE..." - - CLOSED_ISSUES_JSON=$(curl -H "Authorization: token $TOKEN" \ - "$API_BASE/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$COMMIT_DATE") - - if [[ -z "$CLOSED_ISSUES_JSON" ]]; then - echo "Warning: No closed issues or invalid response." - CLOSED_ISSUES="" - else - CLOSED_ISSUES=$(echo "$CLOSED_ISSUES_JSON" | jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"') - fi - fi - - # Build release notes markdown - { - echo "## Release v$VERSION" - echo - if [[ -n "$CLOSED_ISSUES" ]]; then - echo "### Closed Issues" - echo "$CLOSED_ISSUES" - else - echo "No issues closed since last release." - fi - } > release-notes.md - cat release-notes.md - - name: Tag release run: | git tag -a v${{ steps.version.outputs.release_version }} -m "Release ${{ steps.version.outputs.release_version }}" @@ -162,42 +61,45 @@ jobs: # Install @Angular dependencies - name: Install frontend dependencies - if: false # DISABLED for testing. To check if backend build is also doing frontend. run: | cd src/main/webapp npm ci + # Setup node_modules cache, for better performance + - name: Cache node_modules + uses: actions/cache@v3 + with: + path: | + **/node_modules + key: node-modules-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + node-modules- + # Build the frontend - name: Build frontend - if: false # DISABLED for testing. To check if backend build is also doing frontend. run: | cd src/main/webapp npm run build - + + # Setup Maven cache, for better performance + - name: Cache Maven dependencies + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-${{ runner.os }}- + # Build the backend (JAR). NOTE: the -Dmaven.download.parallel=false will force MAVEN to have a single connection for downloads, without this I can get "Connection reset" - name: Build backend (Spring Boot) run: | - echo "DEBUG Outputs ************************* " - echo "Container hostname: $(hostname)" - echo "Runner working dir: $PWD" - echo "Runner user: $(whoami)" - echo "Listing contents of ~/.m2/repository:" - ls -lhR ~/.m2/repository | head -n 100 || echo "No .m2/repository found" - echo "Disk usage:" - du -sh ~/.m2/repository || echo "No .m2 directory found" - echo " " - echo "BUILD Outputs ************************* " - mvn clean package -Pprod -DskipTests -Dmaven.download.parallel=false -Dmaven.repo.local=/root/.m2/repository -s .forgejo/workflows/ci-settings.xml - container: - image: maven:3.9-eclipse-temurin-17 - volumes: - - docker-forgejo_maven-cache:/root/.m2 - + mvn clean package -Pprod -DskipTests -Dmaven.download.parallel=false + # Log output - name: List output files run: | ls -lh target/*.jar || true - + # save artifacts - name: Upload backend JAR uses: actions/upload-artifact@v3 @@ -205,38 +107,6 @@ jobs: name: app-backend path: target/resilient*.jar - # Create the release - # NOTE: added system dependency install "jq" - - name: Create release and upload JAR - run: | - VERSION=${{ steps.version.outputs.release_version }} - API="https://git.oguerreiro.com/api/v1" - REPO="root/resilient" - - # Create release - RESPONSE=$(curl -X POST "$API/repos/$REPO/releases" \ - -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ - -H "Content-Type: application/json" \ - -d "{ - \"tag_name\": \"v$VERSION\", - \"target_commitish\": \"master\", - \"name\": \"Release v$VERSION\", - \"body\": $(jq -Rs < release-notes.md) - }") - - RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') - echo "Created release ID: $RELEASE_ID" - - # Upload artifact - # NOTE: For safety, the artifact to upload is expected to be the EXACT $VERSION of this branch. If not, something is wrong. - JAR_FILE=$(ls target/resilient-$VERSION.jar | head -n 1) - echo "Attaching file : $JAR_FILE" - curl -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=resilient-$VERSION.jar" \ - -H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \ - -H "Content-Type: application/java-archive" \ - --data-binary @"$JAR_FILE" - - # ################################################################## # ## THIS IS A RELEASE - Change master version to next SNAPSHOT ## # ## #4. Checkout master ## diff --git a/pom.xml b/pom.xml index 57fcf51..7eac9c4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.oguerreiro.resilient resilient - 1.0.8-SNAPSHOT + 1.0.4 jar Resilient Description for Resilient diff --git a/src/main/java/com/oguerreiro/resilient/repository/OrganizationRepository.java b/src/main/java/com/oguerreiro/resilient/repository/OrganizationRepository.java index 5aef3a7..8ba65ab 100644 --- a/src/main/java/com/oguerreiro/resilient/repository/OrganizationRepository.java +++ b/src/main/java/com/oguerreiro/resilient/repository/OrganizationRepository.java @@ -5,7 +5,6 @@ import java.util.Optional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.EntityGraph; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @@ -39,13 +38,11 @@ public interface OrganizationRepository extends ResilientJpaRepository findOneByUser(User user); @Query("select organization from Organization organization where organization.outputInventory = true and organization.organizationType.nature = com.oguerreiro.resilient.domain.enumeration.OrganizationNature.ORGANIZATION order by (CASE WHEN organization.parent IS NULL THEN 0 ELSE 1 END), (CASE WHEN organization.sort IS NULL THEN 1 ELSE 0 END), organization.sort asc") List findAllOrganizationForOutput(); - @EntityGraph(attributePaths = "parent") Optional findOneByCode(String code); @Query(""" diff --git a/src/main/java/com/oguerreiro/resilient/security/saml2/Saml2AuthenticationHandler.java b/src/main/java/com/oguerreiro/resilient/security/saml2/Saml2AuthenticationHandler.java index 1da77e8..f072998 100644 --- a/src/main/java/com/oguerreiro/resilient/security/saml2/Saml2AuthenticationHandler.java +++ b/src/main/java/com/oguerreiro/resilient/security/saml2/Saml2AuthenticationHandler.java @@ -155,9 +155,8 @@ public class Saml2AuthenticationHandler implements AuthenticationSuccessHandler, } // Create a ResilientUserDetails and replace Principal - Organization parentOrganization = userOrganization.getParent(); ResilientUserDetails userdetails = new ResilientUserDetails(username, "MOCK-PWD", authorities, securityGroup, - userOrganization.getParent(), "pt-PT"); + userOrganization, "pt-PT"); Saml2Authentication newAuthentication = new Saml2Authentication(userdetails, samlXMLResponse, userdetails.getAuthorities()); diff --git a/src/main/webapp/app/layouts/main/banner/banner.component.html b/src/main/webapp/app/layouts/main/banner/banner.component.html index 2e52f7e..49ea24c 100644 --- a/src/main/webapp/app/layouts/main/banner/banner.component.html +++ b/src/main/webapp/app/layouts/main/banner/banner.component.html @@ -1,10 +1,6 @@
-
- Route Zero - - - InNOVA NOVA Information System on Environment and Sustainability - +
+ Route Zero
\ No newline at end of file diff --git a/src/main/webapp/app/layouts/navbar/navbar.component.html b/src/main/webapp/app/layouts/navbar/navbar.component.html index e4c2b7b..5f93d7b 100644 --- a/src/main/webapp/app/layouts/navbar/navbar.component.html +++ b/src/main/webapp/app/layouts/navbar/navbar.component.html @@ -148,7 +148,7 @@ (click)="collapseNavbar()" > - Organização + Organization
  • @@ -160,7 +160,7 @@ (click)="collapseNavbar()" > - Período + Period
  • @@ -175,7 +175,7 @@ (click)="collapseNavbar()" > - Tipos de Unidade + Unit Type
  • @@ -187,7 +187,7 @@ (click)="collapseNavbar()" > - Unidade + Unit
  • @@ -199,7 +199,7 @@ (click)="collapseNavbar()" > - conversor de Unidades + Unit Converter
  • @@ -214,7 +214,7 @@ (click)="collapseNavbar()" > - Âmbito + Variable Scope
  • @@ -226,7 +226,7 @@ (click)="collapseNavbar()" > - Categoria + Variable Category
  • @@ -238,7 +238,7 @@ (click)="collapseNavbar()" > - Variavel + Variable
  • @@ -261,7 +261,7 @@ (click)="collapseNavbar()" > - Ficheiros de Dados + Input Data Upload
  • - Dados de Inventário + Input Data
  • - Tipo de Organização + Organization Type
  • @@ -343,7 +343,7 @@ (click)="collapseNavbar()" > - Propriedades Metadata + Metadata Property
  • @@ -367,7 +367,7 @@ (click)="collapseNavbar()" > - Tipo de Classe + Variable Class Type
  • @@ -379,7 +379,7 @@ (click)="collapseNavbar()" > - Fatores de Emissão + Emission Factors
  • @@ -391,7 +391,7 @@ (click)="collapseNavbar()" > - Dashboard-Componente + Dashboard Comp.
  • @@ -403,7 +403,7 @@ (click)="collapseNavbar()" > - Documentos + Document
  • @@ -415,7 +415,7 @@ (click)="collapseNavbar()" > - Conteúdos + Content Page
  • diff --git a/src/main/webapp/content/images/Graphic1_2024.png b/src/main/webapp/content/images/Graphic1_2024.png deleted file mode 100644 index 6cea7ab..0000000 Binary files a/src/main/webapp/content/images/Graphic1_2024.png and /dev/null differ diff --git a/src/main/webapp/content/images/Graphic2_2024.png b/src/main/webapp/content/images/Graphic2_2024.png deleted file mode 100644 index 598ec4c..0000000 Binary files a/src/main/webapp/content/images/Graphic2_2024.png and /dev/null differ diff --git a/src/main/webapp/content/images/Graphic3_2024.png b/src/main/webapp/content/images/Graphic3_2024.png deleted file mode 100644 index 9fbec69..0000000 Binary files a/src/main/webapp/content/images/Graphic3_2024.png and /dev/null differ diff --git a/src/main/webapp/content/images/Graphic4_2024.png b/src/main/webapp/content/images/Graphic4_2024.png deleted file mode 100644 index 4b6920e..0000000 Binary files a/src/main/webapp/content/images/Graphic4_2024.png and /dev/null differ diff --git a/src/main/webapp/content/images/Graphic_gases_2024.png b/src/main/webapp/content/images/Graphic_gases_2024.png deleted file mode 100644 index cd7c99c..0000000 Binary files a/src/main/webapp/content/images/Graphic_gases_2024.png and /dev/null differ diff --git a/src/main/webapp/content/images/Graphic_missoes_globais_2024.png b/src/main/webapp/content/images/Graphic_missoes_globais_2024.png deleted file mode 100644 index 4899991..0000000 Binary files a/src/main/webapp/content/images/Graphic_missoes_globais_2024.png and /dev/null differ