Skip to content

Commit

Permalink
Upgrading angular material to version 1.0.0 (including typings), upda…
Browse files Browse the repository at this point in the history
…ting code where necessary.
  • Loading branch information
Jeremy Sik committed Dec 15, 2015
1 parent 0ec4cad commit 103952d
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 104 deletions.
43 changes: 0 additions & 43 deletions api/database/factories/ModelFactory.php

This file was deleted.

1 change: 0 additions & 1 deletion api/database/seeds/DatabaseSeeder.php
Expand Up @@ -26,7 +26,6 @@ public function run()
$this->call('UserStorySeeder');

if (env('APP_ENV') === 'demo') {
$this->call('TestEntitySeeder');
$this->call('ArticleSeeder');
}
}
Expand Down
32 changes: 0 additions & 32 deletions api/database/seeds/TestEntitySeeder.php

This file was deleted.

2 changes: 1 addition & 1 deletion api/tests/integration/QueueTest.php
Expand Up @@ -54,7 +54,7 @@ public function testQueueAdd()
{
Queue::push(function ($job) {

factory(App\Models\TestEntity::class)->create();
factory(Spira\Core\Model\Test\TestEntity::class)->create();

$job->delete();
});
Expand Down
5 changes: 3 additions & 2 deletions app/bower.json
Expand Up @@ -23,7 +23,7 @@
"angular-i18n": "~1.4",
"angular-jwt-auth": "~3.5",
"angular-marked": "~0.0.21",
"angular-material": "~0.11",
"angular-material": "~1.0.0",
"angular-messages": "~1.4",
"angular-rest-adapter": "~1.3",
"angular-sanitize": "~1.4",
Expand Down Expand Up @@ -55,7 +55,8 @@
"resolutions": {
"lodash": "~3.10",
"angular": "1.4.7",
"ng-file-upload": "~7.0.15"
"ng-file-upload": "~7.0.15",
"angular-material": "~1.0.0"
},
"overrides": {
"simplemde": {
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/admin/users/listing/userListing.ts
Expand Up @@ -90,7 +90,7 @@ namespace app.admin.users.listing {
.parent("#admin-container")
.targetEvent($event)
.title("Are you sure you want to impersonate this user?")
.content(`
.htmlContent(`
Any action you take as that user will appear to be done by that user.
<blockquote cite="Uncle Ben">With great power comes great responsibility <br><small>- Uncle Ben</small></blockquote>
`)
Expand Down
2 changes: 1 addition & 1 deletion app/src/app/guest/login/login.ts
Expand Up @@ -46,7 +46,7 @@ namespace app.guest.login {
this.$mdDialog.show(this.$mdDialog.alert()
.clickOutsideToClose(false)
.title('Please confirm your email')
.content('You have signed in using an unconfirmed email address. Please note that your email address will not be changed until you have confirmed your email.')
.textContent('You have signed in using an unconfirmed email address. Please note that your email address will not be changed until you have confirmed your email.')
.ok('Continue')
.ariaLabel('Confirm Email')
);
Expand Down
2 changes: 1 addition & 1 deletion app/src/common/directives/avatar/avatar.ts
Expand Up @@ -82,7 +82,7 @@ namespace common.directives.avatar {

var confirm = this.$mdDialog.confirm()
.title("Are you sure you want to remove your avatar?")
.content("This action <strong>cannot</strong> be undone.")
.htmlContent("This action <strong>cannot</strong> be undone.")
.ariaLabel("Confirm remove")
.ok("Remove")
.cancel("Don't remove it");
Expand Down
Expand Up @@ -87,7 +87,7 @@ namespace common.directives.contentSectionsInput.set {
var confirm = this.$mdDialog.confirm()
.parent('#admin-container')
.title("Are you sure you want to delete this section?")
.content('This action <strong>cannot</strong> be undone')
.htmlContent('This action <strong>cannot</strong> be undone')
.ariaLabel("Confirm delete")
.ok("Delete this section!")
.cancel("Nope! Don't delete it.");
Expand Down
Expand Up @@ -76,7 +76,7 @@ namespace common.directives.contentSectionsInput.sectionInputMedia {
var confirm = this.$mdDialog.confirm()
.parent('#admin-container')
.title(`Are you sure you want to delete this ${media.type}?`)
.content('This action <strong>cannot</strong> be undone')
.htmlContent('This action <strong>cannot</strong> be undone')
.ariaLabel("Confirm delete")
.ok(`Delete this ${media.type}!`)
.cancel("Nope! Don't delete it.");
Expand Down
4 changes: 2 additions & 2 deletions app/tsd.json
Expand Up @@ -18,7 +18,7 @@
"commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7"
},
"jquery/jquery.d.ts": {
"commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7"
"commit": "8ea42cd8bb11863ed6f242d67c502288ebc45a7b"
},
"angularjs/angular-mocks.d.ts": {
"commit": "6f04d25ad38982d372cc3cda62fa4c0eef9e24d7"
Expand Down Expand Up @@ -51,7 +51,7 @@
"commit": "ab3cc82066805007cbf0db233ddb5879f42be4d2"
},
"angular-material/angular-material.d.ts": {
"commit": "38c6ccfde0e67ff10d7408e0ee8b7720b3f21d3b"
"commit": "8ea42cd8bb11863ed6f242d67c502288ebc45a7b"
},
"moment-timezone/moment-timezone.d.ts": {
"commit": "efc57a6eb7b4d0747894fc106b9dd87e45a8d183"
Expand Down
27 changes: 22 additions & 5 deletions app/typings/angular-material/angular-material.d.ts
@@ -1,4 +1,4 @@
// Type definitions for Angular Material 0.10.1-rc1+ (angular.material module)
// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
Expand Down Expand Up @@ -28,7 +28,8 @@ declare module angular.material {

interface IPresetDialog<T> {
title(title: string): T;
content(content: string): T;
textContent(textContent: string): T;
htmlContent(htmlContent: string): T;
ok(ok: string): T;
theme(theme: string): T;
templateUrl(templateUrl?: string): T;
Expand Down Expand Up @@ -82,7 +83,7 @@ declare module angular.material {
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
confirm(): IConfirmDialog;
alert(): IAlertDialog;
hide(response?: any): void;
hide(response?: any): angular.IPromise<any>;
cancel(response?: any): void;
}

Expand Down Expand Up @@ -115,13 +116,14 @@ declare module angular.material {
}

interface IToastPreset<T> {
content(content: string): T;
textContent(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
capsule(capsule: boolean): T;
theme(theme: string): T;
hideDelay(delay: number): T;
position(position: string): T;
parent(parent?: string|Element|JQuery): T; // default: root node
}

interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
Expand All @@ -144,7 +146,7 @@ declare module angular.material {

interface IToastService {
show(optionsOrPreset: IToastOptions|IToastPreset<any>): angular.IPromise<any>;
showSimple(): angular.IPromise<any>;
showSimple(content: string): angular.IPromise<any>;
simple(): ISimpleToastPreset;
build(): IToastPreset<any>;
updateContent(): void;
Expand Down Expand Up @@ -220,4 +222,19 @@ declare module angular.material {
setDefaultTheme(theme: string): void;
alwaysWatchTheme(alwaysWatch: boolean): void;
}

interface IDateLocaleProvider {
months: string[];
shortMonths: string[];
days: string[];
shortDays: string[];
dates: string[];
firstDayOfWeek: number;
parseDate(dateString: string): Date;
formatDate(date: Date): string;
monthHeaderFormatter(date: Date): string;
weekNumberFormatter(weekNumber: number): string;
msgCalendar: string;
msgOpenCalendar: string;
}
}
46 changes: 33 additions & 13 deletions app/typings/jquery/jquery.d.ts
Expand Up @@ -105,6 +105,10 @@ interface JQueryAjaxSettings {
* Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
*/
jsonpCallback?: any;
/**
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
*/
method?: string;
/**
* A mime type to override the XHR mime type. (version added: 1.5.1)
*/
Expand Down Expand Up @@ -181,6 +185,10 @@ interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
* Property containing the parsed response if the response Content-Type is json
*/
responseJSON?: any;
/**
* A function to be called if the request fails.
*/
error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
}

/**
Expand Down Expand Up @@ -233,7 +241,7 @@ interface JQueryCallback {
* @param context A reference to the context in which the callbacks in the list should be fired.
* @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
*/
fireWith(context?: any, ...args: any[]): JQueryCallback;
fireWith(context?: any, args?: any[]): JQueryCallback;

/**
* Determine whether a supplied callback is in a list
Expand Down Expand Up @@ -387,7 +395,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the progressCallbacks as the this object.
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
notifyWith(context: any, value?: any[]): JQueryDeferred<T>;

/**
* Reject a Deferred object and call any failCallbacks with the given args.
Expand All @@ -401,7 +409,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the failCallbacks as the this object.
* @param args An optional array of arguments that are passed to the failCallbacks.
*/
rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
rejectWith(context: any, value?: any[]): JQueryDeferred<T>;

/**
* Resolve a Deferred object and call any doneCallbacks with the given args.
Expand All @@ -417,7 +425,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the doneCallbacks as the this object.
* @param args An optional array of arguments that are passed to the doneCallbacks.
*/
resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred<T>;
resolveWith(context: any, value?: T[]): JQueryDeferred<T>;

/**
* Return a Deferred's Promise object.
Expand Down Expand Up @@ -1355,9 +1363,9 @@ interface JQuery {
/**
* Set the value of each element in the set of matched elements.
*
* @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
* @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
*/
val(value: string|string[]): JQuery;
val(value: string|string[]|number): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
Expand Down Expand Up @@ -1537,18 +1545,18 @@ interface JQuery {
* @param value The new data value; it can be any Javascript type including Array or Object.
*/
data(key: string, value: any): JQuery;
/**
* Store arbitrary data associated with the matched elements.
*
* @param obj An object of key-value pairs of data to update.
*/
data(obj: { [key: string]: any; }): JQuery;
/**
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
*
* @param key Name of the data stored.
*/
data(key: string): any;
/**
* Store arbitrary data associated with the matched elements.
*
* @param obj An object of key-value pairs of data to update.
*/
data(obj: { [key: string]: any; }): JQuery;
/**
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
*/
Expand All @@ -1573,6 +1581,10 @@ interface JQuery {
* @param list An array of strings naming the pieces of data to delete.
*/
removeData(list: string[]): JQuery;
/**
* Remove all previously-stored piece of data.
*/
removeData(): JQuery;

/**
* Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
Expand Down Expand Up @@ -1990,6 +2002,10 @@ interface JQuery {
*/
focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;

/**
* Trigger the "focusin" event on an element.
*/
focusin(): JQuery;
/**
* Bind an event handler to the "focusin" JavaScript event
*
Expand All @@ -2004,6 +2020,10 @@ interface JQuery {
*/
focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;

/**
* Trigger the "focusout" event on an element.
*/
focusout(): JQuery;
/**
* Bind an event handler to the "focusout" JavaScript event
*
Expand Down Expand Up @@ -3030,7 +3050,7 @@ interface JQuery {
*
* @param elements One or more DOM elements to remove from the matched set.
*/
not(...elements: Element[]): JQuery;
not(elements: Element|Element[]): JQuery;
/**
* Remove elements from the set of matched elements.
*
Expand Down

0 comments on commit 103952d

Please sign in to comment.