Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements Outlook add-in commands #125

Merged
merged 29 commits into from
Jan 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a4d43f1
Merge remote-tracking branch 'refs/remotes/OfficeDev/master'
jasonjoh Nov 19, 2015
9a0fbf5
Merge remote-tracking branch 'OfficeDev/master'
jasonjoh Nov 19, 2015
993cc05
Initial checkin
jasonjoh Dec 2, 2015
bcd1972
Fix custom tab problem
jasonjoh Dec 3, 2015
609015f
Added CustomPane support
jasonjoh Dec 3, 2015
f881894
Updated mail generator to invoke commands
jasonjoh Dec 3, 2015
ad1d973
Fixed typo in README
jasonjoh Dec 3, 2015
d8564dc
Removing unneeded namespace
jasonjoh Dec 3, 2015
dde501b
Added option to pass command structure
jasonjoh Dec 4, 2015
ab8dd06
Fixing issues with code formatting
jasonjoh Dec 4, 2015
9923720
Updated existing mail tests
jasonjoh Dec 7, 2015
59fa792
Adding test for main scenario
jasonjoh Dec 8, 2015
7270848
Added test for tech='html' without all ext
jasonjoh Dec 8, 2015
3e080e3
Fixing issues uncovered by tests
jasonjoh Dec 9, 2015
eed580d
Adding tests for standalone
jasonjoh Dec 10, 2015
93053aa
Removing creation of unneeded files
jasonjoh Dec 10, 2015
dfe0081
Fixing mail generator test in app.js
jasonjoh Dec 11, 2015
0374efa
Cleaning up jshint issues
jasonjoh Dec 11, 2015
5b1b812
Merge remote-tracking branch 'refs/remotes/OfficeDev/master' into com…
jasonjoh Dec 18, 2015
5c2a007
Merge remote-tracking branch 'refs/remotes/OfficeDev/master' into com…
jasonjoh Dec 18, 2015
b115950
Added menu to compose in HTML template
jasonjoh Dec 18, 2015
6dec442
Cleaning up test coverage issues
jasonjoh Dec 18, 2015
c629c6d
Removed Tooltip element from commands
jasonjoh Jan 15, 2016
bccc4b0
Updating filepaths in tests to match case
jasonjoh Jan 15, 2016
39dee60
More travis-ci case-senstitivity changes
jasonjoh Jan 15, 2016
4594cb6
Yet more case issues with Travis
jasonjoh Jan 15, 2016
8e2f00f
Updated README to include command information
jasonjoh Jan 15, 2016
350ca7b
Added defaults for URL prompts
jasonjoh Jan 21, 2016
e7933e9
Correcting schema issue with CustomTab
jasonjoh Jan 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Running the main generator will prompt you for the type of Office project to cre
- `office:mail` - creates a Mail Add-in
- `office:taskpane` - creates a Task Pane Add-in
- `office:content` - creates a Content Add-in
- `office:commands` - adds [add-in commands](https://msdn.microsoft.com/EN-US/library/office/mt267546.aspx) to an existing manifest (Currently only supports Outlook add-ins)

> Remember you can see the options of each sub generators by running `$ yo office:[sub] --help`

Expand All @@ -92,7 +93,9 @@ You can add the `open` property set to a URL to have your default browser open &

## Examples

Refer to the [docs](docs) for example executions & output of the generator.## Command Line Options:
Refer to the [docs](docs) for example executions & output of the generator.

## Command Line Options:

List of supported options. If these are not provided, the generator will prompt you for the values before scaffolding the project.

Expand Down Expand Up @@ -138,14 +141,21 @@ The Microsoft Office client application that can host the add-in.

- Type: String[]
- Default: undefined / null
- Optional
- Optional

### `--outlookForm: [ 'mail-read' | 'mail-compose' | 'appointment-read' | 'appointment-compose' ]`
### `--extensionPoint: [ 'MessageReadCommandSurface' | 'MessageComposeCommandSurface' | 'AppointmentAttendeeCommandSurface' | 'AppointmentOrganizerCommandSurface' | 'CustomPane' ]`

The type of form within Outlook that can host the add-in.
The extension points to support. Valid choices depend on the type of add-in created.

> This applies only to mail add-ins.
#### Mail add-in extension points

- Type: String[]
- Default: undefined / null
- Optional
- `MessageReadCommandSurface` - The mail read form
- `MessageComposeCommandSurface` - The mail compose form
- `AppointmentAttendeeCommandSurface` - The appointment attendee form
- `AppointmentOrganizerCommandSurface` - The appointment organizer form
- `CustomPane` - A custom horizontal pane for mail read and appointment attendee forms


- Type: String[]
- Default: undefined / null
- Optional
60 changes: 5 additions & 55 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ module.exports = generators.Base.extend({
desc: 'Office client product that can host the add-in',
required: false
});

this.option('outlookForm', {
this.option('extensionPoint', {
type: String,
desc: 'Supported Outlook forms',
desc: 'Supported extension points',
required: false
});

Expand Down Expand Up @@ -229,58 +229,7 @@ module.exports = generators.Base.extend({
done();
}.bind(this));

}, // askForOfficeClients()

askForOutlookForms: function(){
// if it's a mail addin, ask for Outlook forms
if (this.genConfig.type !== 'mail') {
return;
}

var done = this.async();

// outlook form options
var prompts = [{
name: 'outlookForm',
message: 'Supported Outlook forms:',
type: 'checkbox',
choices: [
{
name: 'E-Mail message - read form',
value: 'mail-read',
checked: true
},
{
name: 'E-Mail message - compose form',
value: 'mail-compose',
checked: true
},
{
name: 'Appointment - read form',
value: 'appointment-read',
checked: true
},
{
name: 'Appointment - compose form',
value: 'appointment-compose',
checked: true
}
],
when: this.options.outlookForm === undefined,
validate: /* istanbul ignore next */ function(answers){
if (answers.length < 1) {
return 'Must select at least one Outlook form type';
}
return true;
}
}];

// trigger prompts
this.prompt(prompts, function(responses){
this.genConfig = extend(this.genConfig, responses);
done();
}.bind(this));
}
} // askForOfficeClients()

}, // prompting()

Expand All @@ -297,6 +246,7 @@ module.exports = generators.Base.extend({
'root-path': this.genConfig['root-path'],
tech: this.genConfig.tech,
outlookForm: this.genConfig.outlookForm,
extensionPoint: this.genConfig.extensionPoint,
appId: this.genConfig.appId,
'skip-install': this.options['skip-install']
}
Expand Down