Upgrade packages and Kanban fix (#237)

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-06 18:54:39 +02:00 committed by GitHub
parent 5ef57b2907
commit a87194dee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 1476 additions and 1617 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.heft/
lib/
_api-extractor-temp/
temp/
# Logs
*.log

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
"build": ""
},
"devDependencies": {
"@rushstack/heft":"^0.35.0",
"@rushstack/heft":"^0.41.1",
"eslint-config-standard-with-typescript":"^20.0.0"
},
"peerDependencies": {

View File

@ -18,7 +18,7 @@
"eslint-plugin-node":"11",
"eslint":"^7.32.0",
"simplytyped": "^3.3.0",
"@rushstack/heft": "^0.35.0"
"@rushstack/heft": "^0.41.1"
},
"dependencies": {
"@anticrm/platform": "~0.6.5",

View File

@ -5,8 +5,8 @@
"build": ""
},
"devDependencies": {
"@rushstack/heft-jest-plugin":"~0.1.15",
"@rushstack/heft":"^0.35.0",
"@rushstack/heft-jest-plugin":"^0.1.15",
"@rushstack/heft":"^0.41.1",
"eslint-config-standard-with-typescript":"^20.0.0"
},
"peerDependencies": {

View File

@ -17,7 +17,7 @@
"eslint-plugin-promise":"4",
"eslint-plugin-node":"11",
"eslint":"^7.32.0",
"@rushstack/heft": "^0.35.0"
"@rushstack/heft": "^0.41.1"
},
"dependencies": {
"intl-messageformat": "^9.7.1"

View File

@ -14,7 +14,7 @@
// limitations under the License.
//
import { Status, OK } from './status'
import { Status, OK, unknownError } from './status'
/**
* @public
@ -93,7 +93,7 @@ export async function monitor<T> (
void setPlatformStatus(OK) // eslint-disable-line no-void
return result
} catch (err) {
void setPlatformStatus(err) // eslint-disable-line no-void
void setPlatformStatus(unknownError(err)) // eslint-disable-line no-void
throw err
}
}

View File

@ -125,6 +125,7 @@ export const platformId = 'platform' as Plugin
export default plugin(platformId, {
status: {
OK: '' as StatusCode,
BadError: '' as StatusCode,
UnknownError: '' as StatusCode<{ message: string }>,
InvalidId: '' as StatusCode<{ id: string }>,

View File

@ -67,6 +67,12 @@ export class PlatformError<P extends Record<string, any>> extends Error {
*/
export const OK = new Status(Severity.OK, platform.status.OK, {})
/**
* Error Status
* @public
*/
export const ERROR = new Status(Severity.ERROR, platform.status.BadError, {})
/**
* @public
* @param message -
@ -80,6 +86,6 @@ export function unknownStatus (message: string): Status<{}> {
* Creates unknown error status
* @public
*/
export function unknownError (err: Error): Status {
return err instanceof PlatformError ? err.status : unknownStatus(err.message)
export function unknownError (err: unknown): Status {
return err instanceof PlatformError ? err.status : err instanceof Error ? unknownStatus(err.message) : ERROR
}

View File

@ -3,6 +3,6 @@
"Cancel": "Cancel",
"Minutes": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}",
"Hours": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}",
"Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}"
"Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}"
}
}

View File

@ -38,7 +38,7 @@ class Connection implements Storage {
constructor (private readonly url: string, private readonly handler: TxHander) {
}
private async openConnection (): Promise<WebSocket> {
private openConnection (): Promise<WebSocket> {
const websocket = new WebSocket(this.url)
websocket.onmessage = (event: MessageEvent) => {
const resp = readResponse(event.data)

View File

@ -47,14 +47,12 @@
function sort(states: State[]): State[] {
if (_space === undefined || states.length === 0) { return [] }
console.log(states)
const map = states.reduce((map, state) => { map.set(state._id, state); return map }, new Map<Ref<State>, State>())
console.log(_space.states)
return _space.states.map(id => map.get(id) as State )
}
function sortObjects<T extends Doc> (objects: T[]): T[] {
if (_space === undefined) { return [] }
if (_space === undefined || objects.length === 0) { return [] }
const map = objects.reduce((map, doc) => { map.set(doc._id, doc); return map }, new Map<Ref<Doc>, Doc>())
const x = _space.order.map(id => map.get(id) as T)
return x
@ -62,7 +60,7 @@
const statesQuery = createQuery()
$: statesQuery.query(core.class.State, { _id: { $in: _space?.states ?? [] } }, result => { states = sort(result) })
$: if (_space) statesQuery.query(core.class.State, { _id: { $in: _space.states } }, result => { states = sort(result); console.log('states', sort(result)) })
const query = createQuery()
$: query.query(_class, { space }, result => { objects = sortObjects(result) }, options)
@ -72,7 +70,6 @@
if (dragCard !== object) {
const dragover = objects.indexOf(object)
const dragging = objects.indexOf(dragCard)
console.log('dragover', dragover, dragging)
objects[dragover] = dragCard
objects[dragging] = object
}
@ -155,7 +152,7 @@
on:drop|preventDefault={() => {
move(j)
}}
> {j}
>
<svelte:component this={presenter} {object} draggable={true}
on:dragstart={() => {
dragCardInitialPosition = j

View File

@ -26,7 +26,7 @@
* Specify one of: "pnpmVersion", "npmVersion", or "yarnVersion". See the Rush documentation
* for details about these alternatives.
*/
"pnpmVersion": "6.14.5",
"pnpmVersion": "6.16.1",
// "npmVersion": "4.5.0",
// "yarnVersion": "1.9.4",

View File

@ -50,7 +50,7 @@ export class FullTextIndex extends TxProcessor implements Storage {
const docs = await this.adapter.search(query)
console.log(docs)
const ids = docs.map(doc => (doc.attachedTo ?? doc.id) as Ref<T>)
return this.dbStorage.findAll(_class, { _id: { $in: ids as any } }, options) // TODO: remove `as any`
return await this.dbStorage.findAll(_class, { _id: { $in: ids as any } }, options) // TODO: remove `as any`
}
private getFullTextAttributes (clazz: Ref<Class<Obj>>): AnyAttribute[] | undefined {

View File

@ -19,7 +19,7 @@
"eslint-plugin-node":"11",
"eslint":"^7.32.0",
"@types/ws":"^7.4.7",
"@rushstack/heft": "^0.35.0"
"@rushstack/heft": "^0.41.1"
},
"dependencies": {
"jwt-simple": "^0.5.6",