Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix interface type of getForms. Sort plugins by package name. #629

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/core/src/_types/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export type IFormElementWithValuesAndChildren = IFormElementWithValues & {
* Accepted fields to filter attributes list
*/
export interface IFormFilterOptions {
id?: string;
id?: string | string[];
library?: string;
system?: boolean;
label?: string;
label?: string | string[];
}
6 changes: 5 additions & 1 deletion apps/core/src/infra/form/formRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ import {IGetCoreEntitiesParams} from '_types/shared';

export const FORM_COLLECTION_NAME = 'core_forms';

type FormFilters = IGetCoreEntitiesParams & {
filters?: IFormFilterOptions;
};

export interface IFormRepo {
getForms({params, ctx}: {params?: IGetCoreEntitiesParams; ctx: IQueryInfos}): Promise<IList<IForm>>;
getForms({params, ctx}: {params?: FormFilters; ctx: IQueryInfos}): Promise<IList<IForm>>;
updateForm({formData, ctx}: {formData: IFormStrict; ctx: IQueryInfos}): Promise<IForm>;
createForm({formData, ctx}: {formData: IFormStrict; ctx: IQueryInfos}): Promise<IForm>;
deleteForm({formData, ctx}: {formData: IForm; ctx: IQueryInfos}): Promise<IForm>;
Expand Down
3 changes: 2 additions & 1 deletion apps/core/src/infra/plugins/pluginsRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface IPluginsRepo {

export default function (): IPluginsRepo {
const _registeredPlugins: IRegisteredPlugin[] = [];

return {
registerPlugin(path: string, plugin: IPluginInfos): IRegisteredPlugin {
const pluginToRegister = {path, infos: {...plugin}};
Expand All @@ -18,7 +19,7 @@ export default function (): IPluginsRepo {
return pluginToRegister;
},
getRegisteredPlugins(): IRegisteredPlugin[] {
return _registeredPlugins;
return _registeredPlugins.sort((a, b) => a.infos.name.localeCompare(b.infos.name));
}
};
}
Loading