Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
daf30b1f
Commit
daf30b1f
authored
Jul 03, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Allow user attach a Hosting Subscription to a Project
parent
925a2770
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1110 additions
and
7 deletions
+1110
-7
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_hosting_subscription_view_js.js
...rjs_gadget_erp5_page_slap_hosting_subscription_view_js.js
+15
-3
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_hosting_subscription_view_js.xml
...js_gadget_erp5_page_slap_hosting_subscription_view_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html.html
...et_erp5_page_slap_transfer_hosting_subscription_html.html
+26
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html.xml
...get_erp5_page_slap_transfer_hosting_subscription_html.xml
+365
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js.js
...gadget_erp5_page_slap_transfer_hosting_subscription_js.js
+198
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js.xml
...adget_erp5_page_slap_transfer_hosting_subscription_js.xml
+361
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml
...mplateItem/web_page_module/rjs_gadget_slapos_appcache.xml
+4
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_viewAsHateoas.xml
...apos_hal_json_style/HostingSubscription_viewAsHateoas.xml
+1
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_viewAsHateoas/my_source_project_title.xml
...ingSubscription_viewAsHateoas/my_source_project_title.xml
+134
-0
master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list
...jio/bt/template_keep_last_workflow_history_only_path_list
+2
-0
master/bt5/slapos_jio/bt/template_path_list
master/bt5/slapos_jio/bt/template_path_list
+2
-0
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_hosting_subscription_view_js.js
View file @
daf30b1f
...
...
@@ -269,6 +269,17 @@
"
hidden
"
:
0
,
"
type
"
:
"
GadgetField
"
},
"
my_source_project
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Current Project
"
,
"
default
"
:
gadget
.
state
.
doc
.
source_project_title
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
0
,
"
key
"
:
"
source_project_title
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_monitoring_status
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Monitoring Status
"
,
...
...
@@ -387,10 +398,9 @@
group_list
:
[[
"
left
"
,
[[
"
my_title
"
],
[
"
my_reference
"
],
[
"
my_short_title
"
],
[
"
my_description
"
]]
],
[
"
right
"
,
[[
"
my_slap_state_title
"
],
[
'
my_monitoring_status
'
],
[
'
my_monitor_scope
'
],
[
'
my_upgrade_scope
'
]]
[[
"
my_slap_state_title
"
],
[
'
my_monitoring_status
'
],
[
'
my_monitor_scope
'
],
[
'
my_upgrade_scope
'
]
,
[
'
my_source_project
'
]
]
],
[
"
center
"
,
[[
"
my_source_reference
"
],
[
"
my_url_string
"
]]
...
...
@@ -410,7 +420,8 @@
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
"
page
"
:
"
slap_stop_hosting_subscription
"
}}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
"
page
"
:
"
slap_destroy_hosting_subscription
"
}}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
page
:
"
slap_rss_ticket
"
}}),
gadget
.
getUrlFor
({
command
:
'
history_previous
'
})
gadget
.
getUrlFor
({
command
:
'
history_previous
'
}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
page
:
"
slap_transfer_hosting_subscription
"
}})
]);
})
.
push
(
function
(
url_list
)
{
...
...
@@ -420,6 +431,7 @@
destroy_url
:
url_list
[
4
],
rss_url
:
url_list
[
5
],
selection_url
:
url_list
[
6
],
transfer_url
:
url_list
[
7
],
save_action
:
true
};
if
(
gadget
.
state
.
doc
.
slap_state
===
"
start_requested
"
)
{
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_hosting_subscription_view_js.xml
View file @
daf30b1f
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
5.56864.40160.43520
</string>
</value>
<value>
<string>
97
6.53553.17660.802
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
58622604.12
</float>
<float>
15
62115464.51
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html.html
0 → 100644
View file @
daf30b1f
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Add Text Document
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_erp5_page_slap_transfer_hosting_subscription.js"
></script>
</head>
<body>
<form
class=
"save_form ui-body-c"
novalidate
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"
></button>
<div
data-gadget-url=
"gadget_erp5_form.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
</div>
</form>
</body>
</html>
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html.xml
0 → 100644
View file @
daf30b1f
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js.js
0 → 100644
View file @
daf30b1f
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
'
notifySubmitted
'
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
()
{
return
this
.
triggerSubmit
();
})
.
onEvent
(
'
submit
'
,
function
()
{
var
gadget
=
this
;
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
})
.
push
(
function
(
doc
)
{
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
url
)
{
// This is horrible
return
gadget
.
jio_putAttachment
(
doc
.
relative_url
,
url
+
doc
.
relative_url
+
"
/HostingSubscription_createMovement
"
,
doc
);
})
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
'
Computer is transferred.
'
,
status
:
'
success
'
})
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
doc
.
relative_url
,
"
page
"
:
"
slap_controller
"
}});
});
});
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
return
this
.
element
.
querySelector
(
'
button[type="submit"]
'
).
click
();
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getSetting
(
"
me
"
);
})
.
push
(
function
(
setting
)
{
return
gadget
.
jio_get
(
setting
);
})
.
push
(
function
(
me
)
{
var
i
,
destination_list
=
'
"NULL",
'
,
destination_project_list
=
'
"NULL",
'
;
for
(
i
in
me
.
assignment_destination_project_list
)
{
destination_project_list
+=
'
"
'
+
me
.
assignment_destination_project_list
[
i
]
+
'
",
'
;
}
for
(
i
in
me
.
assignment_destination_list
)
{
destination_list
+=
'
"
'
+
me
.
assignment_destination_list
[
i
]
+
'
",
'
;
}
return
RSVP
.
all
([
gadget
.
getDeclaredGadget
(
'
form_view
'
),
gadget
.
jio_get
(
options
.
jio_key
),
gadget
.
jio_allDocs
({
query
:
'
portal_type:"Organisation" AND relative_url:(
'
+
destination_list
+
'
)
'
,
sort_on
:
[[
'
reference
'
,
'
ascending
'
]],
select_list
:
[
'
reference
'
,
'
title
'
]
}),
gadget
.
jio_allDocs
({
query
:
'
portal_type:"Project" AND validation_state:"validated" AND relative_url:(
'
+
destination_project_list
+
'
)
'
,
sort_on
:
[[
'
reference
'
,
'
ascending
'
]],
select_list
:
[
'
reference
'
,
'
title
'
]
})
]);
})
.
push
(
function
(
result
)
{
var
doc
=
result
[
1
],
site_list
=
[[
""
,
""
]],
project_list
=
[[
""
,
""
]],
i
,
value
,
project_len
=
result
[
3
].
data
.
total_rows
,
site_len
=
result
[
2
].
data
.
total_rows
;
for
(
i
=
0
;
i
<
site_len
;
i
+=
1
)
{
site_list
.
push
([
result
[
2
].
data
.
rows
[
i
].
value
.
title
?
result
[
2
].
data
.
rows
[
i
].
value
.
title
:
result
[
2
].
data
.
rows
[
i
].
value
.
reference
,
result
[
2
].
data
.
rows
[
i
].
id
]);
}
for
(
i
=
0
;
i
<
project_len
;
i
+=
1
)
{
project_list
.
push
([
result
[
3
].
data
.
rows
[
i
].
value
.
title
?
result
[
3
].
data
.
rows
[
i
].
value
.
title
:
result
[
3
].
data
.
rows
[
i
].
value
.
reference
,
result
[
3
].
data
.
rows
[
i
].
id
]);
}
return
result
[
0
].
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
my_title
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Title
"
,
"
default
"
:
doc
.
title
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
0
,
"
key
"
:
"
title
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_reference
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Reference
"
,
"
default
"
:
doc
.
reference
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
0
,
"
key
"
:
"
reference
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_source_project
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Current Project
"
,
"
default
"
:
doc
.
source_project_title
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
0
,
"
key
"
:
"
source_project_title
"
,
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_destination_project
"
:
{
"
description
"
:
"
The name of a document in ERP5
"
,
"
title
"
:
"
Future Project
"
,
"
default
"
:
""
,
"
items
"
:
project_list
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
destination_project
"
,
"
hidden
"
:
0
,
"
type
"
:
"
ListField
"
},
"
my_relative_url
"
:
{
"
description
"
:
""
,
"
title
"
:
"
Parent Relative Url
"
,
"
default
"
:
options
.
jio_key
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
relative_url
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
}
}},
"
_links
"
:
{
"
type
"
:
{
// form_list display portal_type in header
name
:
""
}
}
},
form_definition
:
{
group_list
:
[[
"
left
"
,
[[
"
my_title
"
],
[
"
my_reference
"
],
[
"
my_source_project
"
],
[
"
my_destination_project
"
],
[
"
my_relative_url
"
]]
]]
}
});
})
.
push
(
function
()
{
return
gadget
.
getSetting
(
'
document_title
'
);
})
.
push
(
function
(
document_title
)
{
return
gadget
.
updateHeader
({
page_title
:
"
Transfer Computer
"
,
submit_action
:
true
});
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js.xml
0 → 100644
View file @
daf30b1f
This diff is collapsed.
Click to expand it.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_appcache.xml
View file @
daf30b1f
...
...
@@ -372,6 +372,8 @@ gadget_erp5_page_slap_ticket_list.js\n
gadget_erp5_page_slap_ticket_view.js\n
gadget_erp5_page_slap_transfer_computer.html\n
gadget_erp5_page_slap_transfer_computer.js\n
gadget_erp5_page_slap_transfer_hosting_subscription.html\n
gadget_erp5_page_slap_transfer_hosting_subscription.js\n
gadget_erp5_page_slap_trial_request_message.html\n
gadget_erp5_page_slap_trial_request_message.js\n
gadget_erp5_page_slap_upgrade_decision_view.html\n
...
...
@@ -573,7 +575,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.531
62.22511.22903
</string>
</value>
<value>
<string>
976.531
95.17162.28177
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -591,7 +593,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1562
093475.71
</float>
<float>
1562
117196.29
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_viewAsHateoas.xml
View file @
daf30b1f
...
...
@@ -107,6 +107,7 @@
<string>
my_monitor_scope
</string>
<string>
my_connection_parameter_list
</string>
<string>
my_upgrade_scope
</string>
<string>
my_source_project_title
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_viewAsHateoas/my_source_project_title.xml
0 → 100644
View file @
daf30b1f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_source_project_title
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Current Project
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: here.Item_getCurrentProjectValue().title
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio/bt/template_keep_last_workflow_history_only_path_list
View file @
daf30b1f
...
...
@@ -126,6 +126,8 @@ web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_ticket_view_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_html
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html
web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_html
web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_js
web_page_module/rjs_gadget_erp5_page_slap_upgrade_decision_view_html
...
...
master/bt5/slapos_jio/bt/template_path_list
View file @
daf30b1f
...
...
@@ -132,6 +132,8 @@ web_page_module/rjs_gadget_erp5_page_slap_ticket_list_js
web_page_module/rjs_gadget_erp5_page_slap_ticket_view_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_html
web_page_module/rjs_gadget_erp5_page_slap_transfer_computer_js
web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_html
web_page_module/rjs_gadget_erp5_page_slap_transfer_hosting_subscription_js
web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_html
web_page_module/rjs_gadget_erp5_page_slap_trial_request_message_js
web_page_module/rjs_gadget_erp5_page_slap_upgrade_decision_view_html
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment