From 184e4f2216918ca3923f595ec8605de5c7dfca7f Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 4 Apr 2024 04:48:41 +0530 Subject: [PATCH] #276 cleanup --- backend/composer/models.py | 2 - frontend/src/apiclient/backend/api.ts | 295 ------------------ .../Widgets/CustomEntitiesDropdown.tsx | 4 +- openapi/openapi.yaml | 164 ---------- 4 files changed, 2 insertions(+), 463 deletions(-) diff --git a/backend/composer/models.py b/backend/composer/models.py index 60bca981..2243778f 100644 --- a/backend/composer/models.py +++ b/backend/composer/models.py @@ -99,7 +99,6 @@ def excluding_draft(self): return self.get_queryset().exclude(state=CSState.DRAFT) - class SentenceStatementManager(models.Manager): def get_queryset(self): return ( @@ -121,7 +120,6 @@ def get_queryset(self): ) - class ViaManager(models.Manager): def get_queryset(self): return ( diff --git a/frontend/src/apiclient/backend/api.ts b/frontend/src/apiclient/backend/api.ts index 4427a6be..95a94c01 100644 --- a/frontend/src/apiclient/backend/api.ts +++ b/frontend/src/apiclient/backend/api.ts @@ -674,67 +674,6 @@ export interface DestinationSerializerDetails { } -/** - * Generic Connectivity Statement - * @export - * @interface GenericConnectivityStatement - */ -export interface GenericConnectivityStatement { - /** - * - * @type {number} - * @memberof GenericConnectivityStatement - */ - 'id': number | null; - /** - * - * @type {number} - * @memberof GenericConnectivityStatement - */ - 'sentence_id'?: number; - /** - * - * @type {Array} - * @memberof GenericConnectivityStatement - */ - 'species'?: Array; - /** - * - * @type {Array} - * @memberof GenericConnectivityStatement - */ - 'origins'?: Array; - /** - * - * @type {Array} - * @memberof GenericConnectivityStatement - */ - 'vias'?: Array; - /** - * - * @type {Array} - * @memberof GenericConnectivityStatement - */ - 'destinations'?: Array; - /** - * - * @type {string} - * @memberof GenericConnectivityStatement - */ - 'apinatomy_model'?: string | null; - /** - * - * @type {number} - * @memberof GenericConnectivityStatement - */ - 'phenotype_id'?: number | null; - /** - * - * @type {Phenotype} - * @memberof GenericConnectivityStatement - */ - 'phenotype': Phenotype; -} /** * * @export @@ -967,37 +906,6 @@ export interface PaginatedDestinationList { */ 'results'?: Array; } -/** - * - * @export - * @interface PaginatedGenericConnectivityStatementList - */ -export interface PaginatedGenericConnectivityStatementList { - /** - * - * @type {number} - * @memberof PaginatedGenericConnectivityStatementList - */ - 'count'?: number; - /** - * - * @type {string} - * @memberof PaginatedGenericConnectivityStatementList - */ - 'next'?: string | null; - /** - * - * @type {string} - * @memberof PaginatedGenericConnectivityStatementList - */ - 'previous'?: string | null; - /** - * - * @type {Array} - * @memberof PaginatedGenericConnectivityStatementList - */ - 'results'?: Array; -} /** * * @export @@ -2800,121 +2708,6 @@ export const ComposerApiAxiosParamCreator = function (configuration?: Configurat options: localVarRequestOptions, }; }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {Array} [destinationUris] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {Array} [ordering] Ordering - * @param {Array} [originUris] - * @param {Array} [populationUris] - * @param {Array} [viaUris] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - composerConnectivityStatementGenericList: async (destinationUris?: Array, limit?: number, offset?: number, ordering?: Array, originUris?: Array, populationUris?: Array, viaUris?: Array, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/composer/connectivity-statement-generic/`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication tokenAuth required - await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) - - // authentication cookieAuth required - - if (destinationUris) { - localVarQueryParameter['destination_uris'] = destinationUris; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (offset !== undefined) { - localVarQueryParameter['offset'] = offset; - } - - if (ordering) { - localVarQueryParameter['ordering'] = ordering.join(COLLECTION_FORMATS.csv); - } - - if (originUris) { - localVarQueryParameter['origin_uris'] = originUris; - } - - if (populationUris) { - localVarQueryParameter['population_uris'] = populationUris; - } - - if (viaUris) { - localVarQueryParameter['via_uris'] = viaUris; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {number} id A unique integer value identifying this connectivity statement. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - composerConnectivityStatementGenericRetrieve: async (id: number, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - assertParamExists('composerConnectivityStatementGenericRetrieve', 'id', id) - const localVarPath = `/api/composer/connectivity-statement-generic/{id}/` - .replace(`{${"id"}}`, encodeURIComponent(String(id))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication basicAuth required - // http basic authentication required - setBasicAuthToObject(localVarRequestOptions, configuration) - - // authentication tokenAuth required - await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) - - // authentication cookieAuth required - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * ConnectivityStatement * @param {Array} [destinations] @@ -5053,32 +4846,6 @@ export const ComposerApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.composerConnectivityStatementDoTransitionCreate(id, transition, connectivityStatement, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {Array} [destinationUris] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {Array} [ordering] Ordering - * @param {Array} [originUris] - * @param {Array} [populationUris] - * @param {Array} [viaUris] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async composerConnectivityStatementGenericList(destinationUris?: Array, limit?: number, offset?: number, ordering?: Array, originUris?: Array, populationUris?: Array, viaUris?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.composerConnectivityStatementGenericList(destinationUris, limit, offset, ordering, originUris, populationUris, viaUris, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {number} id A unique integer value identifying this connectivity statement. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async composerConnectivityStatementGenericRetrieve(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.composerConnectivityStatementGenericRetrieve(id, options); - return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); - }, /** * ConnectivityStatement * @param {Array} [destinations] @@ -5671,30 +5438,6 @@ export const ComposerApiFactory = function (configuration?: Configuration, baseP composerConnectivityStatementDoTransitionCreate(id: number, transition: string, connectivityStatement?: ConnectivityStatement, options?: any): AxiosPromise { return localVarFp.composerConnectivityStatementDoTransitionCreate(id, transition, connectivityStatement, options).then((request) => request(axios, basePath)); }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {Array} [destinationUris] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {Array} [ordering] Ordering - * @param {Array} [originUris] - * @param {Array} [populationUris] - * @param {Array} [viaUris] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - composerConnectivityStatementGenericList(destinationUris?: Array, limit?: number, offset?: number, ordering?: Array, originUris?: Array, populationUris?: Array, viaUris?: Array, options?: any): AxiosPromise { - return localVarFp.composerConnectivityStatementGenericList(destinationUris, limit, offset, ordering, originUris, populationUris, viaUris, options).then((request) => request(axios, basePath)); - }, - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {number} id A unique integer value identifying this connectivity statement. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - composerConnectivityStatementGenericRetrieve(id: number, options?: any): AxiosPromise { - return localVarFp.composerConnectivityStatementGenericRetrieve(id, options).then((request) => request(axios, basePath)); - }, /** * ConnectivityStatement * @param {Array} [destinations] @@ -6269,34 +6012,6 @@ export class ComposerApi extends BaseAPI { return ComposerApiFp(this.configuration).composerConnectivityStatementDoTransitionCreate(id, transition, connectivityStatement, options).then((request) => request(this.axios, this.basePath)); } - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {Array} [destinationUris] - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {Array} [ordering] Ordering - * @param {Array} [originUris] - * @param {Array} [populationUris] - * @param {Array} [viaUris] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ComposerApi - */ - public composerConnectivityStatementGenericList(destinationUris?: Array, limit?: number, offset?: number, ordering?: Array, originUris?: Array, populationUris?: Array, viaUris?: Array, options?: AxiosRequestConfig) { - return ComposerApiFp(this.configuration).composerConnectivityStatementGenericList(destinationUris, limit, offset, ordering, originUris, populationUris, viaUris, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * GenericConnectivityStatement that only allows GET to get the list of ConnectivityStatements - * @param {number} id A unique integer value identifying this connectivity statement. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ComposerApi - */ - public composerConnectivityStatementGenericRetrieve(id: number, options?: AxiosRequestConfig) { - return ComposerApiFp(this.configuration).composerConnectivityStatementGenericRetrieve(id, options).then((request) => request(this.axios, this.basePath)); - } - /** * ConnectivityStatement * @param {Array} [destinations] @@ -6803,16 +6518,6 @@ export class ComposerApi extends BaseAPI { } } -/** - * @export - */ -export const ComposerConnectivityStatementGenericListOrderingEnum = { - Id: '-id', - LastEdited: '-last_edited', - Id2: 'id', - LastEdited2: 'last_edited' -} as const; -export type ComposerConnectivityStatementGenericListOrderingEnum = typeof ComposerConnectivityStatementGenericListOrderingEnum[keyof typeof ComposerConnectivityStatementGenericListOrderingEnum]; /** * @export */ diff --git a/frontend/src/components/Widgets/CustomEntitiesDropdown.tsx b/frontend/src/components/Widgets/CustomEntitiesDropdown.tsx index 5bac83f5..2b3eb8f0 100644 --- a/frontend/src/components/Widgets/CustomEntitiesDropdown.tsx +++ b/frontend/src/components/Widgets/CustomEntitiesDropdown.tsx @@ -256,7 +256,7 @@ export default function CustomEntitiesDropdown({ {}, ); - const isInputInGroupOptionContent = (option: Option, inputValue: string) => { + const isInOptions = (option: Option, inputValue: string) => { return option.content.map((content) => content.value.toLowerCase()) .join(' ').includes(inputValue.toLowerCase()); } @@ -714,7 +714,7 @@ export default function CustomEntitiesDropdown({
    { groupedOptions[group] - .filter((option: Option) => isInputInGroupOptionContent(option, inputValue || '')) + .filter((option: Option) => isInOptions(option, inputValue || '')) .map((option: Option) => (