Skip to content

Commit

Permalink
Lint code with ESLint and Prettier
Browse files Browse the repository at this point in the history
Triggered by 4d3c3d8 on branch refs/heads/agent-merging
  • Loading branch information
maxpatiiuk authored and github-actions[bot] committed Mar 21, 2023
1 parent 4d3c3d8 commit 185c27b
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion specifyweb/frontend/js_src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ This will generate a report that can be opened in your browser.
To learn more about how to analyze your report, check out this blog post
(https://blog.jakoblind.no/webpack-bundle-analyzer/#what-should-i-look-for-in-the-reports).
It provides some helpful tips on what to look for in the report and how to
optimize your webpack configuration to improve your bundle size and
optimize your webpack configuration to improve your bundle size and
4 changes: 2 additions & 2 deletions specifyweb/frontend/js_src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@

.link {
@apply inline-flex cursor-pointer items-center gap-2
text-black active:underline enabled:hover:text-brand-300 disabled:!ring-0
dark:text-gray-200 text-left;
text-left text-black active:underline enabled:hover:text-brand-300
disabled:!ring-0 dark:text-gray-200;
}

a.link {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function AppResourceEditor({

return typeof resourceData === 'object' ? (
<Container.Base className="flex-1 overflow-auto">
<DataEntry.Header className='flex-wrap'>
<DataEntry.Header className="flex-wrap">
<div className="flex items-center justify-center gap-2">
<div className="hidden md:block">
{appResourceIcon(getResourceType(resource))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {removeKey} from '../../utils/utils';
import {assert} from '../Errors/assert';
import {softFail} from '../Errors/Crash';
import {Backbone} from './backbone';
import {specialFields} from './helpers';
import {attachBusinessRules} from './businessRules';
import {initializeResource} from './domain';
import {specialFields} from './helpers';
import {
getFieldsToNotClone,
getResourceApiUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* schema, but it's here for now.
*/

import type { RR, Writable } from '../../utils/types';
import { load } from '../InitialContext';
import type { SpecifyModel } from './specifyModel';
import type { RR, Writable } from '../../utils/types';
import type { Tables } from './types';

export type Schema = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import type { LocalizedString } from 'typesafe-i18n';

import { commonText } from '../../localization/common';
import { getCache } from '../../utils/cache';
import { f } from '../../utils/functools';
import type { IR, R, RA } from '../../utils/types';
import { defined, filterArray } from '../../utils/types';
import { camelToHuman, multiSortFunction } from '../../utils/utils';
import { error } from '../Errors/assert';
import { attachmentView } from '../FormParse/webOnlyViews';
import { parentTableRelationship } from '../Forms/parentTables';
import { relationshipIsToMany } from '../WbPlanView/mappingHelpers';
import {
DependentCollection,
Expand All @@ -37,8 +39,6 @@ import {
type RelationshipDefinition,
LiteralField,
} from './specifyField';
import { parentTableRelationship } from '../Forms/parentTables';
import { f } from '../../utils/functools';

type FieldAlias = {
readonly vname: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { mainText } from '../../localization/main';
import type { AjaxErrorMode } from '../../utils/ajax';
import { Http } from '../../utils/ajax/definitions';
import type { RA, WritableArray } from '../../utils/types';
import { jsonStringify } from '../../utils/utils';
Expand All @@ -12,7 +13,6 @@ import { PermissionError } from '../Permissions/PermissionDenied';
import { unsafeTriggerNotFound } from '../Router/Router';
import { ErrorDialog } from './ErrorDialog';
import { formatJsonBackendResponse } from './JsonError';
import { AjaxErrorMode } from '../../utils/ajax';
import { produceStackTrace } from './stackTrace';

export function formatError(
Expand Down Expand Up @@ -185,9 +185,9 @@ export function handleAjaxError(
displayError(({ onClose: handleClose }) => (
<ErrorDialog
copiableMessage={copiableMessage}
dismissible={errorMode === 'dismissible'}
header={mainText.errorOccurred()}
onClose={handleClose}
dismissible={errorMode === 'dismissible'}
>
{errorObject}
</ErrorDialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Promise.all(
.then(async ({ fetchContext }) => fetchContext)
.then((schema) => removeKey(schema, 'models')),
remotePrefs: import('../InitialContext/remotePrefs').then(
({ fetchContext }) => fetchContext
async ({ fetchContext }) => fetchContext
),
userPreferences: import('../UserPreferences/helpers').then(
({ preferencesPromise, getRawUserPreferences }) =>
async ({ preferencesPromise, getRawUserPreferences }) =>
preferencesPromise.then(() => getRawUserPreferences())
),
userInformation: import('../InitialContext/userInformation').then(
({ fetchContext }) => fetchContext
async ({ fetchContext }) => fetchContext
),
}).map(async ([key, promise]) => {
resolvedStackTrace[key] = await promise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useAsyncState } from '../../hooks/useAsyncState';
import { commonText } from '../../localization/common';
import { formsText } from '../../localization/forms';
import { f } from '../../utils/functools';
import type { ValueOf } from '../../utils/types';
import { DataEntry } from '../Atoms/DataEntry';
import type { AnySchema } from '../DataModel/helperTypes';
import type { SpecifyResource } from '../DataModel/legacyTypes';
Expand All @@ -18,7 +19,6 @@ import type { cellAlign, CellTypes } from '../FormParse/cells';
import { SpecifyForm } from '../Forms/SpecifyForm';
import { SubView } from '../Forms/SubView';
import { TableIcon } from '../Molecules/TableIcon';
import { ValueOf } from '../../utils/types';
import { relationshipIsToMany } from '../WbPlanView/mappingHelpers';
import { FormTableInteraction } from './FormTableInteraction';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export function CollectionOneToManyPlugin({
readonly collectionName: string;
}
>
| State<'SearchState'>
| State<'MainState'>
| State<'SearchState'>
>({ type: 'MainState' });

const existingItemFilter =
Expand Down Expand Up @@ -190,8 +190,8 @@ export function CollectionOneToManyPlugin({
},
]}
forceCollection={data.otherCollection.id}
multiple
model={schema.models.CollectionObject}
multiple
onClose={(): void => setState({ type: 'MainState' })}
onSelected={(addedResources): void => {
const addedRelationships = addedResources.map((addedResource) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { strictGetModel } from '../DataModel/schema';
import type { Tables } from '../DataModel/types';
import { loadingBar } from '../Molecules';
import { Dialog, dialogClassNames } from '../Molecules/Dialog';
import { FormattedResource } from '../Molecules/FormattedResource';
import { TableIcon } from '../Molecules/TableIcon';
import { createQuery } from '../QueryBuilder';
import { queryFieldFilters } from '../QueryBuilder/FieldFilter';
import { QueryFieldSpec } from '../QueryBuilder/fieldSpec';
import { FormattedResource } from '../Molecules/FormattedResource';
import { TableIcon } from '../Molecules/TableIcon';
import type { DeleteBlocker } from './DeleteBlocked';
import { DeleteBlockers } from './DeleteBlocked';
import { parentTableRelationship } from './parentTables';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ export function ResourceView<SCHEMA extends AnySchema>({
}`,
content: `${className.formStyles} ${dialogClassNames.flexContent}`,
}}
header={customTitle ?? title}
dimensionsKey={viewName ?? resource?.specifyModel.view}
header={customTitle ?? title}
headerButtons={
<>
{headerButtons?.(specifyNetworkBadge) ?? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { usePref } from '../UserPreferences/usePref';
import { rawMenuItemsPromise } from './menuItemDefinitions';
import { rawUserToolsPromise } from './userToolDefinitions';

const itemsPromise = f.store(() =>
const itemsPromise = f.store(async () =>
f.all({
menuItems: rawMenuItemsPromise,
userTools: rawUserToolsPromise,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import { useCachedState } from '../../hooks/useCachedState';
import { f } from '../../utils/functools';
import type { RA } from '../../utils/types';
import { Form } from '../Atoms/Form';
import { deserializeResource, specialFields } from '../DataModel/helpers';
Expand All @@ -12,7 +13,6 @@ import { strictDependentFields } from '../FormMeta/CarryForward';
import { relationshipIsToMany } from '../WbPlanView/mappingHelpers';
import { CompareField } from './CompareField';
import { MergingHeader } from './Header';
import { f } from '../../utils/functools';

export function CompareRecords({
formId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import type { RA } from '../../utils/types';
import { Button } from '../Atoms/Button';
import type { AnySchema } from '../DataModel/helperTypes';
import type { SpecifyResource } from '../DataModel/legacyTypes';
import { resourceEvents } from '../DataModel/resource';
import { ResourceView } from '../Forms/ResourceView';
import { DateElement } from '../Molecules/DateElement';
import { dialogClassNames } from '../Molecules/Dialog';
import { FormattedResource } from '../Molecules/FormattedResource';
import { TableIcon } from '../Molecules/TableIcon';
import { MergeButton } from './CompareField';
import { UsagesSection } from './Usages';
import { resourceEvents } from '../DataModel/resource';

export function MergingHeader({
merged,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import type { SpecifyModel } from '../DataModel/specifyModel';
import type { AgentVariant, Tables } from '../DataModel/types';
import { strictDependentFields } from '../FormMeta/CarryForward';
import { format } from '../Forms/dataObjFormatters';
import { getUserPref } from '../UserPreferences/helpers';
import { relationshipIsToMany } from '../WbPlanView/mappingHelpers';
import { unMergeableFields } from './Compare';
import { getUserPref } from '../UserPreferences/helpers';

/**
* Automatically merge n records into one. Used for smart defaults
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { useNavigate } from 'react-router-dom';
import { useSearchParameter } from '../../hooks/navigation';

import { useSearchParameter } from '../../hooks/navigation';
import { commonText } from '../../localization/common';
import { queryText } from '../../localization/query';
import { wbPlanText } from '../../localization/wbPlan';
Expand Down
6 changes: 4 additions & 2 deletions specifyweb/frontend/js_src/lib/components/Toolbar/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ function QueryList({
<tr key={query.id} title={query.remarks ?? undefined}>
<td>
<Link.Default
// BUG: consider applying these styles everywhere
// className="max-w-full overflow-auto text-left"
/*
* BUG: consider applying these styles everywhere
* className="max-w-full overflow-auto text-left"
*/
className="overflow-x-auto"
href={
getQuerySelectUrl?.(query) ?? `/specify/query/${query.id}/`
Expand Down

0 comments on commit 185c27b

Please sign in to comment.