Skip to content
Merged
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
24 changes: 1 addition & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,7 @@
"camelCase": true,
"pascalCase": true
},
// TODO - most can be renamed although holding off until after #1501 and #1533 merged
"ignore": [
"docusaurus.config.gh-pages.js",
"install-clean.ts",
"SWUpdateNotification.tsx",
"react-app-env.d.ts",
"service-worker.ts",
"AbstractDBClient.ts",
"react-firebase-file-uploader.d.ts",
"reset-staging-site.ts",
"post-cra-build.ts",
"user_pp.mock.tsx",
"user_pp.models.tsx",
"admin-subheader.tsx",
"admin-approvals.tsx",
"admin-howtos.tsx",
"admin-mappins.tsx",
"admin-research-detail.tsx",
"admin-research.tsx",
"admin-tags.tsx",
"admin-user-detail.tsx",
"admin-users.tsx"
]
"ignore": ["react-app-env.d.ts", "service-worker.ts"]
}
],
"@typescript-eslint/no-empty-function": "off",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reset-staging-site.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Action to allow trigger of the firebase project migration script, used to reset the staging site
# For more info see the script file (/scripts/maintenance/reset-staging-site)
# For more info see the script file (/scripts/maintenance/resetStagingSite.ts)
name: Reset Staging Site
on:
# Run weekly on a Sunday at 02:00
Expand Down Expand Up @@ -42,4 +42,4 @@ jobs:
env:
ONEARMY_MIGRATOR_SERVICE_ACCOUNT_JSON: ${{secrets.ONEARMY_MIGRATOR_SERVICE_ACCOUNT_JSON}}
- name: Run db migration script
run: ts-node --project scripts/tsconfig.json scripts/maintenance/reset-staging-site.ts
run: ts-node --project scripts/tsconfig.json scripts/maintenance/resetStagingSite.ts.ts
14 changes: 14 additions & 0 deletions packages/documentation/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"rules": {
"unicorn/filename-case": [
"error",
{
"cases": {
"camelCase": true,
"pascalCase": true
},
"ignore": ["docusaurus.config.gh-pages.js"]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Currently this can be done in a semi-automated way using a script in the scripts

```
cd scripts
ts-node ./maintenance/reset-staging-site.ts
ts-node ./maintenance/resetStagingSite.ts
```

:::note
This script requires access to a service worker with specific permissions for source and target projects, and intermediate storage buckets.
:::

For more information about the script and known limitations see the source code at [scripts/maintenance/reset-staging-site.ts](https://github.com/ONEARMY/community-platform/blob/master/scripts/maintenance/reset-staging-site.ts).
For more information about the script and known limitations see the source code at [scripts/maintenance/resetStagingSite.ts](https://github.com/ONEARMY/community-platform/blob/master/scripts/maintenance/resetStagingSite.ts).

The script is currently run weekly via the github action, see the source code at [.github/workflows/reset-staging-site.yml](https://github.com/ONEARMY/community-platform/blob/master/.github/workflows/reset-staging-site.yml))
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const COLLECTION_IDS = Object.values(DB_ENDPOINTS)
*
* Example execution
* ```
ts-node --project scripts/tsconfig.json scripts/maintenance/reset-staging-site.ts
ts-node --project scripts/tsconfig.json scripts/maintenance/resetStagingSite.ts.ts
```
Also available as a github action in the /.github/reset-staging-site.yml
*/
Expand Down
4 changes: 2 additions & 2 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "oa-scripts",
"version": "1.0.0",
"scripts": {
"install:clean": "ts-node ./install-clean.ts",
"post-cra-build": "ts-node ./post-cra-build.ts"
"install:clean": "ts-node ./installClean.ts",
"post-cra-build": "ts-node ./postCraBuild.ts"
},
"dependencies": {
"cheerio": "^1.0.0-rc.10",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export * from './project.models'
export * from './selectorList.models'
export * from './tags.model'
export * from './user.models'
export * from './user_pp.models'
export * from './userPreciousPlastic.models'

export interface UserComment extends IComment {
isEditable: boolean
Expand Down
2 changes: 1 addition & 1 deletion src/models/maps.models.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ISODateString, IModerable } from './common.models'
import type { WorkspaceType } from './user_pp.models'
import type { WorkspaceType } from './userPreciousPlastic.models'
import type { ProfileTypeLabel } from '../modules/profile/types'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/modules/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { IPageMeta } from 'src/pages/PageList'
import { AdminStoreV2Context, AdminStoreV2 } from './admin.storeV2'
import { MODULE } from '..'
import adminRoutes from './admin.routes'
import AdminSubheader from './components/admin-subheader'
import AdminSubheader from './components/AdminSubheader'
import { AuthRoute } from 'src/pages/common/AuthRoute'

const moduleName = MODULE.ADMIN
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { Card, Flex, Heading, Box, Text } from 'theme-ui'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import type { ThemeStore } from 'src/stores/Theme/theme.store'
import type { UserStore } from 'src/stores/User/user.store'
import { observer, inject } from 'mobx-react'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Settings/Template.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import type { IUser } from 'src/models/user.models'
import { ProfileType } from 'src/modules/profile/types'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import type { IPlasticType } from 'src/models'

import { Flex, Heading, Box, Text, Grid } from 'theme-ui'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FieldArray } from 'react-final-form-arrays'
import { ProfileLinkField } from './Fields/ProfileLink.field'
import { FlexSectionContainer } from './elements'
import { required } from 'src/utils/validators'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import { ImageInputField } from 'src/common/Form/ImageInput.field'
import type { IUser } from 'src/models'
import type { IUploadedFileMeta } from 'src/stores/storage'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/content/MemberProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'src/assets/css/slick.min.css'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import type { IUploadedFileMeta } from 'src/stores/storage'

import { Box, Image, Flex, Heading, Card, Paragraph } from 'theme-ui'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/content/SpaceProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
IMAchineBuilderXp,
IOpeningHours,
PlasticTypeLabel,
} from 'src/models/user_pp.models'
} from 'src/models/userPreciousPlastic.models'

import { Heading, Box, Image, Flex, Paragraph } from 'theme-ui'
// import slick and styles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { logger } from 'src/logger'
* and refresh the page the next time the user attemps a navigation action
**/

export const SWUpdateNotification = memo(() => {
export const ServiceWorkerUpdateNotification = memo(() => {
const [reloadRequired, setReloadRequired] = useState(false)
const [swLoaded, setSWLoaded] = useState(false)

Expand Down Expand Up @@ -45,4 +45,4 @@ export const SWUpdateNotification = memo(() => {
</>
)
})
SWUpdateNotification.displayName = 'SWUpdateNotification'
ServiceWorkerUpdateNotification.displayName = 'ServiceWorkerUpdateNotification'
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import GoogleAnalytics from 'src/pages/common/GoogleAnalytics'
import { NotFoundPage } from './NotFound/NotFound'
import ScrollToTop from '../common/ScrollToTop'
import Header from './common/Header/Header'
import { SWUpdateNotification } from 'src/pages/common/SWUpdateNotification/SWUpdateNotification'
import { ServiceWorkerUpdateNotification } from 'src/pages/common/ServiceWorkerUpdateNotification/ServiceWorkerUpdateNotification'
import Main from 'src/pages/common/Layout/Main'
import type { IPageMeta } from './PageList'
import {
Expand Down Expand Up @@ -48,7 +48,7 @@ export class Routes extends React.Component<
data-cy="page-container"
>
<BrowserRouter>
<SWUpdateNotification />
<ServiceWorkerUpdateNotification />
<GoogleAnalytics />
{/* on page change scroll to top */}
<ScrollToTop>
Expand Down
2 changes: 1 addition & 1 deletion src/stores/Maps/maps.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ModuleStore } from '../common/module.store'
import { getUserAvatar } from '../User/user.store'
import { MAP_GROUPINGS } from './maps.groupings'
import { generatePins, generatePinDetails } from 'src/stores/Maps/generatePins'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import type { IUploadedFileMeta } from '../storage'
import {
hasAdminRights,
Expand Down
2 changes: 1 addition & 1 deletion src/stores/User/notifications.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ModuleStore } from '../common/module.store'
import { COLLECTION_NAME as USER_COLLECTION_NAME } from './user.store'

import type { RootStore } from '..'
import type { IUserPP } from 'src/models/user_pp.models'
import type { IUserPP } from 'src/models/userPreciousPlastic.models'
import { logger } from 'src/logger'

// const COLLECTION_NAME = 'user_notifications'
Expand Down
2 changes: 1 addition & 1 deletion src/stores/User/user.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ModuleStore } from '../common/module.store'
import { Storage } from '../storage'

import type { IUser, IUserBadges, IUserDB } from 'src/models/user.models'
import type { IUserPP, IUserPPDB } from 'src/models/user_pp.models'
import type { IUserPP, IUserPPDB } from 'src/models/userPreciousPlastic.models'
import type { IFirebaseUser } from 'src/utils/firebase'
import type { RootStore } from '..'
import type { IConvertedFileMeta } from 'src/types'
Expand Down
4 changes: 2 additions & 2 deletions src/stores/databaseV2/clients/dexie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Dexie from 'dexie'
import type {
DBQueryOptions,
DBQueryWhereOptions,
AbstractDBClient,
AbstractDatabaseClient,
} from '../types'
import { DB_QUERY_DEFAULTS } from '../utils/db.utils'
import { DB_ENDPOINTS } from '../endpoints'
Expand All @@ -18,7 +18,7 @@ const DB_CACHE_NUMBER = 20230105
const CACHE_DB_NAME = 'OneArmyCache'
const db = new Dexie(CACHE_DB_NAME)

export class DexieClient implements AbstractDBClient {
export class DexieClient implements AbstractDatabaseClient {
constructor() {
this._init()
}
Expand Down
4 changes: 2 additions & 2 deletions src/stores/databaseV2/clients/firestore.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { IDBEndpoint, DBDoc } from 'src/models/common.models'
import { firestore } from 'src/utils/firebase'
import type { DBQueryOptions, AbstractDBClient } from '../types'
import type { DBQueryOptions, AbstractDatabaseClient } from '../types'
import type { Observer } from 'rxjs'
import { Observable } from 'rxjs'
import { DB_QUERY_DEFAULTS } from '../utils/db.utils'

const db = firestore

export class FirestoreClient implements AbstractDBClient {
export class FirestoreClient implements AbstractDatabaseClient {
/************************************************************************
* Main Methods - taken from abstract class
***********************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions src/stores/databaseV2/clients/rtdb.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { IDBEndpoint, DBDoc } from 'src/models/common.models'
import { rtdb } from 'src/utils/firebase'
import type { AbstractDBClient } from '../types'
import type { AbstractDatabaseClient } from '../types'

const db = rtdb

export class RealtimeDBClient implements AbstractDBClient {
export class RealtimeDBClient implements AbstractDatabaseClient {
/************************************************************************
* Main Methods - taken from abstract class
***********************************************************************/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Observable } from 'rxjs'
import type { DBDoc, DBQueryOptions } from '../types'
import type { DBDoc, DBQueryOptions } from '.'

export interface AbstractDBClient {
export interface AbstractDatabaseClient {
getDoc<T>(endpoint: string, docId: string): Promise<(T & DBDoc) | undefined>

setDoc(endpoint: string, doc: any): Promise<void>
Expand Down
8 changes: 4 additions & 4 deletions src/stores/databaseV2/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* API items. On a detail page for a single item, the summary will be
* shown followed by the remarks section (if any).
*/
export type { AbstractDBClient } from './DBClient'
export type { AbstractDatabaseClient } from './DBClient'

/**
* The `DBClients` consists of separate databases for use online and offline.
Expand All @@ -17,9 +17,9 @@ export type { AbstractDBClient } from './DBClient'
* large collections in a more economical way than firestore
*/
export interface DBClients {
cacheDB: AbstractDBClient
serverDB: AbstractDBClient
serverCacheDB: AbstractDBClient
cacheDB: AbstractDatabaseClient
serverDB: AbstractDatabaseClient
serverCacheDB: AbstractDatabaseClient
}

/**
Expand Down
5 changes: 5 additions & 0 deletions types/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"unicorn/filename-case": ["off"]
}
}