Skip to content

Commit

Permalink
Merge branch 'master' into issue-28814-fix-hidden-checkbox-in-permiss…
Browse files Browse the repository at this point in the history
…ions-fix
  • Loading branch information
oidacra authored Aug 13, 2024
2 parents 8d01687 + 6616302 commit 59bb497
Show file tree
Hide file tree
Showing 54 changed files with 1,034 additions and 405 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cleanup-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
- name: Cleanup Docker
shell: bash
run: |
if [[ "$RUNNER_OS" == "Linux" ]] || [[ "$RUNNER_OS" == "macOS" ]]; then
if [[ "$RUNNER_OS" == "Linux" ]]; then
echo 'Cleanup Docker'
docker system prune -f
docker volume prune -f
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/cli-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
id: set-os
run: |
if [[ "${{ inputs.buildNativeImage }}" == "true" ]]; then
RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux" }, { "os": "macos-13", "label": "macOS-Intel" }, { "os": "macos-14", "label": "macOS-Silicon" }]'
RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux", "platform": "linux-x86_64" }, { "os": "macos-13", "label": "macOS-Intel", "platform": "osx-x86_64" }, { "os": "macos-14", "label": "macOS-Silicon", "platform": "osx-aarch_64" }]'
else
RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux" }]'
RUNNERS='[{ "os": "ubuntu-22.04", "label": "Linux", "platform": "linux-x86_64" }]'
fi
echo "runners=$RUNNERS" >> $GITHUB_OUTPUT
Expand All @@ -68,6 +68,7 @@ jobs:
ref: ${{ env.BRANCH }}
- uses: ./.github/actions/maven-job
with:
cleanup-runner: true
stage-name: "Build Native Image ${{ matrix.label }}"
maven-args: "package -Pnative -Pdist -DskipTests=$SKIP_TESTS -pl :dotcms-cli"
native: true
Expand All @@ -80,7 +81,7 @@ jobs:
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: cli-artifacts-${{ matrix.os }}
name: cli-artifacts-${{ matrix.platform }}
path: |
${{ github.workspace }}/tools/dotcms-cli/cli/target/distributions/*.zip
retention-days: 2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cli-release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
JRELEASER_ARTIFACTORY_PASSWORD: ${{ secrets.EE_REPO_PASSWORD }}
JRELEASER_DRY_RUN: ${{ github.event.inputs.dry-run || 'false' }}
with:
cleanup-runner: true
github-token: ${{ secrets.GITHUB_TOKEN }}
stage-name: "JReleaser"
maven-args: "-Prelease validate -DartifactsDir=artifacts -Dm2Dir=$HOME/.m2/repository -Djreleaser.git.root.search=true -pl :dotcms-cli-parent -Dmaven.plugin.validation=VERBOSE"
Expand Down
58 changes: 39 additions & 19 deletions .github/workflows/publish-starter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
required: true
type: choice
options:
- 'Full Starter'
- 'full'
- 'empty'
changelog:
description: 'Changes description'
required: true
type: string
type: string
dry-run:
description: 'Enable dry-run mode'
required: true
Expand All @@ -23,47 +24,66 @@ defaults:

env:
STARTER_TYPE: ${{ github.event.inputs.type }}
EMPTY_STARTER_URL: ${{ vars.DOT_EMPTY_STARTER_URL }}
EMPTY_STARTER_TOKEN: ${{ secrets.DOT_EMPTY_STARTER_ACCESS_TOKEN }}
FULL_STARTER_URL: ${{ vars.DOT_STARTER_URL }}
FULL_STARTER_TOKEN: ${{ secrets.DOT_STARTER_ACCESS_TOKEN }}
DOWNLOAD_ENDPOINT: api/v1/maintenance/_downloadStarterWithAssets?oldAssets=true

jobs:
get-full-starter:
get-starter:
runs-on: macos-13
if: github.repository == 'dotcms/core'
environment: trunk
steps:
- name: Context
- name: 'Github context'
run: |
echo "Generating a Full Starter..."
echo "::group::Github context"
echo "${{ toJSON(github.event.inputs) }}"
echo "::endgroup::"
- name: 'Get zip file'
id: get-zip-file
env:
URL: ${{ vars.DOT_STARTER_URL }}
ACCESS_TOKEN: ${{ secrets.DOT_STARTER_ACCESS_TOKEN }}
run: |
echo "::group::Getting zip file"
echo "::notice::Starter type: $STARTER_TYPE"
function download_starter {
URL=$1/${{ env.DOWNLOAD_ENDPOINT }}
ACCESS_TOKEN=$2
OUTPUT_FILENAME=$3
curl -s -w "%{http_code}" --output ${OUTPUT_FILENAME} $URL \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer $ACCESS_TOKEN"
}
mkdir -p starter && cd starter
RESP=$(curl -s -w "%{http_code}" --output $(date +'%Y%m%d').zip $URL \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer $ACCESS_TOKEN")
if [[ "$RESP" != "200" ]]; then
echo "RESP: $RESP"
if [[ "$STARTER_TYPE" == "empty" ]]; then
echo "::debug::Empty Starter: downloading from [${{ env.EMPTY_STARTER_URL }}/${{ env.DOWNLOAD_ENDPOINT }}]"
RESPONSE=$(download_starter ${{ env.EMPTY_STARTER_URL }} ${{ env.EMPTY_STARTER_TOKEN }} empty_$(date +'%Y%m%d').zip)
else
echo "::debut::Full Starter: downloading from [${{ env.FULL_STARTER_URL }}/${{ env.DOWNLOAD_ENDPOINT }}]"
RESPONSE=$(download_starter ${{ env.FULL_STARTER_URL }} ${{ env.FULL_STARTER_TOKEN }} $(date +'%Y%m%d').zip)
fi
echo "::notice::Status Code: $RESPONSE"
if [[ "$RESPONSE" != "200" ]]; then
echo "::error::Failed with status code: $RESPONSE"
exit 1
fi
ls -ltrh
echo "::endgroup::"
# echo "::endgroup::"
- name: 'Upload artifacts'
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: starter
name: ${{ env.STARTER_TYPE }}-starter
path: |
${{ github.workspace }}/starter/*.zip
retention-days: 2
if-no-files-found: ignore
if-no-files-found: ignore

deploy-artifacts:
needs: [ get-full-starter ]
needs: [ get-starter ]
runs-on: ubuntu-20.04
environment: trunk
outputs:
Expand All @@ -86,7 +106,7 @@ jobs:
uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
name: starter
name: ${{ env.STARTER_TYPE }}-starter
path: ${{ github.workspace }}/starter

- name: 'Listing artifacts'
Expand Down
46 changes: 44 additions & 2 deletions core-web/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,44 @@ NC='\033[0m' # No Color
exit 1
}

check_sdk_client_affected() {
local YARN_EXEC="${root_dir}/installs/node/yarn/dist/bin/yarn"

local affected_projects=$(npx nx show projects --affected)
echo "Affected projects: $affected_projects"
if echo "$affected_projects" | grep -q "sdk-client"; then
echo "Building sdk-client"
if ! $YARN_EXEC nx run sdk-client:build:js; then
echo "Failed to build sdk-client"
has_errors=true
fi
fi

file_to_remove="${root_dir}/dotCMS/src/main/webapp/html/js/editor-js/package.json"
dir_to_remove="${root_dir}/dotCMS/src/main/webapp/html/js/editor-js/libs"

# Check if the file exists, then delete it
if [ -f "$file_to_remove" ]; then
rm "$file_to_remove"
echo "Removed $file_to_remove"
else
echo "$file_to_remove does not exist"
fi

# Check if the directory exists, then delete it
if [ -d "$dir_to_remove" ]; then
rm -r "$dir_to_remove"
echo "Removed directory $dir_to_remove"
else
echo "$dir_to_remove does not exist"
fi

if ! git add "${root_dir}/dotCMS/src/main/webapp/html/js/editor-js/sdk-editor.js"; then
echo "Failed to stage computed sdk-client.js"
exit 1
fi
}

check_sdkman() {
SDKMAN_INIT="$HOME/.sdkman/bin/sdkman-init.sh"

Expand Down Expand Up @@ -46,8 +84,8 @@ perform_frontend_fixes() {
local add_to_index="$2"
local file

local YARN_EXEC="${root_dir}/installs/node/yarn/dist/bin/yarn"
local NODE_EXEC="${root_dir}/installs/node/node"
local YARN_EXEC="${root_dir}/installs/node/yarn/dist/bin/yarn"

# Check if Yarn and Node executables are present
if [[ ! -x "$YARN_EXEC" || ! -x "$NODE_EXEC" ]]; then
Expand All @@ -58,6 +96,7 @@ perform_frontend_fixes() {
echo "Yarn version: $($YARN_EXEC --version 2>/dev/null)"
echo "Node version: $($NODE_EXEC --version)"
$YARN_EXEC config set registry https://dotcms-npm.b-cdn.net

# Check if yarn.lock is present
if ! $YARN_EXEC install; then
echo "Failed to install dependencies with yarn install"
Expand Down Expand Up @@ -222,6 +261,9 @@ if [ -n "$core_web_files_untracked" ]; then
perform_frontend_fixes "${core_web_files_untracked}" false
fi

# Check if sdk-client is affected
check_sdk_client_affected

# Restore original working directory
cd "${original_pwd}" || exit 1 # Exit if the directory does not exist

Expand All @@ -232,4 +274,4 @@ if [ "$has_errors" = true ]; then
else
echo "Commit checks completed successfully."
exit 0 # No errors, exit normally
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export class DotTemplateCreateEditComponent implements OnInit, OnDestroy {
* @memberof DotTemplateBuilderComponent
*/
onCustomEvent($event: CustomEvent): void {
this.store.goToEditTemplate($event.detail.data.id, $event.detail.data.inode);
const { data } = $event.detail;
this.store.goToEditTemplate(data.id, data.inode);
}

private createTemplate(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
.p-autocomplete-token {
flex-direction: row-reverse;
max-width: $spacing-10;

.p-autocomplete-token-label {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}

.p-autocomplete-loader {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
<dot-dialog
(hide)="close()"
(keydown.escape)="close()"
<p-dialog
(visibleChange)="close()"
[visible]="!!data"
[bindEvents]="false"
[actions]="dialogActions"
[header]="data?.title"
#dialog>
<div *ngIf="data?.steps?.length" class="dot-wizard__view">
<div
(keydown.tab)="handleTab($event)"
(keydown.enter)="handleEnter($event)"
[ngStyle]="{ transform: transform }"
class="dot-wizard__container">
<div *ngFor="let step of data.steps" class="dot-wizard__step">
<ng-template dotContainerReference></ng-template>
[draggable]="false"
[resizable]="false"
[maximizable]="false"
[modal]="true"
appendTo="body"
data-testId="dot-wizard">
@if (data?.steps?.length) {
<div class="dot-wizard__view">
<div
[ngStyle]="{ transform: transform }"
class="dot-wizard__container"
(keydown.tab)="handleTab($event)">
@for (step of data.steps; track $index) {
<div class="dot-wizard__step">
<ng-template dotContainerReference></ng-template>
</div>
}
</div>

@if ($dialogActions()) {
<footer class="dot-wizard__footer">
@if ($dialogActions().cancel) {
<button
(click)="$dialogActions().cancel?.action()"
[disabled]="$dialogActions().cancel?.disabled"
[label]="$dialogActions().cancel?.label"
class="dialog__button-cancel p-button-outlined"
data-testId="dialog-close-button"
pButton></button>
}
@if ($dialogActions().accept) {
<button
(click)="$dialogActions().accept?.action()"
[disabled]="$dialogActions().accept?.disabled"
[label]="$dialogActions().accept?.label"
[loading]="isSaving"
class="dialog__button-accept"
data-testId="dialog-accept-button"
pButton></button>
}
</footer>
}
</div>
</div>
</dot-dialog>
}
</p-dialog>
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
display: flex;
transition: transform $basic-speed ease-in;
}

.dot-wizard__footer {
display: flex;
justify-content: end;
gap: $spacing-1;
}
Loading

0 comments on commit 59bb497

Please sign in to comment.