mirror of
https://github.com/directus/directus.git
synced 2026-02-01 11:14:55 -05:00
Fix panel registration
This commit is contained in:
@@ -6,13 +6,13 @@ import { PanelConfig } from './types';
|
||||
const { panelsRaw } = getPanels();
|
||||
|
||||
export async function registerPanels(app: App): Promise<void> {
|
||||
const interfaceModules = import.meta.globEager('./*/**/index.ts');
|
||||
const panelModules = import.meta.globEager('./*/**/index.ts');
|
||||
|
||||
const panels: PanelConfig[] = Object.values(interfaceModules).map((module) => module.default);
|
||||
const panels: PanelConfig[] = Object.values(panelModules).map((module) => module.default);
|
||||
|
||||
try {
|
||||
const customPanels: { default: PanelConfig[] } = import.meta.env.DEV
|
||||
? await import('@directus-extensions-interface')
|
||||
? await import('@directus-extensions-panel')
|
||||
: await import(/* @vite-ignore */ `${getRootPath()}extensions/panels/index.js`);
|
||||
|
||||
panels.push(...customPanels.default);
|
||||
@@ -24,10 +24,10 @@ export async function registerPanels(app: App): Promise<void> {
|
||||
panelsRaw.value = panels;
|
||||
|
||||
panelsRaw.value.forEach((inter: PanelConfig) => {
|
||||
app.component('interface-' + inter.id, inter.component);
|
||||
app.component('panel-' + inter.id, inter.component);
|
||||
|
||||
if (typeof inter.options !== 'function' && Array.isArray(inter.options) === false) {
|
||||
app.component(`interface-options-${inter.id}`, inter.options);
|
||||
app.component(`panel-options-${inter.id}`, inter.options);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ export default definePanel({
|
||||
text: 'Day',
|
||||
value: 'day',
|
||||
},
|
||||
{
|
||||
text: 'Week',
|
||||
value: 'week',
|
||||
},
|
||||
{
|
||||
text: 'Month',
|
||||
value: 'month',
|
||||
|
||||
@@ -10,7 +10,7 @@ import { adjustDate } from '@/utils/adjust-date';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { isEqual } from 'lodash';
|
||||
import { useFieldsStore } from '@/stores';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { abbreviateNumber } from '@/utils/abbreviate-number';
|
||||
|
||||
type TimeSeriesOptions = {
|
||||
@@ -21,7 +21,7 @@ type TimeSeriesOptions = {
|
||||
range: string; // 1 week, etc
|
||||
color: string;
|
||||
decimals: number;
|
||||
precision: 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second';
|
||||
precision: 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
|
||||
min?: number;
|
||||
max?: number;
|
||||
filter: Filter | null;
|
||||
|
||||
Reference in New Issue
Block a user