From 11b2aa8267a078ed73a092c088ddb8ae8a30d94d Mon Sep 17 00:00:00 2001 From: holomekc <30546982+holomekc@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:34:08 +0100 Subject: [PATCH] Ok this is a big commit: - message service uses bootstrap toasts now. This allows to show stacked messages - use gradle to install node and npm via plugin so that we can use the versions needed for this project locally and in GitHub -add some run configurations for intellij -add more file support features: upload, download, delete, copy bodyFileName. Also include a modal to adjust the filename, which can also include folders. -add new view for files -add paperclip icon for mappings, which contain files -fix some layout issues. -add websocket for file changes, so that new page can be updated accordingly. -adjust GitHub workflows due to node changes. - add indicators - move broadcasts from endpoint to actual location where changes are happening. - update version --- .github/release-drafter.yml | 2 - .github/workflows/build-and-test.yml | 72 +++-- .github/workflows/create-release.yml | 4 - .gitignore | 5 +- .run/Build WireMock.run.xml | 2 +- .run/Run WireMock.run.xml | 8 + .run/WebApp lint --fix.run.xml | 13 + .run/WebApp lint.run.xml | 13 + .run/WebApp prettier.run.xml | 13 + .run/WebApp start.run.xml | 13 + RELEASE-NOTES.md | 10 +- build.gradle | 36 +-- .../wiremock/core/WireMockApp.java | 289 ++++++++---------- .../wiremock/jetty/websockets/Message.java | 1 + .../store/files/FileSourceBlobStore.java | 27 +- webapp/wiremock/src/app/app-routing.module.ts | 8 +- webapp/wiremock/src/app/app.module.ts | 12 + .../curl-preview/curl-preview.component.ts | 10 +- .../app/components/files/files.component.html | 43 +++ .../app/components/files/files.component.scss | 3 + .../components/files/files.component.spec.ts | 23 ++ .../app/components/files/files.component.ts | 169 ++++++++++ .../app/components/home/home.component.html | 3 + .../src/app/components/home/home.component.ts | 25 +- .../components/layout/layout.component.html | 7 +- .../app/components/layout/layout.component.ts | 8 +- .../list-view/list-view.component.html | 20 +- .../list-view/list-view.component.scss | 13 + .../mappings/mapping-helper.service.ts | 16 + .../mappings/mappings.component.html | 33 ++ .../components/mappings/mappings.component.ts | 161 +++++----- .../components/matched/matched.component.ts | 15 +- .../components/message/message.component.html | 16 +- .../components/message/message.component.scss | 9 + .../components/message/message.component.ts | 27 +- .../app/components/message/message.service.ts | 13 +- .../separated/separated.component.html | 90 +++--- .../separated/separated.component.scss | 10 + .../separated/separated.component.ts | 21 +- .../app/components/state/state.component.ts | 11 +- .../tree-view/tree-view.component.html | 24 +- .../tree-view/tree-view.component.scss | 13 + .../unmatched/unmatched.component.ts | 41 +-- .../dialog-recording.component.html | 2 +- .../dialog-recording.component.ts | 3 +- .../file-name/file-name.component.html | 17 ++ .../file-name/file-name.component.scss | 0 .../file-name/file-name.component.spec.ts | 23 ++ .../dialogs/file-name/file-name.component.ts | 16 + webapp/wiremock/src/app/model/tree/folder.ts | 17 +- webapp/wiremock/src/app/model/tree/root.ts | 15 +- .../src/app/model/wiremock/file-list.ts | 10 + .../wiremock/src/app/model/wiremock/file.ts | 71 +++++ .../wiremock/src/app/model/wiremock/item.ts | 6 + .../src/app/model/wiremock/logged-request.ts | 12 + .../src/app/model/wiremock/scenario.ts | 12 + .../src/app/model/wiremock/serve-event.ts | 12 + .../src/app/model/wiremock/stub-mapping.ts | 12 + .../wiremock/src/app/services/util.service.ts | 73 ++++- .../src/app/services/wiremock.service.ts | 53 +++- .../wiremock/src/environments/environment.ts | 2 +- webapp/wiremock/src/proxy.conf.js | 3 +- webapp/wiremock/src/styles.scss | 5 + 63 files changed, 1248 insertions(+), 468 deletions(-) delete mode 100644 .github/release-drafter.yml create mode 100644 .run/Run WireMock.run.xml create mode 100644 .run/WebApp lint --fix.run.xml create mode 100644 .run/WebApp lint.run.xml create mode 100644 .run/WebApp prettier.run.xml create mode 100644 .run/WebApp start.run.xml create mode 100644 webapp/wiremock/src/app/components/files/files.component.html create mode 100644 webapp/wiremock/src/app/components/files/files.component.scss create mode 100644 webapp/wiremock/src/app/components/files/files.component.spec.ts create mode 100644 webapp/wiremock/src/app/components/files/files.component.ts create mode 100644 webapp/wiremock/src/app/dialogs/file-name/file-name.component.html create mode 100644 webapp/wiremock/src/app/dialogs/file-name/file-name.component.scss create mode 100644 webapp/wiremock/src/app/dialogs/file-name/file-name.component.spec.ts create mode 100644 webapp/wiremock/src/app/dialogs/file-name/file-name.component.ts create mode 100644 webapp/wiremock/src/app/model/wiremock/file-list.ts create mode 100644 webapp/wiremock/src/app/model/wiremock/file.ts diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 3ac09a2aca..0000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,2 +0,0 @@ -# Use https://github.com/wiremock/.github/blob/main/.github/release_drafter.yml -_extends: .github diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 10ec7e3c5b..67005b2651 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,51 +14,47 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - jdk: [11, 17] + os: [ ubuntu-latest, macos-latest, windows-latest ] + jdk: [ 11, 17 ] runs-on: ${{ matrix.os }} env: - JDK_VERSION: ${{ matrix.jdk }} + JDK_VERSION: ${{ matrix.jdk }} steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.jdk }} - distribution: 'temurin' - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Set up node using nvm - uses: dcodeIO/setup-node-nvm@v5 - with: - node-version: 20.10.0 + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.jdk }} + distribution: 'temurin' + - name: Grant execute permission for gradlew + run: chmod +x gradlew -# - name: Cache SonarCloud packages -# uses: actions/cache@v1 -# with: -# path: ~/.sonar/cache -# key: ${{ runner.os }}-sonar -# restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v3 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle + # - name: Cache SonarCloud packages + # uses: actions/cache@v1 + # with: + # path: ~/.sonar/cache + # key: ${{ runner.os }}-sonar + # restore-keys: ${{ runner.os }}-sonar + - name: Cache Gradle packages + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle -# - name: Test WireMock with Sonarqube -# if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push' }} -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any -# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -# run: ./gradlew check sonarqube --stacktrace --no-daemon + # - name: Test WireMock with Sonarqube + # if: ${{ matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push' }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # run: ./gradlew check sonarqube --stacktrace --no-daemon - - name: Test WireMock - if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push') }} - run: ./gradlew check --stacktrace --no-daemon + - name: Test WireMock + if: ${{ !(matrix.os == 'ubuntu-latest' && matrix.jdk == 11 && github.event_name == 'push') }} + run: ./gradlew check --stacktrace --no-daemon # - name: Archive WireMock test report - ${{ matrix.os }} JDK ${{ matrix.jdk }} # if: always() diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 0102da9b2c..9ba4561ceb 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -43,10 +43,6 @@ jobs: distribution: 'temurin' - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Set up node using nvm - uses: dcodeIO/setup-node-nvm@v5 - with: - node-version: 20.10.0 - name: Cache Gradle packages uses: actions/cache@v3 with: diff --git a/.gitignore b/.gitignore index 10f9f7f667..749c4f0c44 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,8 @@ bin # WIREMOCK # ################# -/mappings/ +mappings/ +__files src/main/resources/assets/webapp/ scripts/client-cert.* @@ -70,4 +71,4 @@ notes.txt # MINE # Guide.txt -docker \ No newline at end of file +docker diff --git a/.run/Build WireMock.run.xml b/.run/Build WireMock.run.xml index f855fd701f..95941180cd 100644 --- a/.run/Build WireMock.run.xml +++ b/.run/Build WireMock.run.xml @@ -22,4 +22,4 @@ false - \ No newline at end of file + diff --git a/.run/Run WireMock.run.xml b/.run/Run WireMock.run.xml new file mode 100644 index 0000000000..0913874c4d --- /dev/null +++ b/.run/Run WireMock.run.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.run/WebApp lint --fix.run.xml b/.run/WebApp lint --fix.run.xml new file mode 100644 index 0000000000..9239f30f53 --- /dev/null +++ b/.run/WebApp lint --fix.run.xml @@ -0,0 +1,13 @@ + + + + + +