Fixes
This commit is contained in:
parent
6347c2b4d8
commit
5b81185afa
@ -15,12 +15,9 @@ export class PlugSpacePrimitives implements SpacePrimitives {
|
|||||||
// Used e.g. by the sync engine to see if it should sync a certain path (likely not the case when we have a plug space override)
|
// Used e.g. by the sync engine to see if it should sync a certain path (likely not the case when we have a plug space override)
|
||||||
public isLikelyHandled(path: string): boolean {
|
public isLikelyHandled(path: string): boolean {
|
||||||
for (
|
for (
|
||||||
const { pattern, env } of this.hook.spaceFunctions
|
const { pattern } of this.hook.spaceFunctions
|
||||||
) {
|
) {
|
||||||
if (
|
if (path.match(pattern)) {
|
||||||
path.match(pattern) &&
|
|
||||||
(!this.env || (env && env === this.env))
|
|
||||||
) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,7 +49,6 @@ export class PlugSpacePrimitives implements SpacePrimitives {
|
|||||||
if (
|
if (
|
||||||
operation === "listFiles" && (!this.env || (env && env === this.env))
|
operation === "listFiles" && (!this.env || (env && env === this.env))
|
||||||
) {
|
) {
|
||||||
console.log("Going to run this", this.env, env, name, operation);
|
|
||||||
try {
|
try {
|
||||||
for (const pm of await plug.invoke(name, [])) {
|
for (const pm of await plug.invoke(name, [])) {
|
||||||
allFiles.push(pm);
|
allFiles.push(pm);
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import type { WidgetContent } from "$sb/app_event.ts";
|
import type { WidgetContent } from "$sb/app_event.ts";
|
||||||
import { events, language, space, system } from "$sb/syscalls.ts";
|
import { events, language, system } from "$sb/syscalls.ts";
|
||||||
import { parseTreeToAST } from "$sb/lib/tree.ts";
|
import { parseTreeToAST } from "$sb/lib/tree.ts";
|
||||||
import { astToKvQuery } from "$sb/lib/parse-query.ts";
|
import { astToKvQuery } from "$sb/lib/parse-query.ts";
|
||||||
import { jsonToMDTable, renderQueryTemplate } from "../directive/util.ts";
|
import { jsonToMDTable, renderQueryTemplate } from "../directive/util.ts";
|
||||||
import { loadPageObject, replaceTemplateVars } from "../template/template.ts";
|
import { loadPageObject, replaceTemplateVars } from "../template/template.ts";
|
||||||
|
import { resolvePath } from "$sb/lib/resolve.ts";
|
||||||
|
|
||||||
export async function widget(
|
export async function widget(
|
||||||
bodyText: string,
|
bodyText: string,
|
||||||
@ -44,9 +45,10 @@ export async function widget(
|
|||||||
} else {
|
} else {
|
||||||
if (parsedQuery.render) {
|
if (parsedQuery.render) {
|
||||||
// Configured a custom rendering template, let's use it!
|
// Configured a custom rendering template, let's use it!
|
||||||
|
const templatePage = resolvePath(pageName, parsedQuery.render);
|
||||||
const rendered = await renderQueryTemplate(
|
const rendered = await renderQueryTemplate(
|
||||||
pageObject,
|
pageObject,
|
||||||
parsedQuery.render,
|
templatePage,
|
||||||
allResults,
|
allResults,
|
||||||
parsedQuery.renderAll!,
|
parsedQuery.renderAll!,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user