Skip to content

Commit

Permalink
Remove ability to have board and card actions in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
piascikj committed Nov 20, 2024
1 parent 56dbfd0 commit 6313422
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 44 deletions.
30 changes: 2 additions & 28 deletions lib/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,10 @@ module.exports = function newCard(task, _project, dontParse) {
: { ...computed }
}

getCardActions() {
// TODO Stop allowing links/actions from card config
// <!-- order:-80 -->
const links = project.config.cardActions
const allLinks = this.frontMatter.links
? [...links, ...this.frontMatter.links]
: [...links]
return allLinks.filter(({ display }) => {
if (!display) return true
try {
return display.call({ ...this.data, ...this.desc })
} catch (e) {
console.error(e)
}
return false
})
}

initActions() {
this.links = this.getCardActions().map(
({ pack, icon, title, href }, index) => {
href = this.formatContent(href).content
title = this.formatContent(title).content
const action = JSON.stringify({ index })
return { pack, icon, title, href, action } // Use index instead of action
}
)

this.links = []
if (!pluginManager) return
this.links = [...this.links, ...pluginManager.getCardActions(this)]
this.links = [...pluginManager.getCardActions(this)]
}

get projectPath() {
Expand Down
11 changes: 0 additions & 11 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@ class Config {
return this.settings.views
}

get cardActions() {
return [..._get(this, 'settings.cards.links', [])]
}

get boardActions() {
const settingsActions = _get(this, 'settings.actions', []).map((action) => {
return { name: action.name, action: action['function'] }
})
return [...settingsActions]
}

get appendNewCardsTo() {
return _get(this, 'settings.appendNewCardsTo', false)
}
Expand Down
5 changes: 0 additions & 5 deletions lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,7 @@ module.exports = class WorkerProject extends Project {
}

get boardActions() {
// TODO Stop allowing board actions from config
// <!-- order:-90 -->
return [
...this.config.boardActions.map((item, index) => {
return { ...item, index }
}),
...this.pluginManager.getBoardActions(),
]
}
Expand Down

0 comments on commit 6313422

Please sign in to comment.