Przeglądaj źródła

Fixes actions for uncommitted commit details

main
Keith Daulton 2 lat temu
rodzic
commit
bb36826e62
3 zmienionych plików z 16 dodań i 3 usunięć
  1. +4
    -0
      CHANGELOG.md
  2. +7
    -1
      src/webviews/apps/commitDetails/commitDetails.ts
  3. +5
    -2
      src/webviews/apps/shared/components/commit/file-change-item.ts

+ 4
- 0
CHANGELOG.md Wyświetl plik

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased]
### Fixed
- Fixes Commit Details showing incorrect actions for uncommitted changes
## [12.2.2] - 2022-09-06
### Fixed

+ 7
- 1
src/webviews/apps/commitDetails/commitDetails.ts Wyświetl plik

@ -206,6 +206,7 @@ export class CommitDetailsApp extends App> {
return;
}
this.renderActions(this.state);
this.renderPin(this.state);
this.renderSha(this.state);
this.renderMessage(this.state);
@ -218,6 +219,11 @@ export class CommitDetailsApp extends App> {
// }
}
renderActions(state: CommitState) {
const isHidden = state.selected?.sha === uncommittedSha ? 'true' : 'false';
[...document.querySelectorAll('[data-action-type="graph"],[data-action-type="more"]')].forEach($el => $el.setAttribute('aria-hidden', isHidden));
}
renderPin(state: CommitState) {
const $el = document.querySelector<HTMLElement>('[data-action="pin"]');
if ($el == null) {
@ -322,7 +328,7 @@ export class CommitDetailsApp extends App> {
}
if (state.selected.files?.length) {
const stashAttr = state.selected.isStash ? 'stash ' : '';
const stashAttr = state.selected.isStash ? 'stash ' : state.selected.sha === uncommittedSha ? 'uncommitted ' : '';
$el.innerHTML = state.selected.files
.map(
(file: Record<string, any>) => `

+ 5
- 2
src/webviews/apps/shared/components/commit/file-change-item.ts Wyświetl plik

@ -159,6 +159,9 @@ export class FileChangeItem extends LitElement {
@property({ type: Boolean, reflect: true })
stash = false;
@property({ type: Boolean, reflect: true })
uncommitted = false;
private renderIcon() {
if (this.icon !== '') {
return html`<img class="change-list__status-icon" src="${this.icon}" />`;
@ -197,14 +200,14 @@ export class FileChangeItem extends LitElement {
title="Open file"
aria-label="Open file"
><code-icon icon="go-to-file"></code-icon></a
><a
>${!this.uncommitted ? html`<a
class="change-list__action"
@click=${this.onCompareWorking}
href="#"
title="Open Changes with Working File"
aria-label="Open Changes with Working File"
><code-icon icon="git-compare"></code-icon></a
>${!this.stash
>` : nothing}${!this.stash && !this.uncommitted
? html`<a
class="change-list__action"
@click=${this.onOpenFileOnRemote}

Ładowanie…
Anuluj
Zapisz