Fix create book dialog smoke test (#15848)

This commit is contained in:
Charles Gagnon
2021-06-21 16:28:05 -07:00
committed by GitHub
parent 90b90afeab
commit 999acca745
3 changed files with 12 additions and 16 deletions

View File

@@ -87,13 +87,12 @@ export function msgDownloadLocation(downloadLocation: string): string { return l
export const newBook = localize('newBook', "New Jupyter Book (Preview)"); export const newBook = localize('newBook', "New Jupyter Book (Preview)");
export const bookDescription = localize('bookDescription', "Jupyter Books are used to organize Notebooks."); export const bookDescription = localize('bookDescription', "Jupyter Books are used to organize Notebooks.");
export const learnMore = localize('learnMore', "Learn more."); export const learnMore = localize('learnMore', "Learn more.");
export const locationBrowser = localize('locationBrowser', "Browse locations..."); export const contentFolder = localize('contentFolder', "Content folder");
export const selectContentFolder = localize('selectContentFolder', "Select content folder");
export const browse = localize('browse', "Browse"); export const browse = localize('browse', "Browse");
export const create = localize('create', "Create"); export const create = localize('create', "Create");
export const name = localize('name', "Name"); export const name = localize('name', "Name");
export const saveLocation = localize('saveLocation', "Save location"); export const saveLocation = localize('saveLocation', "Save location");
export const contentFolder = localize('contentFolder', "Content folder (Optional)"); export const contentFolderOptional = localize('contentFolderOptional', "Content folder (Optional)");
export const msgContentFolderError = localize('msgContentFolderError', "Content folder path does not exist"); export const msgContentFolderError = localize('msgContentFolderError', "Content folder path does not exist");
export const msgSaveFolderError = localize('msgSaveFolderError', "Save location path does not exist."); export const msgSaveFolderError = localize('msgSaveFolderError', "Save location path does not exist.");
export function msgCreateBookWarningMsg(file: string): string { return localize('msgCreateBookWarningMsg', "Error while trying to access: {0}", file); } export function msgCreateBookWarningMsg(file: string): string { return localize('msgCreateBookWarningMsg', "Error while trying to access: {0}", file); }

View File

@@ -81,34 +81,31 @@ export class CreateBookDialog {
}).component(); }).component();
this.bookNameInputBox = this.view.modelBuilder.inputBox() this.bookNameInputBox = this.view.modelBuilder.inputBox()
.withProperties({ .withProps({
values: [],
value: '', value: '',
enabled: true enabled: true
}).component(); }).component();
this.saveLocationInputBox = this.view.modelBuilder.inputBox().withProperties({ this.saveLocationInputBox = this.view.modelBuilder.inputBox().withProps({
values: [],
value: '', value: '',
placeHolder: loc.locationBrowser, ariaLabel: loc.saveLocation,
width: '400px' width: '400px'
}).component(); }).component();
this.contentFolderInputBox = this.view.modelBuilder.inputBox().withProperties({ this.contentFolderInputBox = this.view.modelBuilder.inputBox().withProps({
values: [],
value: '', value: '',
placeHolder: loc.selectContentFolder, ariaLabel: loc.contentFolder,
width: '400px' width: '400px'
}).component(); }).component();
const browseFolderButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({ const browseFolderButton = view.modelBuilder.button().withProps({
ariaLabel: loc.browse, ariaLabel: loc.browse,
iconPath: IconPathHelper.folder, iconPath: IconPathHelper.folder,
width: '18px', width: '18px',
height: '20px', height: '20px',
}).component(); }).component();
const browseContentFolderButton = view.modelBuilder.button().withProperties<azdata.ButtonProperties>({ const browseContentFolderButton = view.modelBuilder.button().withProps({
ariaLabel: loc.browse, ariaLabel: loc.browse,
iconPath: IconPathHelper.folder, iconPath: IconPathHelper.folder,
width: '18px', width: '18px',
@@ -147,7 +144,7 @@ export class CreateBookDialog {
component: this.createHorizontalContainer(view, [this.saveLocationInputBox, browseFolderButton]) component: this.createHorizontalContainer(view, [this.saveLocationInputBox, browseFolderButton])
}, },
{ {
title: loc.contentFolder, title: loc.contentFolderOptional,
required: false, required: false,
component: this.createHorizontalContainer(view, [this.contentFolderInputBox, browseContentFolderButton]) component: this.createHorizontalContainer(view, [this.contentFolderInputBox, browseContentFolderButton])
}, },

View File

@@ -9,8 +9,8 @@ import { Dialog } from './dialog';
const CREATE_BOOK_DIALOG_TITLE = 'New Jupyter Book (Preview)'; const CREATE_BOOK_DIALOG_TITLE = 'New Jupyter Book (Preview)';
const NAME_INPUT_SELECTOR = '.modal .modal-body input[aria-label="Name. Please fill out this field."]'; const NAME_INPUT_SELECTOR = '.modal .modal-body input[aria-label="Name. Please fill out this field."]';
const LOCATION_INPUT_SELECTOR = '.modal .modal-body input[title="Browse locations..."]'; const LOCATION_INPUT_SELECTOR = '.modal .modal-body input[aria-label="Save location"]';
const CONTENT_FOLDER_INPUT_SELECTOR = '.modal .modal-body input[title="Select content folder"]'; const CONTENT_FOLDER_INPUT_SELECTOR = '.modal .modal-body input[aria-label="Content folder"]';
const CREATE_BUTTON_SELECTOR = '.modal .modal-footer a[aria-label="Create"]:not(.disabled)'; const CREATE_BUTTON_SELECTOR = '.modal .modal-footer a[aria-label="Create"]:not(.disabled)';
export class CreateBookDialog extends Dialog { export class CreateBookDialog extends Dialog {