From cea92c394cd3a9b8a0999787fb7b5402ec61bba0 Mon Sep 17 00:00:00 2001 From: rachel2code Date: Wed, 24 Nov 2021 14:36:51 -0800 Subject: [PATCH] style: open source day batch #3 Fixes #1352 Signed-off-by: rachel2code Signed-off-by: Peter Somogyvari --- .../bookshelf/bookshelf-detail/bookshelf-detail.page.ts | 2 +- .../app/shipment/shipment-detail/shipment-detail.page.ts | 2 +- .../src/app/shipment/shipment-list/shipment-list.page.ts | 4 ++-- .../cactus-example-supply-chain-frontend/src/zone-flags.ts | 4 +++- extensions/cactus-plugin-object-store-ipfs/package.json | 2 +- .../typescript/fixtures/mock/ipfs/ipfs-files-api-mock.ts | 6 +++++- .../typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts | 4 +++- yarn.lock | 7 +------ 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/examples/cactus-example-supply-chain-frontend/src/app/bookshelf/bookshelf-detail/bookshelf-detail.page.ts b/examples/cactus-example-supply-chain-frontend/src/app/bookshelf/bookshelf-detail/bookshelf-detail.page.ts index 817bc80ea2c..758afa86812 100644 --- a/examples/cactus-example-supply-chain-frontend/src/app/bookshelf/bookshelf-detail/bookshelf-detail.page.ts +++ b/examples/cactus-example-supply-chain-frontend/src/app/bookshelf/bookshelf-detail/bookshelf-detail.page.ts @@ -79,7 +79,7 @@ export class BookshelfDetailPage implements OnInit { this.log.debug(`BambooHarvest IDs: %o`, this.bambooHarvestIds); } - onClickFormSubmit(value: any): void { + onClickFormSubmit(value: Bookshelf): void { this.log.debug("form submitted", value); this.bookshelf = value; this.modalController.dismiss(this.bookshelf); diff --git a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts index ad16378f344..07558f5b495 100644 --- a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts +++ b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts @@ -77,7 +77,7 @@ export class ShipmentDetailPage implements OnInit { this.log.debug(`BambooHarvest IDs: %o`, this.bookshelfIds); } - onClickFormSubmit(value: any): void { + onClickFormSubmit(value: Shipment): void { this.log.debug("form submitted", value); this.shipment = value; this.modalController.dismiss(this.shipment); diff --git a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-list/shipment-list.page.ts b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-list/shipment-list.page.ts index bcc9c2e03fc..e05d9a8c52c 100644 --- a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-list/shipment-list.page.ts +++ b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-list/shipment-list.page.ts @@ -53,7 +53,7 @@ export class ShipmentListPage implements OnInit { this.log.debug(`Fetched Shipment data: %o`, shipments); } - async clickShowDetail(shipment: Shipment) { + async clickShowDetail(shipment: Shipment): Promise { this.log.debug("clickShowDetail()", shipment); const modal = await this.modalController.create({ @@ -73,7 +73,7 @@ export class ShipmentListPage implements OnInit { } } - async clickAddNew() { + async clickAddNew(): Promise { this.log.debug(`clickAddNew()`); const modal = await this.modalController.create({ component: ShipmentDetailPage, diff --git a/examples/cactus-example-supply-chain-frontend/src/zone-flags.ts b/examples/cactus-example-supply-chain-frontend/src/zone-flags.ts index e999ae9d110..1009df5c78e 100644 --- a/examples/cactus-example-supply-chain-frontend/src/zone-flags.ts +++ b/examples/cactus-example-supply-chain-frontend/src/zone-flags.ts @@ -2,4 +2,6 @@ * Prevents Angular change detection from * running with certain Web Component callbacks */ -(window as any).__Zone_disable_customElements = true; +type WindowWithZone = Window & + typeof globalThis & { __Zone_disable_customElements: boolean }; +(window as WindowWithZone).__Zone_disable_customElements = true; diff --git a/extensions/cactus-plugin-object-store-ipfs/package.json b/extensions/cactus-plugin-object-store-ipfs/package.json index ccb2c8c0c44..98b53c8a569 100644 --- a/extensions/cactus-plugin-object-store-ipfs/package.json +++ b/extensions/cactus-plugin-object-store-ipfs/package.json @@ -83,6 +83,6 @@ "@types/express": "4.17.13", "express": "4.17.1", "ipfs-core-types": "0.6.1", - "multiformats": "9.4.6" + "multiformats": "9.4.9" } } diff --git a/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-files-api-mock.ts b/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-files-api-mock.ts index 7f763e09d80..050f10fe42e 100644 --- a/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-files-api-mock.ts +++ b/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-files-api-mock.ts @@ -1,4 +1,8 @@ +// Needed to disable the no-unused-vars check here because the file is full +// of unused method parameters given how this is a mock which doesn't do +// anything for the most part and that's by design. /* eslint-disable @typescript-eslint/no-unused-vars */ +import { CID } from "multiformats/cid"; import { API as FilesAPI, ChmodOptions, @@ -140,7 +144,7 @@ export class FilesApiMock implements FilesAPI { public async flush( ipfsPath: string, options?: AbortOptions | undefined, - ): Promise { + ): Promise { throw new RuntimeError("Method flush() not implemented"); } diff --git a/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts b/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts index 52ce2016b24..227f0ff1bc6 100644 --- a/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts +++ b/extensions/cactus-plugin-object-store-ipfs/src/test/typescript/fixtures/mock/ipfs/ipfs-http-client-mock.ts @@ -119,7 +119,9 @@ export class IpfsHttpClientMock implements IIpfsHttpClient { this.dag = {} as DAGAPI; this.dht = {} as DHTAPI; this.diag = {} as DiagAPI; - this.files = new FilesApiMock({ logLevel: this.options.logLevel }) as any; + this.files = new FilesApiMock({ + logLevel: this.options.logLevel, + }) as FilesAPI; this.key = {} as KeyAPI; this.log = {} as LogAPI; this.name = {} as NameAPI; diff --git a/yarn.lock b/yarn.lock index e2901365c77..77688168c10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17183,12 +17183,7 @@ multicodec@^1.0.0: buffer "^5.6.0" varint "^5.0.0" -multiformats@9.4.6: - version "9.4.6" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.4.6.tgz#d24b2e313ff3a3f8f48eef771d44fb329a354e56" - integrity sha512-ngZRO82P7mPvw/3gu5NQ2QiUJGYTS0LAxvQnEAlWCJakvn7YpK2VAd9JWM5oosYUeqoVbkylH/FsqRc4fc2+ag== - -multiformats@^9.0.0, multiformats@^9.4.1, multiformats@^9.4.2, multiformats@^9.4.5: +multiformats@9.4.9, multiformats@^9.0.0, multiformats@^9.4.1, multiformats@^9.4.2, multiformats@^9.4.5: version "9.4.9" resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.4.9.tgz#5d3c7cf8dfeef6bda2535d37fd0ac99b10a15046" integrity sha512-zA84TTJcRfRMpjvYqy63piBbSEdqlIGqNNSpP6kspqtougqjo60PRhIFo+oAxrjkof14WMCImvr7acK6rPpXLw==