Skip to content

Commit

Permalink
rename files ui/sam components
Browse files Browse the repository at this point in the history
- add `Prompter` suffix to file name
- update all import following the renaming
  • Loading branch information
vicheey committed Nov 14, 2024
1 parent 02ed11a commit 726d3e5
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CloudFormationTemplateRegistry } from '../../../shared/fs/templateRegis
import { syncMementoRootKey } from '../../../shared/sam/sync'

import { createExitPrompter } from '../../../shared/ui/common/exitPrompter'
import { createTemplatePrompter, TemplateItem } from '../../../shared/ui/sam/samTemplate'
import { createTemplatePrompter, TemplateItem } from '../../../shared/ui/sam/templatePrompter'
import { Wizard } from '../../../shared/wizards/wizard'

export interface OpenTemplateParams {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/sam/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import * as vscode from 'vscode'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/samTemplate'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/templatePrompter'
import { ChildProcess } from '../utilities/processUtils'
import { addTelemetryEnvVar } from './cli/samCliInvokerUtils'
import { Wizard } from '../wizards/wizard'
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/shared/sam/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import { CancellationError } from '../utilities/timeoutUtils'
import { Wizard } from '../wizards/wizard'
import { addTelemetryEnvVar } from './cli/samCliInvokerUtils'
import { validateSamDeployConfig, SamConfig, writeSamconfigGlobal } from './config'
import { BucketSource, createBucketSourcePrompter, createBucketPrompter } from '../ui/sam/bucket'
import { createStackPrompter } from '../ui/sam/stack'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/samTemplate'
import { BucketSource, createBucketSourcePrompter, createBucketPrompter } from '../ui/sam/bucketPrompter'
import { createStackPrompter } from '../ui/sam/stackPrompter'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/templatePrompter'
import { getProjectRoot, getRecentResponse, getSamCliPathAndVersion, getSource, updateRecentResponse } from './utils'
import { createDeployParamsSourcePrompter, ParamsSource } from '../ui/sam/paramsSource'
import { createDeployParamsSourcePrompter, ParamsSource } from '../ui/sam/paramsSourcePrompter'
import { runInTerminal } from './processTerminal'

export interface DeployParams {
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/shared/sam/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ import {
getSource,
updateRecentResponse,
} from './utils'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/samTemplate'
import { createStackPrompter } from '../ui/sam/stack'
import { ParamsSource, createSyncParamsSourcePrompter } from '../ui/sam/paramsSource'
import { createEcrPrompter } from '../ui/sam/ecr'
import { BucketSource, createBucketPrompter } from '../ui/sam/bucket'
import { TemplateItem, createTemplatePrompter } from '../ui/sam/templatePrompter'
import { createStackPrompter } from '../ui/sam/stackPrompter'
import { ParamsSource, createSyncParamsSourcePrompter } from '../ui/sam/paramsSourcePrompter'
import { createEcrPrompter } from '../ui/sam/ecrPrompter'
import { BucketSource, createBucketPrompter } from '../ui/sam/bucketPrompter'
import { runInTerminal } from './processTerminal'

export interface SyncParams {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/shared/sam/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as path from 'path'
import { AWSTreeNodeBase } from '../treeview/nodes/awsTreeNodeBase'
import { TreeNode, isTreeNode } from '../treeview/resourceTreeDataProvider'
import * as CloudFormation from '../cloudformation/cloudformation'
import { TemplateItem } from '../ui/sam/samTemplate'
import { TemplateItem } from '../ui/sam/templatePrompter'
import { RuntimeFamily, getFamily } from '../../lambda/models/samLambdaRuntime'
import { SamCliSettings } from './cli/samCliSettings'
import { ToolkitError } from '../errors'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/core/src/test/shared/sam/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import { UserAgent as __UserAgent } from '@smithy/types'

import { SamAppLocation } from '../../../awsService/appBuilder/explorer/samProject'
import { CancellationError } from '../../../shared/utilities/timeoutUtils'
import { TemplateItem } from '../../../shared/ui/sam/samTemplate'
import { ParamsSource } from '../../../shared/ui/sam/paramsSource'
import { BucketSource } from '../../../shared/ui/sam/bucket'
import { TemplateItem } from '../../../shared/ui/sam/templatePrompter'
import { ParamsSource } from '../../../shared/ui/sam/paramsSourcePrompter'
import { BucketSource } from '../../../shared/ui/sam/bucketPrompter'

describe('DeployWizard', async function () {
let sandbox: sinon.SinonSandbox
Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/test/shared/sam/sync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ import { RegionNode } from '../../../awsexplorer/regionNode'
import { getProjectRootUri } from '../../../shared/sam/utils'
import { AppNode } from '../../../awsService/appBuilder/explorer/nodes/appNode'
import * as Cfn from '../../../shared/cloudformation/cloudformation'
//import { beforeEach } from 'mocha'
import { getWorkspaceFolder, TestFolder } from '../../testUtil'
import { TemplateItem } from '../../../shared/ui/sam/samTemplate'
import { ParamsSource } from '../../../shared/ui/sam/paramsSource'
import { TemplateItem } from '../../../shared/ui/sam/templatePrompter'
import { ParamsSource } from '../../../shared/ui/sam/paramsSourcePrompter'
import { CloudFormationTemplateRegistry } from '../../../shared/fs/templateRegistry'

import { samconfigCompleteData, samconfigInvalidData, validTemplateData } from '../../shared/sam/samTestUtils'
//import { beforeEach } from 'mocha'
import { assertTelemetry, assertTelemetryCurried } from '../../testUtil'
import { PrompterTester } from '../wizards/prompterTester'
import { createTestRegionProvider } from '../regions/testUtil'
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/test/shared/sam/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { RegionNode } from '../../../awsexplorer/regionNode'
import { Region } from '../../../shared/regions/endpoints'
import { RegionProvider, ToolkitError } from '../../../shared'
import { DeployedResource, DeployedResourceNode } from '../../../awsService/appBuilder/explorer/nodes/deployedNode'
import { TemplateItem } from '../../../shared/ui/sam/samTemplate'
import { TemplateItem } from '../../../shared/ui/sam/templatePrompter'
import { SamCliInfoInvocation } from '../../../shared/sam/cli/samCliInfo'
import { SamCliSettings } from '../../../shared/sam/cli/samCliSettings'
import { telemetry } from '../../../shared/telemetry'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { S3 } from 'aws-sdk'
import sinon from 'sinon'
import { DefaultS3Client } from '../../../../shared/clients/s3Client'
import * as SamUtilsModule from '../../../../shared/sam/utils'
import { createBucketPrompter } from '../../../../shared/ui/sam/bucket'
import { createBucketPrompter } from '../../../../shared/ui/sam/bucketPrompter'
import { AsyncCollection } from '../../../../shared/utilities/asyncCollection'
import { RequiredProps } from '../../../../shared/utilities/tsUtils'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DefaultEcrClient, EcrRepository } from '../../../../shared/clients/ecrC
import { samSyncUrl } from '../../../../shared/constants'
import * as SamUtilsModule from '../../../../shared/sam/utils'
import * as ButtonsModule from '../../../../shared/ui/buttons'
import { createEcrPrompter } from '../../../../shared/ui/sam/ecr'
import { createEcrPrompter } from '../../../../shared/ui/sam/ecrPrompter'
import { intoCollection } from '../../../../shared/utilities/collectionUtils'

describe('createEcrPrompter', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
createDeployParamsSourcePrompter,
createSyncParamsSourcePrompter,
ParamsSource,
} from '../../../../shared/ui/sam/paramsSource'
} from '../../../../shared/ui/sam/paramsSourcePrompter'
import { DataQuickPickItem } from '../../../../shared/ui/pickerPrompter'

describe('createSyncParamsSourcePrompter', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as SamUtilsModule from '../../../../shared/sam/utils'
import * as ButtonsModule from '../../../../shared/ui/buttons'
import { DefaultCloudFormationClient } from '../../../../shared/clients/cloudFormationClient'
import { samSyncUrl } from '../../../../shared/constants'
import { createStackPrompter } from '../../../../shared/ui/sam/stack'
import { createStackPrompter } from '../../../../shared/ui/sam/stackPrompter'
import { intoCollection } from '../../../../shared/utilities/collectionUtils'

describe('createStackPrompter', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as Cfn from '../../../../shared/cloudformation/cloudformation'
import { CloudFormationTemplateRegistry } from '../../../../shared/fs/templateRegistry'
import { WatchedItem } from '../../../../shared/fs/watchedFiles'
import * as SamUtilsModule from '../../../../shared/sam/utils'
import { createTemplatePrompter } from '../../../../shared/ui/sam/samTemplate'
import { createTemplatePrompter } from '../../../../shared/ui/sam/templatePrompter'
import { assertEqualPaths } from '../../../testUtil'

describe('createTemplatePrompter', () => {
Expand Down Expand Up @@ -43,10 +43,8 @@ describe('createTemplatePrompter', () => {

const prompter = createTemplatePrompter(registry, mementoRootKey)

// Assert
assert.strictEqual(prompter.quickPick.items.length, 2)
assertEqualPaths(prompter.quickPick.items[0].label, '/path/to/template1.yaml')
//assert.strictEqual(prompter.quickPick.items[0].label, '/path/to/template1.yaml')
assertEqualPaths(prompter.quickPick.items[1].label, '/path/to/template2.yaml')
assert.strictEqual(prompter.quickPick.title, 'Select a SAM/CloudFormation Template')
assert.strictEqual(prompter.quickPick.placeholder, 'Select a SAM/CloudFormation Template')
Expand Down

0 comments on commit 726d3e5

Please sign in to comment.