-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'edge' into api-remove_old_lpc_setup_command_accommodations
- Loading branch information
Showing
717 changed files
with
27,311 additions
and
36,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
api-client/src/deck_configuration/createDeckConfiguration.ts
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
api-client/src/deck_configuration/deleteDeckConfiguration.ts
This file was deleted.
Oops, something went wrong.
23 changes: 10 additions & 13 deletions
23
api-client/src/deck_configuration/getDeckConfiguration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
// import { GET, request } from '../request' | ||
import { DECK_CONFIG_STUB } from './__stubs__' | ||
import { GET, request } from '../request' | ||
|
||
import type { DeckConfiguration } from '@opentrons/shared-data' | ||
// import type { ResponsePromise } from '../request' | ||
import type { ResponsePromise } from '../request' | ||
import type { HostConfig } from '../types' | ||
|
||
// TODO(bh, 2023-09-26): uncomment and remove deck config stub when backend api is ready | ||
// export function getDeckConfiguration( | ||
// config: HostConfig | ||
// ): ResponsePromise<DeckConfiguration> { | ||
// return request<DeckConfiguration>(GET, `/deck_configuration`, null, config) | ||
// } | ||
import type { DeckConfigurationResponse } from './types' | ||
|
||
export function getDeckConfiguration( | ||
config: HostConfig | ||
): Promise<{ data: DeckConfiguration }> { | ||
return Promise.resolve({ data: Object.values(DECK_CONFIG_STUB) }) | ||
): ResponsePromise<DeckConfigurationResponse> { | ||
return request<DeckConfigurationResponse>( | ||
GET, | ||
`/deck_configuration`, | ||
null, | ||
config | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export { createDeckConfiguration } from './createDeckConfiguration' | ||
export { deleteDeckConfiguration } from './deleteDeckConfiguration' | ||
export { getDeckConfiguration } from './getDeckConfiguration' | ||
export { updateDeckConfiguration } from './updateDeckConfiguration' | ||
|
||
export type { | ||
DeckConfigurationResponse, | ||
UpdateDeckConfigurationRequest, | ||
} from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { DeckConfiguration } from '@opentrons/shared-data' | ||
|
||
export interface UpdateDeckConfigurationRequest { | ||
data: { | ||
cutoutFixtures: DeckConfiguration | ||
} | ||
} | ||
|
||
export interface DeckConfigurationResponse { | ||
data: { | ||
cutoutFixtures: DeckConfiguration | ||
lastUpdatedAt: string | ||
} | ||
} |
41 changes: 15 additions & 26 deletions
41
api-client/src/deck_configuration/updateDeckConfiguration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
import { v4 as uuidv4 } from 'uuid' | ||
import { PUT, request } from '../request' | ||
|
||
// import { PATCH, request } from '../request' | ||
import { DECK_CONFIG_STUB } from './__stubs__' | ||
|
||
import type { Fixture } from '@opentrons/shared-data' | ||
// import type { ResponsePromise } from '../request' | ||
import type { DeckConfiguration } from '@opentrons/shared-data' | ||
import type { ResponsePromise } from '../request' | ||
import type { HostConfig } from '../types' | ||
|
||
// TODO(bh, 2023-09-26): uncomment and remove deck config stub when backend api is ready | ||
// export function updateDeckConfiguration( | ||
// config: HostConfig, | ||
// data: Omit<Fixture, 'fixtureId'> | ||
// ): ResponsePromise<Fixture> { | ||
// const { fixtureLocation, ...rest } = data | ||
// return request<Fixture, { data: Omit<Fixture, 'fixtureLocation'> }>( | ||
// PATCH, | ||
// `/deck_configuration/${fixtureLocation}`, | ||
// { data: rest }, | ||
// config | ||
// ) | ||
// } | ||
import type { | ||
DeckConfigurationResponse, | ||
UpdateDeckConfigurationRequest, | ||
} from './types' | ||
|
||
export function updateDeckConfiguration( | ||
config: HostConfig, | ||
data: Omit<Fixture, 'fixtureId'> | ||
): Promise<{ data: Fixture }> { | ||
const { fixtureLocation } = data | ||
const fixtureId = uuidv4() | ||
DECK_CONFIG_STUB[fixtureLocation] = { ...data, fixtureId } | ||
return Promise.resolve({ data: DECK_CONFIG_STUB[fixtureLocation] }) | ||
deckConfig: DeckConfiguration | ||
): ResponsePromise<DeckConfigurationResponse> { | ||
return request<DeckConfigurationResponse, UpdateDeckConfigurationRequest>( | ||
PUT, | ||
'/deck_configuration', | ||
{ data: { cutoutFixtures: deckConfig } }, | ||
config | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.