Skip to content

Commit

Permalink
Closed #1095 - Add link to product log
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubervila committed Mar 15, 2018
1 parent 4d5d494 commit b54bbed
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 9 deletions.
14 changes: 13 additions & 1 deletion api/product/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import time
from urllib.parse import urljoin

import humanize
from django.contrib.auth.models import User
Expand Down Expand Up @@ -42,6 +43,8 @@ class ProductSerializer(serializers.HyperlinkedModelSerializer):

tablename = serializers.SerializerMethodField()

productlog = serializers.SerializerMethodField()

class Meta:
model = Product

Expand All @@ -63,7 +66,8 @@ class Meta:
'prl_related',
'prl_cross_identification',
'prl_cross_property',
'tablename'
'tablename',
'productlog'
)

def get_pcl_name(self, obj):
Expand Down Expand Up @@ -126,6 +130,14 @@ def get_tablename(self, obj):
except:
return None

def get_productlog(self, obj):
try:
site = obj.prd_process_id.epr_site.sti_url
return urljoin(site, "VP/getViewProcessCon?process_id=%s" % obj.prd_process_id.epr_original_id)

except:
return None


class FileSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
Expand Down
2 changes: 1 addition & 1 deletion frontend/build/production/Target/app.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"packages":{"classic":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core"],"version":"6.0.1.250"},"cmd":{"current":"6.5.1.240","version":"6.5.1.240"},"common":{"css":true,"included":true,"required":true,"requires":["ext","core","classic","ux"],"version":"1.0.0"},"core":{"css":true,"included":true,"required":true,"requires":["ext","classic"],"version":"6.0.1.250"},"ext":{"css":true,"included":true,"license":"gpl","namespace":"Ext","required":true,"requires":[],"version":"6.0.1.250"},"font-awesome":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"theme":"theme-neptune","version":"6.0.1.250"},"theme-base":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"theme-crisp":{"css":true,"extend":"theme-neptune","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"version":"6.0.1.250"},"theme-neptune":{"css":true,"extend":"theme-neutral","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral"],"version":"6.0.1.250"},"theme-neutral":{"css":true,"extend":"theme-base","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base"],"version":"6.0.1.250"},"ux":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"visiomatic":{"css":true,"included":true,"namespace":"visiomatic","required":true,"requires":["ext","core","classic"],"version":"1.0.0"}},"js":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jquery-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic-src.js"},{"path":"app.js"}],"css":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot.css"},{"exclude":["fashion"],"path":"resources/Target-all.css"}],"cache":{"enable":true,"deltas":true},"fashion":{"inliner":{"enable":false}},"name":"Target","version":"1.0.0.0","framework":"ext","toolkit":"classic","theme":"theme-crisp","loader":{"cache":"20180315155043","cacheParam":"_dc"},"id":"85a0e2c2-ad9b-4f4a-84ed-649bd3f711fd","hash":"9065716416f42f9b331a586af38106702b22fdae","profile":"","resources":{"path":"resources"}}
{"packages":{"classic":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core"],"version":"6.0.1.250"},"cmd":{"current":"6.5.1.240","version":"6.5.1.240"},"common":{"css":true,"included":true,"required":true,"requires":["ext","core","classic","ux"],"version":"1.0.0"},"core":{"css":true,"included":true,"required":true,"requires":["ext","classic"],"version":"6.0.1.250"},"ext":{"css":true,"included":true,"license":"gpl","namespace":"Ext","required":true,"requires":[],"version":"6.0.1.250"},"font-awesome":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"theme":"theme-neptune","version":"6.0.1.250"},"theme-base":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"theme-crisp":{"css":true,"extend":"theme-neptune","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"version":"6.0.1.250"},"theme-neptune":{"css":true,"extend":"theme-neutral","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral"],"version":"6.0.1.250"},"theme-neutral":{"css":true,"extend":"theme-base","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base"],"version":"6.0.1.250"},"ux":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"visiomatic":{"css":true,"included":true,"namespace":"visiomatic","required":true,"requires":["ext","core","classic"],"version":"1.0.0"}},"js":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jquery-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic-src.js"},{"path":"app.js"}],"css":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot.css"},{"exclude":["fashion"],"path":"resources/Target-all.css"}],"cache":{"enable":true,"deltas":true},"fashion":{"inliner":{"enable":false}},"name":"Target","version":"1.0.0.0","framework":"ext","toolkit":"classic","theme":"theme-crisp","loader":{"cache":"20180315162947","cacheParam":"_dc"},"id":"85a0e2c2-ad9b-4f4a-84ed-649bd3f711fd","hash":"81aada18b1b74d7bfc44c6effa88f1e82bcf6b50","profile":"","resources":{"path":"resources"}}
2 changes: 1 addition & 1 deletion frontend/build/production/Target/app.jsonp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Ext.Microloader.setManifest({"packages":{"classic":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core"],"version":"6.0.1.250"},"cmd":{"current":"6.5.1.240","version":"6.5.1.240"},"common":{"css":true,"included":true,"required":true,"requires":["ext","core","classic","ux"],"version":"1.0.0"},"core":{"css":true,"included":true,"required":true,"requires":["ext","classic"],"version":"6.0.1.250"},"ext":{"css":true,"included":true,"license":"gpl","namespace":"Ext","required":true,"requires":[],"version":"6.0.1.250"},"font-awesome":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"theme":"theme-neptune","version":"6.0.1.250"},"theme-base":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"theme-crisp":{"css":true,"extend":"theme-neptune","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"version":"6.0.1.250"},"theme-neptune":{"css":true,"extend":"theme-neutral","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral"],"version":"6.0.1.250"},"theme-neutral":{"css":true,"extend":"theme-base","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base"],"version":"6.0.1.250"},"ux":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"visiomatic":{"css":true,"included":true,"namespace":"visiomatic","required":true,"requires":["ext","core","classic"],"version":"1.0.0"}},"js":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jquery-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic-src.js"},{"path":"app.js"}],"css":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot.css"},{"exclude":["fashion"],"path":"resources/Target-all.css"}],"cache":{"enable":true,"deltas":true},"fashion":{"inliner":{"enable":false}},"name":"Target","version":"1.0.0.0","framework":"ext","toolkit":"classic","theme":"theme-crisp","loader":{"cache":"20180315155043","cacheParam":"_dc"},"id":"85a0e2c2-ad9b-4f4a-84ed-649bd3f711fd","hash":"9065716416f42f9b331a586af38106702b22fdae","profile":"","resources":{"path":"resources"}});
Ext.Microloader.setManifest({"packages":{"classic":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core"],"version":"6.0.1.250"},"cmd":{"current":"6.5.1.240","version":"6.5.1.240"},"common":{"css":true,"included":true,"required":true,"requires":["ext","core","classic","ux"],"version":"1.0.0"},"core":{"css":true,"included":true,"required":true,"requires":["ext","classic"],"version":"6.0.1.250"},"ext":{"css":true,"included":true,"license":"gpl","namespace":"Ext","required":true,"requires":[],"version":"6.0.1.250"},"font-awesome":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"theme":"theme-neptune","version":"6.0.1.250"},"theme-base":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"theme-crisp":{"css":true,"extend":"theme-neptune","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral","theme-neptune"],"version":"6.0.1.250"},"theme-neptune":{"css":true,"extend":"theme-neutral","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base","theme-neutral"],"version":"6.0.1.250"},"theme-neutral":{"css":true,"extend":"theme-base","included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic","theme-base"],"version":"6.0.1.250"},"ux":{"css":true,"included":true,"namespace":"Ext","required":true,"requires":["ext","core","classic"],"version":"6.0.1.250"},"visiomatic":{"css":true,"included":true,"namespace":"visiomatic","required":true,"requires":["ext","core","classic"],"version":"1.0.0"}},"js":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jquery-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot-min.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.js"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic-src.js"},{"path":"app.js"}],"css":[{"path":"packages/local/visiomatic/src/Leaflet/dist/leaflet.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/visiomatic.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/spectrum.css"},{"path":"packages/local/visiomatic/src/visiomatic/dist/jqplot.css"},{"exclude":["fashion"],"path":"resources/Target-all.css"}],"cache":{"enable":true,"deltas":true},"fashion":{"inliner":{"enable":false}},"name":"Target","version":"1.0.0.0","framework":"ext","toolkit":"classic","theme":"theme-crisp","loader":{"cache":"20180315162947","cacheParam":"_dc"},"id":"85a0e2c2-ad9b-4f4a-84ed-649bd3f711fd","hash":"81aada18b1b74d7bfc44c6effa88f1e82bcf6b50","profile":"","resources":{"path":"resources"}});
1 change: 1 addition & 0 deletions frontend/explorer/app/model/Product.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Ext.define('Explorer.model.Product', {
{name:'is_owner', type:'boolean', defaultValue: false},
{name:'tablename', type:'string'},
{name: 'epr_original_id', type: 'string'},
{name: 'productlog', type: 'string'},
// Nome do producto + process ID
{
name:'name_with_process_id',
Expand Down
52 changes: 46 additions & 6 deletions frontend/explorer/app/view/system/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,56 @@ Ext.define('Explorer.view.system.Form', {
}
},
{
xtype: 'fieldcontainer',
fieldLabel: 'Proccess Id',
bind: {
value: '{currentProduct.epr_original_id}'
}
defaults: {
margin: '0 5 0 0'
},
layout: 'hbox',
items: [
{
xtype: "textfield",
width: 140,
bind: {
value: '{currentProduct.epr_original_id}'
}
},
{
xtype: "button",
iconCls: 'fa fa-info',
tooltip: "Product Log",
bind: {
href: '{currentProduct.productlog}',
disabled: '{!currentProduct.productlog}'
}
}
]
},
{
xtype: 'fieldcontainer',
fieldLabel: 'VAC',
bind: {
value: '{vacCluster.epr_original_id} - {vacCluster.prd_display_name}'
}
defaults: {
margin: '0 5 0 0'
},
layout: 'hbox',
items: [
{
xtype: "textfield",
width: 140,
bind: {
value: '{vacCluster.epr_original_id} - {vacCluster.prd_display_name}'
}
},
{
xtype: "button",
iconCls: 'fa fa-info',
tooltip: "Product Log",
bind: {
href: '{vacCluster.productlog}',
disabled: '{!vacCluster.productlog}'
}
}
]
}
]
}
Expand Down
10 changes: 10 additions & 0 deletions frontend/explorer/app/view/system/VacGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ Ext.define('Explorer.view.system.VacGrid', {
iconCls: 'x-tbar-loading',
handler: 'loadVacObjects',
tooltip: 'Refresh'
},
'-',
{
xtype: "button",
iconCls: 'fa fa-info',
tooltip: "Product Log",
bind: {
href: '{currentVacProduct.productlog}',
disabled: '{!currentVacProduct.productlog}'
}
}
]
});
Expand Down

0 comments on commit b54bbed

Please sign in to comment.