Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Status cmd is working - still have a few TODOs #68

Merged
merged 2 commits into from
Jan 28, 2017

Conversation

jpricket
Copy link
Member

User Story #884931

@msftclas
Copy link

Hi @jpricketMSFT, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Jason Prickett). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

import { parseString } from "xml2js";

export class CommandHelper {
public static async parseXml(xml: string): Promise<any> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAP-it

return name;
}

public static trimToXml(xml: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CAP-it

export class CommandHelper {
public static async parseXml(xml: string): Promise<any> {
return new Promise<any>((fulfill, reject) => {
parseString(xml, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd push the { to the next line and align with the 'x' in xml, then...

attrNameProcessors: [CommandHelper.normalizeName]
},
(err, result) => {
if (err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you indent the "if (err) {" or is tslint down with it like this?

if (err) {
reject(err);
} else {
fulfill(result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the diff between fulfill and resolve. I use "resolve".

// Then, show the quick pick window and get back the one they chose
//TODO localize strings
let item: QuickPickItem = await window.showQuickPick(
items, { matchOnDescription: true, placeHolder: "Choose a file to open the file." });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, we'll have to put these hard-coded strings into a Strings file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Just trying to let the design settle a bit before doing that. Let's talk about how it should be done on Monday.

}
}
}
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's about either undefined or void 0?

const json = await CommandHelper.parseXml(xml);
if (json && json.status) {
// get all the pending changes first
const pending = json.status.pendingchanges[0].pendingchange;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a data type for pending?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do that, if you can, for all of your other variable definitions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to use any :(

@jeffyoung jeffyoung merged commit d3c69fd into master Jan 28, 2017
@jeffyoung jeffyoung deleted the users/jpricket/tfvc branch January 28, 2017 18:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants