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

ROU-3076: Updating Namespace #262

Merged
merged 6 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions code/src/GridAPI/ColumnManager.Events.ts

This file was deleted.

55 changes: 0 additions & 55 deletions code/src/GridAPI/ColumnPicker.ts

This file was deleted.

59 changes: 0 additions & 59 deletions code/src/GridAPI/Export.ts

This file was deleted.

26 changes: 0 additions & 26 deletions code/src/GridAPI/Language.ts

This file was deleted.

59 changes: 0 additions & 59 deletions code/src/GridAPI/View.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace OSFramework.Configuration.Column {
// eslint-disable-next-line
constructor(config: any, isDateTime: boolean) {
super(config);
this.defaultFormat = `${GridAPI.dateFormat}${
this.defaultFormat = `${OutSystems.GridAPI.dateFormat}${
isDateTime ? ' HH:mm' : ''
}`;

Expand Down
2 changes: 1 addition & 1 deletion code/src/OSFramework/Helper/GetClosestGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace OSFramework.Helper {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.getAttribute(OSFramework.Helper.Constants.uniqueIdAttribute);

return GridAPI.GridManager.GetGridById(uniqueId);
return OutSystems.GridAPI.GridManager.GetGridById(uniqueId);
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion code/src/OSFramework/Helper/IsGridReady.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace OSFramework.Helper {
export function IsGridReady(gridID: string): boolean {
try {
const grid = GridAPI.GridManager.GetGridById(gridID);
const grid = OutSystems.GridAPI.GridManager.GetGridById(gridID);
return grid.isReady;
} catch (error) {
return false;
Expand Down
10 changes: 10 additions & 0 deletions code/src/OSFramework/Helper/LogMessage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
namespace OSFramework.Helper {
export const warningMessage =
'This API is deprecated please use the new api';

export function LogWarningMessage(message: string): void {
// TODO mechanism to enable logging mesages (like in OS UI)
console.warn(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace GridAPI.Auxiliary {
namespace OutSystems.GridAPI.Auxiliary {
type APIHandler = {
// eslint-disable-next-line
callback: any;
Expand Down Expand Up @@ -62,3 +62,45 @@ namespace GridAPI.Auxiliary {
return OSFramework.Helper.GenerateHashCode(str);
}
}
/// Overrides for the old namespace - calls the new one, lets users know this is no longer in use

// eslint-disable-next-line @typescript-eslint/no-unused-vars
namespace GridAPI.Auxiliary {
type APIHandler = {
// eslint-disable-next-line
callback: any;
errorCode: OSFramework.Enum.ErrorCodes;
gridID: string;
hasValue?: boolean;
};

export function CreateApiResponse({
gridID,
callback,
errorCode,
hasValue = false
}: APIHandler): string {
OSFramework.Helper.LogWarningMessage(
`${OSFramework.Helper.warningMessage} 'OutSystems.GridAPI.Auxiliary.CreateApiResponse()'`
);

return OutSystems.GridAPI.Auxiliary.CreateApiResponse({
gridID,
callback,
errorCode,
hasValue
});
}

/**
* Receives a string and generates the hashcode of it.
* @param str - string, typically the data to be showed in the grid.
* @returns hashcode to the str
*/
export function GetHashCode(str: string): number {
OSFramework.Helper.LogWarningMessage(
`${OSFramework.Helper.warningMessage} 'OutSystems.GridAPI.Auxiliary.GetHashCode()'`
);
return OutSystems.GridAPI.Auxiliary.GetHashCode(str);
}
}
Loading