From 829f8fd283ca72e2a3391580ecf748f1e99efe5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pr=C3=A9vost?= Date: Thu, 4 Apr 2024 21:37:28 -0400 Subject: [PATCH] Remove machine translation quick button revisions list. Fixes #423 --- .../conflicts-list/item/component.ts | 7 ++ webapp/app/queries/translation-editions.ts | 12 --- webapp/app/queries/translations.ts | 1 + .../components/inline-machine-translate.scss | 74 ------------------- .../components/translations-list/item.scss | 2 +- .../templates/components/conflicts-list.hbs | 1 - .../components/conflicts-list/group.hbs | 1 - .../components/conflicts-list/item.hbs | 2 +- .../components/inline-machine-translate.hbs | 28 +++---- .../components/related-translations-list.hbs | 1 - .../related-translations-list/item.hbs | 2 +- .../templates/components/translation-edit.hbs | 2 +- .../components/translation-edit/helpers.hbs | 2 +- .../translation-editions-list/item.hbs | 2 +- .../components/translations-list/item.hbs | 2 +- .../project/revision/translations.hbs | 1 - .../logged-in/project/translation/index.hbs | 1 - 17 files changed, 24 insertions(+), 117 deletions(-) diff --git a/webapp/app/components/conflicts-list/item/component.ts b/webapp/app/components/conflicts-list/item/component.ts index 94093851d..02ec285da 100644 --- a/webapp/app/components/conflicts-list/item/component.ts +++ b/webapp/app/components/conflicts-list/item/component.ts @@ -78,6 +78,13 @@ export default class ConflictsListItem extends Component { : this.args.translation.revision.language.rtl; } + get revisionSlug() { + return ( + this.args.translation.revision.slug || + this.args.translation.revision.language.slug + ); + } + @action changeTranslationText(text: string) { this.textInput = text; diff --git a/webapp/app/queries/translation-editions.ts b/webapp/app/queries/translation-editions.ts index e4d9216d5..534d5c962 100644 --- a/webapp/app/queries/translation-editions.ts +++ b/webapp/app/queries/translation-editions.ts @@ -41,18 +41,6 @@ export default gql` tag } - revision { - id - slug - rtl - - language { - id - slug - rtl - } - } - document { id path diff --git a/webapp/app/queries/translations.ts b/webapp/app/queries/translations.ts index 72aedbdf3..77ab048c3 100644 --- a/webapp/app/queries/translations.ts +++ b/webapp/app/queries/translations.ts @@ -94,6 +94,7 @@ export default gql` rtl } } + document { id path diff --git a/webapp/app/styles/components/inline-machine-translate.scss b/webapp/app/styles/components/inline-machine-translate.scss index 95740f369..e69de29bb 100644 --- a/webapp/app/styles/components/inline-machine-translate.scss +++ b/webapp/app/styles/components/inline-machine-translate.scss @@ -1,74 +0,0 @@ -.prompt-button { - position: relative; - display: flex; - align-items: center; - - > .button { - transition: opacity 0.2s ease-in-out; - box-shadow: none; - opacity: 0.7; - border-radius: var(--border-radius); - } - - > button:focus, - > button:hover { - transform: translate3d(0, 0, 0); - } - - &:focus, - &:hover { - outline: none; - - > .button { - opacity: 1; - } - - .prompt-button-quick-access[data-rtl] { - transform: translateX(40px); - } - - .prompt-button-quick-access { - opacity: 1; - transform: translateX(-40px); - padding: 0 5px; - pointer-events: all; - } - } -} - -.prompt-button-quick-access[data-rtl] { - left: 0; - right: auto; - justify-content: flex-start; -} - -.prompt-button-quick-access { - background: var(--input-background); - opacity: 0; - pointer-events: none; - border-radius: var(--border-radius); - right: 0; - display: flex; - gap: 0; - justify-content: flex-end; - align-items: center; - position: absolute; - top: 0; - transition: all 0.2s ease-in-out; - - > button { - font-size: 11px; - flex-shrink: 0; - } - - > button:focus, - > button:hover { - background: var(--background-light); - transform: translate3d(0, 0, 0); - } - - > button :global(.label) { - padding-left: 8px; - padding-right: 8px; - } -} diff --git a/webapp/app/styles/components/translations-list/item.scss b/webapp/app/styles/components/translations-list/item.scss index bc9353a38..87b81155d 100644 --- a/webapp/app/styles/components/translations-list/item.scss +++ b/webapp/app/styles/components/translations-list/item.scss @@ -194,7 +194,7 @@ .item-updatedAt { opacity: 0; - transform: translateX(-10px); + transform: translateX(-5px); margin-left: 5px; color: var(--color-grey); font-size: 11px; diff --git a/webapp/app/templates/components/conflicts-list.hbs b/webapp/app/templates/components/conflicts-list.hbs index a0df53261..b8503f572 100644 --- a/webapp/app/templates/components/conflicts-list.hbs +++ b/webapp/app/templates/components/conflicts-list.hbs @@ -22,7 +22,6 @@ -
- {{#each @languages as |language|}} - - {{language.slug}} - - {{/each}} -
- - - -{{/if}} \ No newline at end of file + + {{inline-svg '/assets/language.svg' class='button-icon'}} + \ No newline at end of file diff --git a/webapp/app/templates/components/related-translations-list.hbs b/webapp/app/templates/components/related-translations-list.hbs index d959f9463..9c28ccc94 100644 --- a/webapp/app/templates/components/related-translations-list.hbs +++ b/webapp/app/templates/components/related-translations-list.hbs @@ -4,7 +4,6 @@ {{#each @translations key='id' as |translation|}} diff --git a/webapp/app/templates/components/translation-editions-list/item.hbs b/webapp/app/templates/components/translation-editions-list/item.hbs index d3106ff41..aeebbd3c4 100644 --- a/webapp/app/templates/components/translation-editions-list/item.hbs +++ b/webapp/app/templates/components/translation-editions-list/item.hbs @@ -61,9 +61,9 @@ {{#unless @translation.isRemoved}}