fiveapples 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,9 +43,6 @@ sap.ui.define(
43
43
  var oRID = this.byId("cultivar_id");
44
44
  oRID.setValue(sCultivarID);
45
45
  },
46
- _onBindingChange: function(oEvent) {
47
- var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
48
- },
49
46
  onCreate: function() {
50
47
  var myForm = sap.ui.getCore().byId("parentage_create_form");
51
48
  var sObjectPath = "/parentage";
@@ -5,9 +5,11 @@ sap.ui.define(
5
5
  "sap/ui/core/Fragment",
6
6
  "sap/ui/model/Filter",
7
7
  "sap/ui/model/odata/ODataModel",
8
- "sap/ui/core/routing/History"
8
+ "sap/ui/core/routing/History",
9
+ "./Detail"
9
10
  ],
10
- function(Controller, MessageToast, Fragment, Filter, ODataModel, History) {
11
+ function(Controller, MessageToast, Fragment, Filter, ODataModel,
12
+ History, Detail) {
11
13
  "use strict";
12
14
  return Controller.extend("fivea.controller.Parentage_Detail", {
13
15
  onInit: function() {
@@ -39,44 +41,15 @@ sap.ui.define(
39
41
  var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
40
42
  },
41
43
  onSave: function() {
42
- var oView = this.getView();
43
- var oModel = oView.getModel();
44
- var sPath = this._sObjectPath;
45
- var mParms = {};
46
-
47
- var oData = oModel.getData(sPath);
48
-
49
- function onSuccessHandler() {
50
- oModel.refresh();
51
- oModel.updateBindings();
52
- MessageToast.show("Update success");
53
- }
54
- function onErrorHandler() {
55
- MessageToast.show("Update failed");
56
- }
57
- console.log("Model data:", oData);
58
- console.log("Model has pending changes:", oModel.hasPendingChanges());
59
- console.log("Pending changes:", oModel.getPendingChanges());
60
-
61
- mParms.success = onSuccessHandler;
62
- mParms.error = onErrorHandler;
63
-
64
- oModel.setTokenHandlingEnabled(true);
65
- oModel.updateSecurityToken();
66
-
67
- oModel.submitChanges(mParms);
44
+ Detail.onSave(this);
68
45
  },
46
+ navToList: function(){
47
+ this._oRouter.navTo("ParentageList", true);
48
+ },
69
49
  onNavBack: function() {
70
- var oHistory = History.getInstance();
71
- var sPreviousHash = oHistory.getPreviousHash();
72
-
73
- if (sPreviousHash !== undefined) {
74
- window.history.go(-1);
75
- } else {
76
- var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
77
- oRouter.navTo("ParentageList", true);
78
- }
50
+ Detail.onNavBack(this);
79
51
  },
52
+
80
53
  inputId: "",
81
54
  inputDescrId: "",
82
55
 
@@ -1,4 +1,11 @@
1
- <mvc:View controllerName="fivea.controller.BreederList" xmlns="sap.ui.table" xmlns:mvc="sap.ui.core.mvc" xmlns:u="sap.ui.unified" xmlns:co="sap.ui.commons" xmlns:c="sap.ui.core" xmlns:m="sap.m">
1
+ <mvc:View controllerName="fivea.controller.BreederList"
2
+ xmlns="sap.ui.table"
3
+ xmlns:mvc="sap.ui.core.mvc"
4
+ xmlns:u="sap.ui.unified"
5
+ xmlns:co="sap.ui.commons"
6
+ xmlns:c="sap.ui.core"
7
+ xmlns:m="sap.m">
8
+
2
9
  <m:Toolbar class="sapUiMediumMarginTop" id="toolbar1">
3
10
  <m:Button text="Create record" press="onCreatePress" />
4
11
  </m:Toolbar>
@@ -10,7 +10,8 @@
10
10
  <Bar>
11
11
  <contentLeft>
12
12
  <Button icon="sap-icon://nav-back" press="onNavBack"/>
13
- <Button icon="sap-icon://create" type="Accept" text="Create" press="onCreate"/>
13
+ <Button icon="sap-icon://create" type="Accept" text="Create"
14
+ press="onCreatePress"/>
14
15
  </contentLeft>
15
16
  </Bar>
16
17
  </customHeader>
@@ -20,9 +21,11 @@
20
21
 
21
22
  <f:SimpleForm id="breeder_create_form" editable="true">
22
23
  <Label text="First name"/>
23
- <Input id="first_name" type="Text" name="first_name" enabled="true" value="{first_name}" />
24
+ <Input id="first_name" type="Text" name="first_name"
25
+ enabled="true" value="{first_name}" />
24
26
  <Label text="Last name"/>
25
- <Input id="last_name" type="Text" name="last_name" enabled="true" value="{last_name}"/>
27
+ <Input id="last_name" type="Text" name="last_name"
28
+ enabled="true" value="{last_name}"/>
26
29
  </f:SimpleForm>
27
30
 
28
31
 
@@ -1,28 +1,65 @@
1
- <mvc:View xmlns="sap.m" xmlns:t="sap.ui.table" xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc" controllerName="fivea.controller.Breeder_Detail">
2
- <Page title="Breeder" showNavButton="true" navButtonPress="onNavBack">
1
+ <mvc:View controllerName="fivea.controller.Breeder_Detail"
2
+ xmlns="sap.m"
3
+ xmlns:f="sap.f"
4
+ xmlns:t="sap.ui.table"
5
+ xmlns:fo="sap.ui.layout.form"
6
+ xmlns:mvc="sap.ui.core.mvc"
7
+ xmlns:l="sap.ui.layout"
8
+ xmlns:u="sap.ui.unified" >
9
+
10
+ <Page title="Breeder" showNavButton="false">
3
11
  <customHeader>
4
12
  <Bar>
5
13
  <contentLeft>
6
14
  <Button icon="sap-icon://nav-back" press="onNavBack" />
7
- <Button icon="sap-icon://save" type="Accept" press="onSave" text="Save changes" />
15
+ <Button icon="sap-icon://save" type="Accept" press="onSave"
16
+ text="Save changes" />
8
17
  </contentLeft>
9
18
  <contentRight>
10
19
  <Button icon="sap-icon://delete" text="Delete" press="onDeletePress" />
11
20
  </contentRight>
12
21
  </Bar>
13
22
  </customHeader>
23
+
14
24
  <ObjectHeader title="id : {id}" />
15
- <Panel expandable="true" expanded="true" headerText="Details" width="auto" class="sapUiResponsiveMargin">
25
+ <Panel expandable="true" expanded="true" headerText="Avatar"
26
+ width="auto" class="sapUiResponsiveMargin">
16
27
  <content>
17
- <f:SimpleForm editable="true">
28
+ <FlexBox alignItems="Center" justifyContent="Center">
29
+ <items>
30
+
31
+ <f:Avatar id="avatar" class="sapUiSmallMarginEnd"/>
32
+
33
+ <Button icon="sap-icon://attachment" class="sapUiSmallMarginEnd"
34
+ type="Accept"
35
+ text="Upload Avatar"
36
+ press="handleUploadPress" />
37
+ <u:FileUploader id="fileUploader" class="sapUiSmallMarginEnd"
38
+ useMultipart="false"
39
+ name="myAvatarUpload"
40
+ width="400px"
41
+ tooltip="Upload your avatar file to the local server"
42
+ uploadComplete="handleUploadComplete"/>
43
+ </items>
44
+ </FlexBox>
45
+ </content>
46
+ </Panel>
47
+
48
+ <Panel expandable="true" expanded="true" headerText="Details" width="auto"
49
+ class="sapUiResponsiveMargin">
50
+ <content>
51
+ <fo:SimpleForm editable="true">
18
52
  <Label text="First name" />
19
- <Input id="first_name" type="Text" name="first_name" enabled="true" value="{first_name}" />
53
+ <Input id="first_name" type="Text" name="first_name" enabled="true"
54
+ value="{first_name}" />
20
55
  <Label text="Last name" />
21
- <Input id="last_name" type="Text" name="last_name" enabled="true" value="{last_name}" />
22
- </f:SimpleForm>
56
+ <Input id="last_name" type="Text" name="last_name" enabled="true"
57
+ value="{last_name}" />
58
+ </fo:SimpleForm>
23
59
  </content>
24
60
  </Panel>
25
- <Panel expandable="true" expanded="true" headerText="Cultivars" width="auto" class="sapUiResponsiveMargin">
61
+ <Panel expandable="true" expanded="true" headerText="Cultivars"
62
+ width="auto" class="sapUiResponsiveMargin">
26
63
  <content>
27
64
  <t:Table id="breeder_cultivar_table" selectionMode="Single"
28
65
  rowSelectionChange="onCultivarSelectionChange"
@@ -20,7 +20,8 @@
20
20
  selectionBehavior="Row"
21
21
  rows="{
22
22
  path: '/cultivar',
23
- parameters: {expand: 'breeder', operationMode: 'Server'}
23
+ parameters: {expand: 'breeder',
24
+ operationMode: 'Server'}
24
25
  }">
25
26
 
26
27
  <columns>
@@ -9,7 +9,8 @@
9
9
  <Bar>
10
10
  <contentLeft>
11
11
  <Button icon="sap-icon://nav-back" press="onNavBack"/>
12
- <Button icon="sap-icon://create" type="Accept" text="Create" press="onCreatePress"/>
12
+ <Button icon="sap-icon://create" type="Accept" text="Create"
13
+ press="onCreatePress"/>
13
14
  </contentLeft>
14
15
  </Bar>
15
16
  </customHeader>
@@ -17,9 +18,11 @@
17
18
 
18
19
  <f:SimpleForm id="cultivar_create_form" editable="true">
19
20
  <Label text="Name"/>
20
- <Input id="name" type="Text" name="name" enabled="true" value="{name}" />
21
+ <Input id="name" type="Text" name="name" enabled="true"
22
+ value="{name}" />
21
23
  <Label text="Year"/>
22
- <Input id="year" type="Number" name="year" enabled="true" value="{year}" />
24
+ <Input id="year" type="Number" name="year" enabled="true"
25
+ value="{year}" />
23
26
  <Label text="Breeder"/>
24
27
  <Input id="breeder_id" type="Text"
25
28
  width="40%"
@@ -1,4 +1,12 @@
1
- <mvc:View xmlns="sap.m" xmlns:t="sap.ui.table" xmlns:l="sap.ui.layout" xmlns:f="sap.ui.layout.form" xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns:u="sap.ui.unified" controllerName="fivea.controller.Cultivar_Detail">
1
+ <mvc:View controllerName="fivea.controller.Cultivar_Detail"
2
+ xmlns="sap.m"
3
+ xmlns:f="sap.f"
4
+ xmlns:t="sap.ui.table"
5
+ xmlns:l="sap.ui.layout"
6
+ xmlns:fl="sap.ui.layout.form"
7
+ xmlns:core="sap.ui.core"
8
+ xmlns:mvc="sap.ui.core.mvc"
9
+ xmlns:u="sap.ui.unified">
2
10
  <Page title="Cultivar detail">
3
11
  <customHeader>
4
12
  <Bar>
@@ -9,44 +17,50 @@
9
17
  <Button icon="sap-icon://nav-back" press="onNavBack" />
10
18
  <Button icon="sap-icon://save" type="Accept" press="onSave" text="Save changes" />
11
19
  <Button icon="sap-icon://create" type="Accept" text="Create" press="onCreatePress" />
12
- <!-- Teaser
13
- <Button icon="sap-icon://attachment" type="Accept" text="Upload" press="handleUploadPress" />
14
- <u:FileUploader id="fileUploader" useMultipart="false" name="myFileUpload"
15
- uploadUrl="http://localhost:9494/odata" width="400px"
16
- tooltip="Upload your file to the local server"
17
- uploadComplete="handleUploadComplete"/>
18
- -->
19
-
20
20
  </contentLeft>
21
21
  </Bar>
22
22
  </customHeader>
23
23
  <ObjectHeader title="{id} : {name}" />
24
- <Panel expandable="true" expanded="true" headerText="Details" width="auto" class="sapUiResponsiveMargin">
24
+ <Panel expandable="true" expanded="true" headerText="Details"
25
+ width="auto" class="sapUiResponsiveMargin">
25
26
  <content>
26
- <f:SimpleForm editable="true">
27
+ <fl:SimpleForm editable="true">
27
28
  <Label text="Name" />
28
- <Input id="name" type="Text" name="name" enabled="true" value="{name}" />
29
+ <Input id="name" type="Text" name="name" enabled="true"
30
+ value="{name}" />
29
31
  <Label text="Year" />
30
- <Input id="year" type="Number" name="year" enabled="true" value="{year}" />
32
+ <Input id="year" type="Number" name="year" enabled="true"
33
+ value="{year}" />
31
34
  <Label text="Breeder" />
32
- <Input id="breeder_id" type="Text" width="40%" showValueHelp="true"
33
- valueHelpRequest="onBreederIdValueHelp" name="breeder_id"
34
- value="{breeder_id}" enabled="true" />
35
- <Link id="breeder_id_descr" text="{breeder/first_name} {breeder/last_name}"
36
- press="handleBreederPress" />
37
- <Button icon="sap-icon://create" type="Accept" text="Create"
38
- press="onBreederCreatePress" />
39
- </f:SimpleForm>
35
+ <Input id="breeder_id" type="Text" width="40%"
36
+ showValueHelp="true"
37
+ valueHelpRequest="onBreederIdValueHelp"
38
+ name="breeder_id" value="{breeder_id}" enabled="true" />
39
+
40
+ <f:Avatar id="avatar" class="sapUiSmallMarginEnd"/>
41
+ <Link id="breeder_id_descr"
42
+ text="{breeder/first_name} {breeder/last_name}"
43
+ press="handleBreederPress" />
44
+ <Button icon="sap-icon://create"
45
+ type="Accept"
46
+ text="Create"
47
+ press="onBreederCreatePress" />
48
+ </fl:SimpleForm>
40
49
  </content>
41
50
  </Panel>
42
-
43
- <Panel expandable="true" expanded="true" headerText="Parents"
44
- width="auto" class="sapUiResponsiveMargin">
51
+ <Panel expandable="true" expanded="true" headerText="Images" width="auto" class="sapUiResponsiveMargin">
45
52
  <content>
46
- <t:Table id="parent_table"
47
- rows="{path: 'parent', parameters:{expand : 'cultivar/breeder,parent/breeder'} }" rowSelectionChange="onParentSelectionChange"
48
- selectionMode="Single" visibleRowCount="4"
49
- visibleRowCountMode="Auto" selectionBehavior="Row">
53
+ <Toolbar class="sapUiMediumMarginTop" id="im_toolbar">
54
+ <Button icon="sap-icon://attachment" type="Accept"
55
+ text="Upload" press="handleUploadPress" />
56
+ <u:FileUploader id="fileUploader" useMultipart="false" name="myFileUpload" uploadUrl="/odata/cultivar({id})/photo" width="400px" tooltip="Upload your file to the local server" uploadComplete="handleUploadComplete" />
57
+ </Toolbar>
58
+ <l:HorizontalLayout id="images" />
59
+ </content>
60
+ </Panel>
61
+ <Panel expandable="true" expanded="true" headerText="Parents" width="auto" class="sapUiResponsiveMargin">
62
+ <content>
63
+ <t:Table id="parent_table" rows="{path: 'parent', parameters:{expand : 'cultivar/breeder,parent/breeder'} }" rowSelectionChange="onParentSelectionChange" selectionMode="Single" visibleRowCount="4" visibleRowCountMode="Auto" selectionBehavior="Row">
50
64
  <t:columns>
51
65
  <t:Column width="10%" autoResizable="true">
52
66
  <Label text="Par. Type" />
@@ -70,16 +84,9 @@
70
84
  </t:Table>
71
85
  </content>
72
86
  </Panel>
73
-
74
- <Panel expandable="true" expanded="true"
75
- headerText="Direct decendency"
76
- width="auto" class="sapUiResponsiveMargin">
87
+ <Panel expandable="true" expanded="true" headerText="Direct decendency" width="auto" class="sapUiResponsiveMargin">
77
88
  <content>
78
- <t:Table id="child_table"
79
- rows="{path: 'child', parameters:{expand : 'cultivar/breeder'} }"
80
- rowSelectionChange="onChildSelectionChange"
81
- selectionMode="Single" visibleRowCount="10"
82
- visibleRowCountMode="Auto" selectionBehavior="Row">
89
+ <t:Table id="child_table" rows="{path: 'child', parameters:{expand : 'cultivar/breeder'} }" rowSelectionChange="onChildSelectionChange" selectionMode="Single" visibleRowCount="10" visibleRowCountMode="Auto" selectionBehavior="Row">
83
90
  <t:columns>
84
91
  <t:Column width="10%" autoResizable="true">
85
92
  <Label text="Par. Type" />
@@ -87,16 +94,13 @@
87
94
  <Text text="{path:'ptype_id'}" />
88
95
  </t:template>
89
96
  </t:Column>
90
- <t:Column autoResizable="true" sortProperty="cultivar/name"
91
- filterProperty="cultivar/name">
97
+ <t:Column autoResizable="true" sortProperty="cultivar/name" filterProperty="cultivar/name">
92
98
  <Label text="Cultivar" />
93
99
  <t:template>
94
100
  <Text text="{cultivar/name}" />
95
101
  </t:template>
96
102
  </t:Column>
97
- <t:Column autoResizable="true"
98
- sortProperty="cultivar/breeder/last_name"
99
- filterProperty="cultivar/breeder/last_name">
103
+ <t:Column autoResizable="true" sortProperty="cultivar/breeder/last_name" filterProperty="cultivar/breeder/last_name">
100
104
  <Label text="Breeder" />
101
105
  <t:template>
102
106
  <Text text="{cultivar/breeder/last_name}" />
@@ -107,4 +111,4 @@
107
111
  </content>
108
112
  </Panel>
109
113
  </Page>
110
- </mvc:View>
114
+ </mvc:View>
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FiveApples
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
6
6
 
7
7
  module OpenUI5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fiveapples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - D.M.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-23 00:00:00.000000000 Z
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safrano
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '0.4'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.3.4
22
+ version: 0.4.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.3'
29
+ version: '0.4'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.3.4
32
+ version: 0.4.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: thin
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -138,6 +138,7 @@ extra_rdoc_files: []
138
138
  files:
139
139
  - bin/fiveapples
140
140
  - lib/config5.ru
141
+ - lib/fa_utils.rb
141
142
  - lib/fiveapples.db3
142
143
  - lib/fiveapples.rb
143
144
  - lib/model.rb
@@ -8548,12 +8549,17 @@ files:
8548
8549
  - lib/options.rb
8549
8550
  - lib/ui5/Component.js.erb
8550
8551
  - lib/ui5/Component.js.erb~
8552
+ - lib/ui5/controller/Base64.js
8553
+ - lib/ui5/controller/Breeder.js
8551
8554
  - lib/ui5/controller/BreederList.controller.js
8552
8555
  - lib/ui5/controller/Breeder_Create.controller.js
8553
8556
  - lib/ui5/controller/Breeder_Detail.controller.js
8557
+ - lib/ui5/controller/Create.js
8554
8558
  - lib/ui5/controller/CultivarList.controller.js
8555
8559
  - lib/ui5/controller/Cultivar_Create.controller.js
8556
8560
  - lib/ui5/controller/Cultivar_Detail.controller.js
8561
+ - lib/ui5/controller/Detail.js
8562
+ - lib/ui5/controller/FileUpload.js
8557
8563
  - lib/ui5/controller/FiveApplesApp.controller.js
8558
8564
  - lib/ui5/controller/FiveaBaseController.js
8559
8565
  - lib/ui5/controller/MCultivarList.controller.js
@@ -8643,8 +8649,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
8643
8649
  - !ruby/object:Gem::Version
8644
8650
  version: '0'
8645
8651
  requirements: []
8646
- rubyforge_project:
8647
- rubygems_version: 2.7.6.2
8652
+ rubygems_version: 3.1.2
8648
8653
  signing_key:
8649
8654
  specification_version: 4
8650
8655
  summary: Fiveapples is a fully opensource standalone OData + openui5 demo app.