"use strict";(self.webpackChunkhopsworks_front=self.webpackChunkhopsworks_front||[]).push([[2898],{92898:function(t,e,r){r.r(e);var i=r(29439),o=r(72791),u=r(82222),n=r(16871),a=r(95048),s=r(76237),c=r(11942),f=r(91813),d=r(97355),l=r(81497),m=r(97030),v=r(23244),p=r(70477),I=r(62618),h=r(59728),C=r(754),G=r(1281),Z=r(76871),g=r(80184);e.default=function(){var t=s._G.DATE_TIME.DATE_TIME_FULL,e=(0,n.UO)(),r=e.id,S=e.fsId,j=e.fgId,k=e.commitTime,b=(0,a.v9)((function(t){var e;return null===(e=t.featureGroupStatistics)||void 0===e?void 0:e.entities.statistics})),T=(0,a.v9)((function(t){return t.loading.effects.featureGroupStatistics.fetch})),w=(0,a.v9)((function(t){return t.featureGroupStatisticsCommits})),x=(0,p.Z)(+r,+j,+S),E=x.isLoading,V=x.data,_=(0,n.s0)(),D=(0,a.I0)(),L=(0,Z.Z)(),F=L.canEdit,M=L.isLoading;(0,o.useEffect)((function(){D.featureGroupStatisticsCommits.fetch({projectId:+r,featureStoreId:+S,featureGroupId:+j}),D.featureGroupStatistics.fetch({projectId:+r,featureStoreId:+S,featureGroupId:+j,timeCommit:k})}),[r,j,D,S,k]);var O=(0,o.useCallback)((function(){D.featureGroupStatisticsCommits.fetch({projectId:+r,featureStoreId:+S,featureGroupId:+j}),D.featureGroupStatistics.fetch({projectId:+r,featureStoreId:+S,featureGroupId:+j,timeCommit:k})}),[D.featureGroupStatisticsCommits,D.featureGroupStatistics,r,S,j,k]),y=(0,o.useMemo)((function(){var e=k;return w.length>0&&(e&&e!==w[0]?Number.isInteger(+e)&&(e=(0,u.Z)(+e,t)):e="".concat((0,u.Z)(+w[0],t)," (latest)")),e}),[k,w,t]),U=(0,o.useCallback)((function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j,o=e;e.includes("(latest)")&&(o=e.slice(0,e.indexOf(" (latest)")));var n=w.find((function(e){return(0,u.Z)(+e,t)===o})),a=w.find((function(e){var r=(0,u.Z)(+e,t);return r===y||"".concat(r," (latest)")===y}));n&&a!==n&&_((0,C.Z)(G.Z.featureGroup.correlationViewCommit,G.Z.project.value,{id:r,fsId:S,fgId:i,commitTime:n}))}),[r,S,w,_,j,y,t]),A=(0,o.useCallback)((function(t){var e,r,i=null===V||void 0===V||null===(e=V.versions)||void 0===e||null===(r=e.find((function(e){return e.version===+t})))||void 0===r?void 0:r.id;i&&U(y,String(i))}),[V,y,U]),N=(0,o.useCallback)((function(t){var e=(0,i.Z)(t,1)[0];U(e)}),[U]),J=(0,o.useMemo)((function(){return b?c.d1t(c.jCC(c.kKJ,"correlations"),b):b}),[b]);return(0,I.Z)("".concat(h.Z.correlation," ").concat(null!==V&&void 0!==V&&V.name?V.name:"Feature group")),E||T||!V?(0,g.jsx)(l.Z,{}):J&&0!==Object.keys(J).length?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Z,{title:V.name,id:V.id,data:V,idColor:"labels.orange",isEditDisabled:!F||M,onClickEdit:function(){return _((0,C.Z)(G.Z.featureGroup.edit,G.Z.project.value,{id:r,fsId:S,fgId:j}))},onClickRefresh:O,hasVersion:!0,version:null===V||void 0===V?void 0:V.version,versions:(null===V||void 0===V?void 0:V.versions)||[],onVersionChange:A,hasCommits:!0,commits:w||[],commit:y,handleCommitChange:N,pathnamePostFix:"/correlation"}),(0,g.jsx)(v.Z,{item:V,correlation:J,type:f.C.fg})]}):(0,g.jsx)(m.Z,{mainText:"No feature correlation",secondaryText:""})}},70477:function(t,e,r){var i=r(72791),o=r(95048),u=r(16871),n=r(38184);e.Z=function(t,e,r){var a=(0,u.UO)().commitTime,s=(0,n.T)({fsId:r}).currentData,c=(0,o.v9)((function(t){return t.loading.effects.featureGroupView.fetch})),f=(0,o.v9)((function(t){return t.featureGroupView})),d=(0,o.I0)(),l=(0,i.useCallback)((function(){return d.featureGroupStatistics.clear(),s&&r&&!c?(d.featureGroupStatistics.fetch({projectId:+t,featureStoreId:r,featureGroupId:+e,timeCommit:a}),d.featureGroupView.fetch({projectId:t,featureStoreId:r,featureGroupId:e})):{}}),[d.featureGroupStatistics,d.featureGroupView,s,r,c,t,e,a]);return(0,i.useEffect)((function(){e===(null===f||void 0===f?void 0:f.id)&&r===f.featurestoreId||l()}),[null===f||void 0===f?void 0:f.id,null===f||void 0===f?void 0:f.featurestoreId,t,e,r,l]),{data:f,isLoading:c||!f,fetchData:l}}}}]);
//# sourceMappingURL=2898.ede323a5.chunk.js.map