mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
change paths for cardstack types
This commit is contained in:
parent
1afe082d92
commit
17964ce5cb
7 changed files with 81 additions and 38 deletions
|
@ -1,8 +1,8 @@
|
|||
const { createEmbed, page } = require("#utils/embed");
|
||||
const { acknowledge } = require("#utils/interactions");
|
||||
|
||||
const { DynamicCardStack } = require("../../../labscore/cardstack/DynamicCardStack");
|
||||
const {CARD_STACK_CONSTANTS} = require("#cardstack");
|
||||
const {createDynamicCardStack} = require("#cardstack/index");
|
||||
const {ResolveCallbackTypes} = require("#cardstack/constants");
|
||||
|
||||
module.exports = {
|
||||
label: "text",
|
||||
|
@ -16,12 +16,12 @@ module.exports = {
|
|||
},
|
||||
onBefore: context => context.user.isClientOwner,
|
||||
onCancel: ()=>{},
|
||||
run: async (context, args) => {
|
||||
run: async (context) => {
|
||||
await acknowledge(context);
|
||||
|
||||
try{
|
||||
// This will create a new dynamic card stack
|
||||
new DynamicCardStack(context, {
|
||||
createDynamicCardStack(context, {
|
||||
cards: [
|
||||
createEmbed("default", context, { description: "page 1"}),
|
||||
createEmbed("default", context, { description: "page 2. this has a conditional button."})
|
||||
|
@ -37,7 +37,7 @@ module.exports = {
|
|||
disableCache: true,
|
||||
resolvePage: ()=>{
|
||||
return {
|
||||
type: CARD_STACK_CONSTANTS.RESOLVE_CALLBACK_TYPES.SUBSTACK,
|
||||
type: ResolveCallbackTypes.SUBSTACK,
|
||||
cards: [
|
||||
createEmbed("success", context, "smiley")
|
||||
].map((p)=>page(p))
|
||||
|
@ -52,9 +52,9 @@ module.exports = {
|
|||
visible: (page) => {
|
||||
return (page.getState("key") === "t_1")
|
||||
},
|
||||
resolvePage: (pg) => {
|
||||
resolvePage: () => {
|
||||
return {
|
||||
type: CARD_STACK_CONSTANTS.RESOLVE_CALLBACK_TYPES.SUBSTACK,
|
||||
type: ResolveCallbackTypes.SUBSTACK,
|
||||
cards: [
|
||||
createEmbed("default", context, { description: "this is a conditional sub page"}),
|
||||
createEmbed("default", context, { description: "this is a conditional sub page two"})
|
||||
|
@ -72,15 +72,15 @@ module.exports = {
|
|||
inline: false,
|
||||
visible: true,
|
||||
// Renders the loading state card
|
||||
renderLoadingState: (page) => {
|
||||
renderLoadingState: () => {
|
||||
return createEmbed("default", context, {
|
||||
description: "-# replacing papa card",
|
||||
})
|
||||
},
|
||||
resolvePage: async (pg) => {
|
||||
resolvePage: async () => {
|
||||
console.log("resolving page")
|
||||
return {
|
||||
type: CARD_STACK_CONSTANTS.RESOLVE_CALLBACK_TYPES.REPLACE_PARENT_CARD,
|
||||
type: ResolveCallbackTypes.REPLACE_PARENT_CARD,
|
||||
card: page(createEmbed("default", context, { description: "this is the new over lord " + new Date()}), {}, {
|
||||
key: Date.now()
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue