-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from SAP-samples/massConvert_views
Mass convert views and UI upgrades
- Loading branch information
Showing
69 changed files
with
2,156 additions
and
1,198 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
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
72 changes: 72 additions & 0 deletions
72
app/resources/inspect/controller/inspectView-ui.controller.js
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,72 @@ | ||
/* eslint-disable no-undef */ | ||
/*eslint-env es6 */ | ||
"use strict"; | ||
sap.ui.define([ | ||
"sap/hanacli/inspect/controller/App.controller", | ||
"sap/m/Text", | ||
"sap/ui/table/Column" | ||
], | ||
function (AppController, Text, Column) { | ||
|
||
return AppController.extend("sap.hanacli.inspect.controller.inspectView-ui", { | ||
|
||
onInit: function () { | ||
|
||
this.onAppInit() | ||
this.setFilterAsContains("Schema") | ||
this.setFilterAsContains("View") | ||
let viewInput = this.getModel("config").getProperty("/viewInput") | ||
if(viewInput){ | ||
this.getModel("promptsModel").setProperty("/view", viewInput) | ||
} | ||
//let editor = this.getView().byId("aCodeEditor") | ||
// editor.session.setMode("/ace/hanasql1") | ||
this.executeCmd() | ||
|
||
}, | ||
|
||
executeCmd: async function () { | ||
this.startBusy() | ||
this.updatePrompts().then(() => { | ||
let aUrl = `/hana/${this.getModel("config").getProperty("/cmd")}/` | ||
let oController = this | ||
jQuery.ajax({ | ||
url: aUrl, | ||
method: "GET", | ||
dataType: "json", | ||
success: function (myJSON) { | ||
oController.endBusy(oController) | ||
let model = oController.getModel("resultsModel") | ||
let fieldsMetaData = [] | ||
if (myJSON.fields[0]) { | ||
for (const key of Object.keys(myJSON.fields[0])) { | ||
fieldsMetaData.push({ property: key }) | ||
} | ||
} | ||
|
||
let data = { rows: myJSON, fieldsColumns: fieldsMetaData} | ||
model.setData(data) | ||
|
||
let oTable = oController.getView().byId("fieldsTable") | ||
|
||
oTable.bindColumns('resultsModel>/fieldsColumns', function (sId, oContext) { | ||
var sColumnId = oContext.getObject().property | ||
|
||
return new Column({ | ||
//id: sColumnId, | ||
label: sColumnId, | ||
template: new Text({ "text": { path: "resultsModel>" + sColumnId } }), | ||
sortProperty: sColumnId, | ||
filterProperty: sColumnId | ||
}) | ||
}) | ||
}, | ||
error: function (error) { | ||
oController.onErrorCall(error, oController) | ||
} | ||
}) | ||
}) | ||
} | ||
}) | ||
} | ||
) |
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,92 @@ | ||
<mvc:View controllerName="sap.hanacli.inspect.controller.inspectView-ui" height="100%" width="100%" | ||
xmlns:l="sap.ui.layout" | ||
xmlns:f="sap.ui.layout.form" | ||
xmlns:mvc="sap.ui.core.mvc" | ||
xmlns:core="sap.ui.core" | ||
xmlns:table="sap.ui.table" | ||
xmlns:ce="sap.ui.codeeditor" | ||
xmlns="sap.m"> | ||
<ScrollContainer height="100%" width="100%" vertical="true" focusable="true"> | ||
<f:SimpleForm id="SimpleFormToolbar" editable="true" layout="ResponsiveGridLayout" adjustLabelSpan="true" singleContainerFullSize="false" ariaLabelledBy="Title1"> | ||
<f:toolbar> | ||
<core:Fragment fragmentName="sap.hanacli.tables.view.reuse.toolbar" type="XML"/> | ||
</f:toolbar> | ||
<f:content> | ||
|
||
<Toolbar ariaLabelledBy="Title2"> | ||
<Title id="Title2" text="{i18nReuse>gui.target}"/> | ||
<ToolbarSpacer /> | ||
<Button icon="sap-icon://settings" tooltip="{i18nReuse>gui.targetDetails}" press=".openUrl('/ui/#systeminfo-ui', true)" /> | ||
</Toolbar> | ||
|
||
<core:Fragment fragmentName="sap.hanacli.tables.view.reuse.schema" type="XML"/> | ||
|
||
<Label text="{i18nReuse>view}" required="true"/> | ||
<Input id="View" value="{/view}" showSuggestion="true" suggest="loadViewFilter"> | ||
</Input> | ||
|
||
<core:Fragment fragmentName="sap.hanacli.common.view.Connection" type="XML"/> | ||
<core:Fragment fragmentName="sap.hanacli.common.view.Debug" type="XML"/> | ||
|
||
</f:content> | ||
</f:SimpleForm> | ||
|
||
<IconTabBar id="idIconTabBarNoIcons" expanded="{device>/isNoPhone}" class="sapUiResponsiveContentPadding"> | ||
<items> | ||
<IconTabFilter text="Basic Info" key="info"> | ||
<f:SimpleForm id="infoForm" editable="false" layout="ResponsiveGridLayout" adjustLabelSpan="true" singleContainerFullSize="false" ariaLabelledBy="Title1"> | ||
<f:content> | ||
<Label text="{i18nReuse>scheam}" /> | ||
<Input value="{resultsModel>/rows/basic/SCHEMA_NAME}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>view}" /> | ||
<Input value="{resultsModel>/rows/basic/VIEW_NAME}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.viewType}" /> | ||
<Input value="{resultsModel>/rows/basic/VIEW_TYPE}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.tableOID}" /> | ||
<Input value="{resultsModel>/rows/basic/VIEW_OID}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.hasParameters}" /> | ||
<Input value="{resultsModel>/rows/basic/HAS_PARAMETERS}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.hasCheck}" /> | ||
<Input value="{resultsModel>/rows/basic/HAS_STRUCTURED_PRIVILEGE_CHECK}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.hasCache}" /> | ||
<Input value="{resultsModel>/rows/basic/HAS_CACHE}" editable="false" /> | ||
|
||
<Label text="{i18nReuse>gui.created}" /> | ||
<Input value="{resultsModel>/rows/basic/CREATE_TIME}" editable="false" /> | ||
|
||
|
||
</f:content> | ||
</f:SimpleForm> | ||
|
||
</IconTabFilter> | ||
<IconTabFilter text="{i18nReuse>gui.fields}" key="fields"> | ||
<table:Table id="fieldsTable" selectionMode="MultiToggle" visibleRowCount="10" enableSelectAll="false" rows="{resultsModel>/rows/fields}" threshold="15" enableBusyIndicator="true"> | ||
<table:noData> | ||
<BusyIndicator class="sapUiMediumMargin"/> | ||
</table:noData> | ||
</table:Table> | ||
</IconTabFilter> | ||
|
||
<IconTabFilter text="{i18nReuse>gui.sql}" key="sql"> | ||
<ce:CodeEditor id="aCodeEditorSQL" type="sql" value="{resultsModel>/rows/sql}" editable="false" height="auto" maxLines="25" /> | ||
</IconTabFilter> | ||
|
||
<IconTabFilter text="{i18nReuse>gui.cds}" key="cds"> | ||
<ce:CodeEditor id="aCodeEditorCDS" type="javascript" value="{resultsModel>/rows/cds}" syntaxHints="false" editable="false" height="auto" maxLines="25" /> | ||
</IconTabFilter> | ||
|
||
<IconTabFilter text="{i18nReuse>gui.hdbtable}" key="hdbtable"> | ||
<ce:CodeEditor id="aCodeEditorHDBTable" type="sql" value="{resultsModel>/rows/hdbtable}" editable="false" height="auto" maxLines="25" /> | ||
|
||
</IconTabFilter> | ||
</items> | ||
</IconTabBar> | ||
|
||
</ScrollContainer> | ||
</mvc:View> |
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
Oops, something went wrong.