Skip to content

Commit

Permalink
Remove machine translation quick button revisions list. Fixes #423
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprev committed Apr 5, 2024
1 parent 2542935 commit 829f8fd
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 117 deletions.
7 changes: 7 additions & 0 deletions webapp/app/components/conflicts-list/item/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ export default class ConflictsListItem extends Component<Args> {
: 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;
Expand Down
12 changes: 0 additions & 12 deletions webapp/app/queries/translation-editions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ export default gql`
tag
}
revision {
id
slug
rtl
language {
id
slug
rtl
}
}
document {
id
path
Expand Down
1 change: 1 addition & 0 deletions webapp/app/queries/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default gql`
rtl
}
}
document {
id
path
Expand Down
74 changes: 0 additions & 74 deletions webapp/app/styles/components/inline-machine-translate.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
2 changes: 1 addition & 1 deletion webapp/app/styles/components/translations-list/item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@

.item-updatedAt {
opacity: 0;
transform: translateX(-10px);
transform: translateX(-5px);
margin-left: 5px;
color: var(--color-grey);
font-size: 11px;
Expand Down
1 change: 0 additions & 1 deletion webapp/app/templates/components/conflicts-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<ConflictsList::Group
@index={{index}}
@permissions={{@permissions}}
@revisions={{this.revisions}}
@project={{@project}}
@prompts={{@prompts}}
@groupedTranslation={{groupedTranslation}}
Expand Down
1 change: 0 additions & 1 deletion webapp/app/templates/components/conflicts-list/group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<ConflictsList::Item
@permissions={{@permissions}}
@project={{@project}}
@revisions={{@revisions}}
@prompts={{@prompts}}
@translation={{translation}}
@onCorrect={{@onCorrect}}
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/templates/components/conflicts-list/item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<TranslationEdit::Helpers
@permissions={{@permissions}}
@project={{@project}}
@revisions={{@revisions}}
@languageSlug={{this.revisionSlug}}
@prompts={{@prompts}}
@rtl={{this.revisionTextDirRtl}}
@text={{this.textInput}}
Expand Down
28 changes: 9 additions & 19 deletions webapp/app/templates/components/inline-machine-translate.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{{#if @languages}}
<div local-class='prompt-button' tabindex='0'>
<div local-class='prompt-button-quick-access' data-rtl={{@rtl}}>
{{#each @languages as |language|}}
<AsyncButton
title={{language.name}}
@onClick={{(perform this.submitTask language.slug)}}
class='tooltip tooltip--top button button--iconOnly button--borderless button--white'
>
{{language.slug}}
</AsyncButton>
{{/each}}
</div>

<button local-class='button' class='button button--iconOnly button--borderless button--filled button--white'>
{{inline-svg '/assets/language.svg' class='button-icon'}}
</button>
</div>
{{/if}}
<AsyncButton
local-class='button'
title={{@languageSlug}}
@onClick={{(perform this.submitTask @languageSlug)}}
@loading={{this.isSubmitting}}
class='button button--iconOnly button--borderless button--filled button--white'
>
{{inline-svg '/assets/language.svg' class='button-icon'}}
</AsyncButton>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{{#each @translations key='id' as |translation|}}
<RelatedTranslationsList::Item
@permissions={{@permissions}}
@revisions={{@revisions}}
@prompts={{@prompts}}
@onUpdateText={{@onUpdateText}}
@isInEditMode={{true}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<TranslationEdit::Helpers
@permissions={{@permissions}}
@project={{@project}}
@revisions={{@revisions}}
@languageSlug={{this.revisionSlug}}
@prompts={{@prompts}}
@rtl={{this.revisionTextDirRtl}}
@text={{this.editText}}
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/templates/components/translation-edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<div local-class='form-improve' data-rtl={{this.revisionTextDirRtl}}>
<TranslationEdit::Helpers
@permissions={{@permissions}}
@languageSlug={{this.revisionSlug}}
@project={{@project}}
@revisions={{@revisions}}
@prompts={{@prompts}}
@rtl={{this.revisionTextDirRtl}}
@text={{this.text}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@rtl={{@rtl}}
@project={{@project}}
@text={{@text}}
@languages={{this.machineTranslationLanguages}}
@languageSlug={{@languageSlug}}
@onUpdatingText={{@onUpdatingText}}
@onUpdateText={{@onUpdateText}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
{{#unless @translation.isRemoved}}
<div local-class='form-helpers'>
<TranslationEdit::Helpers
@languageSlug={{this.revisionSlug}}
@permissions={{@permissions}}
@project={{@project}}
@revisions={{@revisions}}
@prompts={{@prompts}}
@rtl={{this.revisionTextDirRtl}}
@text={{this.editText}}
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/templates/components/translations-list/item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<TranslationEdit::Helpers
@permissions={{@permissions}}
@project={{@project}}
@revisions={{@revisions}}
@languageSlug={{this.revisionSlug}}
@prompts={{@prompts}}
@rtl={{this.revisionTextDirRtl}}
@text={{this.editText}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
@versions={{this.model.project.versions.entries}}
@project={{this.model.project}}
@prompts={{this.model.prompts}}
@revisions={{this.revisions}}
@permissions={{this.permissions}}
@translations={{this.model.translations.entries}}
@withAdvancedFilters={{this.withAdvancedFilters}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<RelatedTranslationsList
@project={{this.model.project}}
@permissions={{this.permissions}}
@revisions={{this.model.revisions}}
@prompts={{this.model.prompts}}
@translations={{this.model.relatedTranslations}}
@onUpdateText={{fn this.updateTranslation}}
Expand Down

0 comments on commit 829f8fd

Please sign in to comment.