Skip to content

Commit

Permalink
Fix translation link
Browse files Browse the repository at this point in the history
ENG-17101
  • Loading branch information
hadomskyi committed Aug 15, 2024
1 parent 7e3e6a0 commit 26d3d00
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
"cypress/e2e/jobs/verified/success-path-single.cy.js",
"cypress/e2e/jobs/instant/success-path-single.cy.js",
]
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set the value
Expand Down
66 changes: 33 additions & 33 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ composer-install:
composer require --ignore-platform-reqs "lilt/craft-lilt-plugin":"^999.9.9"

reset: cp composer-install
docker-compose exec -T app sh -c 'php craft db/restore happylager.sql'
docker-compose exec -T app sh -c 'php craft plugin/install craft-lilt-plugin'
docker compose exec -T app sh -c 'php craft db/restore happylager.sql'
docker compose exec -T app sh -c 'php craft plugin/install craft-lilt-plugin'


install: clone
Expand All @@ -28,23 +28,23 @@ install: clone
composer require craftcms/cms:3.7.68 -W

backup-db:
docker-compose exec -T app sh -c 'php craft db/backup'
docker compose exec -T app sh -c 'php craft db/backup'

refresh:
docker-compose exec -T app sh -c 'rm -rf /app/vendor/lilt/craft-lilt-plugin'
docker-compose exec -T app sh -c 'composer require --ignore-platform-reqs "lilt/craft-lilt-plugin":"^999.9.9"'
docker compose exec -T app sh -c 'rm -rf /app/vendor/lilt/craft-lilt-plugin'
docker compose exec -T app sh -c 'composer require --ignore-platform-reqs "lilt/craft-lilt-plugin":"^999.9.9"'

build:
docker build -f happy-lager-main/Dockerfile happy-lager-main -t happy-lager

down:
docker-compose down --remove-orphans -v
docker compose down --remove-orphans -v

mup: #migrate app up
docker-compose exec -T app sh -c 'php craft migrate/up'
docker compose exec -T app sh -c 'php craft migrate/up'

mdown: #migrate app down
docker-compose exec -T app sh -c 'php craft migrate/down'
docker compose exec -T app sh -c 'php craft migrate/down'

cp:
rm -rf happy-lager-main/plugin-src
Expand Down Expand Up @@ -84,32 +84,32 @@ wait-service:
@echo "Service is up and running or max retries reached!"

up: clone down composer-install
docker-compose up --build -d
docker-compose ps
docker-compose exec -T app sh -c 'chmod -R 777 /app'
docker-compose exec -T app sh -c 'chown -R www-data:www-data /app'
docker-compose exec -T mysql sh -c 'while ! mysqladmin ping -h"mysql" --silent; do sleep 1; done'
docker-compose exec -T app sh -c 'php craft setup/security-key'
docker-compose exec -T app sh -c 'echo DB_DRIVER=mysql >> .env'
docker-compose exec -T app sh -c 'echo DB_SERVER=mysql >> .env'
docker-compose exec -T app sh -c 'echo DB_DATABASE=${DB_DATABASE} >> .env'
docker-compose exec -T app sh -c 'echo DB_USER=craft-lilt >> .env'
docker-compose exec -T app sh -c 'echo DB_PASSWORD=craft-lilt >> .env'
docker-compose exec -T app sh -c 'echo DB_SCHEMA=public >> .env'
docker-compose exec -T app sh -c 'echo DB_TABLE_PREFIX= >> .env'
docker-compose exec -T app sh -c 'echo CRAFT_LILT_PLUGIN_QUEUE_DELAY_IN_SECONDS=1 >> .env'
docker-compose exec -T app sh -c 'echo CRAFT_LILT_PLUGIN_QUEUE_MANAGER_WAIT_TIME_IN_SECONDS=86400 >> .env'
docker-compose exec -T app sh -c 'php craft db/restore happylager.sql'
docker-compose exec -T app sh -c 'php craft plugin/install craft-lilt-plugin'
docker-compose exec -T app sh -c 'php craft plugin/install neo'
docker-compose exec -T app sh -c 'php craft plugin/install super-table'
docker-compose exec -T app sh -c 'php craft project-config/rebuild'
docker-compose exec -T app sh -c 'php craft up'
docker-compose exec -T app sh -c 'php craft migrate/up'
docker-compose exec -T app sh -c 'nohup ./queue_listen.sh > queue.log 2>&1 &'
docker-compose exec -T app sh -c 'cat .env'
docker compose up --build -d
docker compose ps
docker compose exec -T app sh -c 'chmod -R 777 /app'
docker compose exec -T app sh -c 'chown -R www-data:www-data /app'
docker compose exec -T mysql sh -c 'while ! mysqladmin ping -h"mysql" --silent; do sleep 1; done'
docker compose exec -T app sh -c 'php craft setup/security-key'
docker compose exec -T app sh -c 'echo DB_DRIVER=mysql >> .env'
docker compose exec -T app sh -c 'echo DB_SERVER=mysql >> .env'
docker compose exec -T app sh -c 'echo DB_DATABASE=${DB_DATABASE} >> .env'
docker compose exec -T app sh -c 'echo DB_USER=craft-lilt >> .env'
docker compose exec -T app sh -c 'echo DB_PASSWORD=craft-lilt >> .env'
docker compose exec -T app sh -c 'echo DB_SCHEMA=public >> .env'
docker compose exec -T app sh -c 'echo DB_TABLE_PREFIX= >> .env'
docker compose exec -T app sh -c 'echo CRAFT_LILT_PLUGIN_QUEUE_DELAY_IN_SECONDS=1 >> .env'
docker compose exec -T app sh -c 'echo CRAFT_LILT_PLUGIN_QUEUE_MANAGER_WAIT_TIME_IN_SECONDS=86400 >> .env'
docker compose exec -T app sh -c 'php craft db/restore happylager.sql'
docker compose exec -T app sh -c 'php craft plugin/install craft-lilt-plugin'
docker compose exec -T app sh -c 'php craft plugin/install neo'
docker compose exec -T app sh -c 'php craft plugin/install super-table'
docker compose exec -T app sh -c 'php craft project-config/rebuild'
docker compose exec -T app sh -c 'php craft up'
docker compose exec -T app sh -c 'php craft migrate/up'
docker compose exec -T app sh -c 'nohup ./queue_listen.sh > queue.log 2>&1 &'
docker compose exec -T app sh -c 'cat .env'
cli:
docker-compose exec app sh
docker compose exec app sh

test:
docker run -u root -t -v ${PWD}:/e2e -w /e2e --env CYPRESS_CACHE_FOLDER=${CYPRESS_CACHE_FOLDER} node:18.12.1 npm install
Expand Down
11 changes: 11 additions & 0 deletions src/elements/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use lilthq\craftliltplugin\elements\actions\JobEdit;
use lilthq\craftliltplugin\elements\db\TranslationQuery;
use lilthq\craftliltplugin\models\TranslationModelTrait;
use craft\elements\User;
use lilthq\craftliltplugin\records\TranslationNotificationsRecord;
use lilthq\craftliltplugin\records\TranslationRecord;

Expand Down Expand Up @@ -128,6 +129,16 @@ public function getIsReviewed(): bool
return $this->getIsPublished() || $this->status === TranslationRecord::STATUS_READY_TO_PUBLISH;
}

public function getUrl(): ?string
{
return $this->getCpEditUrl();
}

public function canView(User $user): bool
{
return true;
}

public function getStatusHtml(): string
{
$label = self::statuses()[$this->status]['label'] ?? self::statuses()[$this->status];
Expand Down

0 comments on commit 26d3d00

Please sign in to comment.