Skip to content

Commit

Permalink
Move word-cloud out of card-drawer.
Browse files Browse the repository at this point in the history
In the next few commits we'll want to render additional controls next to it. It's also weird that it was card-drawer's responsibiliy to render it.

Part of #694.
  • Loading branch information
jkomoros committed Aug 4, 2024
1 parent 2269894 commit 8e67a39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/components/card-drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';

import './card-renderer.js';
import './word-cloud.js';
import './card-thumbnail-list.js';
import './web-renderer.js';

Expand All @@ -26,8 +25,7 @@ import * as icons from './my-icons.js';

import {
CardID,
CardType,
WordCloud
CardType
} from '../types.js';

import {
Expand Down Expand Up @@ -88,9 +86,6 @@ class CardDrawer extends LitElement {
@property({ type : Boolean })
showing: boolean;

@property({ type : Array })
wordCloud: WordCloud | null;

@property({ type : Boolean })
infoExpanded: boolean;

Expand Down Expand Up @@ -167,7 +162,6 @@ class CardDrawer extends LitElement {
<div class='label' id='count'>
<span>${this.infoCanBeExpanded ? html`<button class='small' @click=${this._handleZippyClicked}>${this.infoExpanded ? ARROW_DOWN_ICON : ARROW_RIGHT_ICON}</button>` : '' }<strong>${this.collection ? this.collection.numCards : 0}</strong> cards</span>
<div class='info-panel' ?hidden=${!this.infoExpanded}>
<word-cloud .wordCloud=${this.wordCloud}></word-cloud>
<slot name='info'></slot>
</div>
<div class='info-panel'>
Expand Down
3 changes: 2 additions & 1 deletion src/components/card-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import './card-drawer.js';
import './card-stage.js';
import './card-editor.js';
import './tag-list.js';
import './word-cloud.js';
import './comments-panel.js';
import './card-info-panel.js';
import './suggestions-viewer.js';
Expand Down Expand Up @@ -487,13 +488,13 @@ class CardView extends connect(store)(PageViewElement) {
.highlightedCardId=${this._card ? this._card.id : ''}
.reorderPending=${this._drawerReorderPending}
.ghostCardsThatWillBeRemoved=${true}
.wordCloud=${this._collectionWordCloud}
.infoExpanded=${this._infoExpanded}
.infoCanBeExpanded=${true}
.cardTypeToAdd=${this._cardTypeToAdd}
.renderOffset=${this._renderOffset}
>
<div slot='info'>
<word-cloud .wordCloud=${this._collectionWordCloud}></word-cloud>
${this._userIsAdmin ? html`
<input type='checkbox' .checked=${this._suggestMissingConceptsEnabled} @change=${this._handleSuggestMissingConceptsChanged} id='suggested-concepts-enabled'><label for='suggested-concepts-enabled'>Suggest Missing Concepts <strong>(SLOW)</strong></label><br/>
<button id='edit-multi' class='small' title='Edit all cards' @click=${this._handleMultiEditClicked}>${EDIT_ICON}</button><label for='edit-multi'>Edit All Cards</label><br/>
Expand Down

0 comments on commit 8e67a39

Please sign in to comment.