-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
6,921 additions
and
5,523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class CancelEdit extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.isVisible = this.parent.isEditing; | ||
this.canExecute = this.parent.stateBehavior.indexOf("StayInEdit") < 0 || this.parent.isDirty; | ||
} | ||
|
||
_onParentIsEditingChanged(isEditing: boolean) { | ||
this.isVisible = isEditing; | ||
} | ||
|
||
_onParentIsDirtyChanged(isDirty: boolean) { | ||
this.canExecute = this.parent.stateBehavior.indexOf("StayInEdit") < 0 || isDirty; | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
this.parent.cancelEdit(); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class CancelSave extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
this.service.hooks.onClose(this.parent); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class Edit extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.isVisible = !this.parent.isEditing; | ||
|
||
this.dependentActions = ["EndEdit", "CancelEdit"]; | ||
} | ||
|
||
_onParentIsEditingChanged(isEditing: boolean) { | ||
this.isVisible = !isEditing; | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
this.parent.beginEdit(); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class EndEdit extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.isVisible = this.parent.isEditing; | ||
this.canExecute = this.parent.isDirty; | ||
} | ||
|
||
_onParentIsEditingChanged(isEditing: boolean) { | ||
this.isVisible = isEditing; | ||
} | ||
|
||
_onParentIsDirtyChanged(isDirty: boolean) { | ||
this.canExecute = isDirty; | ||
} | ||
|
||
protected async _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
await this.parent.save(); | ||
if (StringEx.isNullOrWhiteSpace(this.parent.notification) || this.parent.notificationType !== NotificationType.Error) { | ||
const edit = this.parent.actions["Edit"]; | ||
const endEdit = this.parent.actions["EndEdit"]; | ||
|
||
if (this.parent.stateBehavior.indexOf("StayInEdit") !== -1 && endEdit != null) { | ||
endEdit.canExecute = false; | ||
} else if (edit) { | ||
edit.isVisible = true; | ||
if (endEdit != null) | ||
endEdit.isVisible = false; | ||
} | ||
} | ||
|
||
return this.parent; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class ExportToCsv extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
this.service._getStream(null, "Query.ExportToCsv", this.parent, this.query, null, this._getParameters(parameters, menuOption)); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class ExportToExcel extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
this.service._getStream(null, "Query.ExportToExcel", this.parent, this.query, null, this._getParameters(parameters, menuOption)); | ||
return Promise.resolve(null); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class Filter extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.isVisible = false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class RefreshQuery extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.isVisible = false; | ||
} | ||
|
||
protected _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<any> { | ||
return this.query.search(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class Save extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
this.dependentActions = ["CancelSave"]; | ||
} | ||
|
||
protected async _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
const wasNew = this.parent.isNew; | ||
|
||
await this.parent.save(); | ||
|
||
// NOTE: Check if operations will open a new persistent object anyway | ||
if (this.service.queuedClientOperations.length > 0 && | ||
this.service.queuedClientOperations.some(o => { | ||
if (o.type === "Open") { | ||
(<ClientOperations.IOpenOperation>o).replace = true; | ||
return true; | ||
} | ||
else if (o.type === "ExecuteMethod") { | ||
const eo = <ClientOperations.IExecuteMethodOperation>o; | ||
if (eo.name === "navigate") { | ||
eo.arguments[1] = true; | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}) | ||
) | ||
return this.parent; | ||
|
||
if (StringEx.isNullOrWhiteSpace(this.parent.notification) || this.parent.notificationType !== NotificationType.Error) { | ||
if (wasNew && this.parent.ownerAttributeWithReference == null && this.parent.stateBehavior.indexOf("OpenAfterNew") !== -1) { | ||
const newPO = await this.parent.queueWork(() => this.service.getPersistentObject(this.parent.parent, this.parent.id, this.parent.objectId)); | ||
this.service.hooks.onOpen(newPO, true); | ||
} | ||
else | ||
this.service.hooks.onClose(this.parent); | ||
} | ||
|
||
return this.parent; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
export class ShowHelp extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
} | ||
|
||
protected async _onExecute({ menuOption, parameters, selectedItems, skipOpen, noConfirmation, throwExceptions }: IActionExecuteOptions): Promise<PersistentObject> { | ||
const owner = this.query ? this.query.persistentObject : this.parent; | ||
const helpWindow = window.open(); | ||
|
||
try { | ||
const po = await this.service.executeAction("PersistentObject.ShowHelp", owner, null, null); | ||
|
||
if (po != null) { | ||
if (po.fullTypeName === "Vidyano.RegisteredStream" || po.getAttributeValue("Type") === "0") { | ||
helpWindow.close(); | ||
this.service._getStream(po); | ||
} else { | ||
helpWindow.location.href = po.getAttributeValue("Document"); | ||
helpWindow.focus(); | ||
} | ||
} | ||
else | ||
helpWindow.close(); | ||
} | ||
catch (e) { | ||
helpWindow.close(); | ||
this.owner.setNotification(e); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
/* tslint:disable:class-name */ | ||
export class viConfigurePO extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
|
||
this.isVisible = false; | ||
} | ||
} | ||
/* tslint:enable:class-name */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
/* tslint:disable:class-name */ | ||
export class viConfigureQuery extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
|
||
this.isVisible = false; | ||
} | ||
} | ||
/* tslint:enable:class-name */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace Actions { | ||
/* tslint:disable:class-name */ | ||
export class viSearch extends Action { | ||
constructor(service: Service, definition: ActionDefinition, owner: ServiceObjectWithActions) { | ||
super(service, definition, owner); | ||
|
||
this.isVisible = this.parent == null || this.parent.fullTypeName === "Vidyano.Search"; | ||
|
||
if (this.parent != null && this.parent.fullTypeName === "Vidyano.Search") | ||
this._isPinned = false; | ||
} | ||
} | ||
/* tslint:enable:class-name */ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Vidyano { | ||
"use strict"; | ||
|
||
export namespace ClientOperations { | ||
export interface IClientOperation { | ||
type: string; | ||
} | ||
} | ||
} |
Oops, something went wrong.