"use strict";(self.webpackChunk_dagster_io_dagit_app=self.webpackChunk_dagster_io_dagit_app||[]).push([[801],{79801:function(n,e,r){r.r(e),r.d(e,{CodeLocationsPage:function(){return p}});var t=r(31112),i=r(12745),o=r(32030),a=r(325),l=r(78093),s=r(78072),c=r(70457),d=r(76336),x=r(25171),h=r(64480),u=r(32289),p=function(){(0,l.Px)();var n=a.useContext(x.N).pageTitle,e=a.useContext(d.C5),r=e.locationEntries,p=e.loading,j=r.length;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(t.m,{title:(0,u.jsx)(i.X6,{children:n}),tabs:(0,u.jsx)(h.Z,{tab:"code-locations"})}),(0,u.jsxs)(o.x,{padding:{vertical:16,horizontal:24},flex:{direction:"row",justifyContent:"space-between",alignItems:"center"},style:{height:"64px"},children:[(0,u.jsx)(i.pm,{id:"repository-locations",children:p||!j?"Code locations":1===j?"1 code location":"".concat(j," code locations")}),j>1?(0,u.jsx)(s.i,{}):null]}),(0,u.jsx)(c.l,{})]})};e.default=p},70457:function(n,e,r){r.d(e,{l:function(){return E}});var t=r(19065),i=r(54268),o=r(32030),a=r(60652),l=r(11831),s=r(7838),c=r(34595),d=r(89646),x=r(55113),h=r(6466),u=r(12745),p=r(325),j=r(63579),m=r(55419),g=r(86562),y=r(17235),f=r(73362),v=r(89279),w=r(32289),k=function(n){var e=n.repositoryUrl,r=function(n){try{var e,r,i,o=new URL(n);if("github.com"===o.host){var a=o.pathname.split("/",7),l=(0,t.Z)(a,5);e=l[1],r=l[2],i=l[4]}else if("gitlab.com"===o.host){var s=o.pathname.split("/",8),c=(0,t.Z)(s,6);e=c[1],r=c[2],i=c[5]}if(e&&r&&i)return"".concat(e,"/").concat(r,"@").concat(i)}catch(d){return n}return n}(e);return(0,w.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,w.jsx)(v.JO,{color:s.w.Link,name:"link",style:{display:"inline-block",verticalAlign:"middle"}})," ",r]})},b=r(76336),C={showSeconds:!0,showTimezone:!0},L=function(n){var e,r=n.location,l=n.locationOrError,s=p.useState(!1),c=(0,t.Z)(s,2),d=c[0],x=c[1],h=p.useMemo((function(){return(0,y.je)(r)}),[r]),u=(0,y.Dc)({scope:"location",reloadFn:h}),j=u.reloading,m=u.tryReload;return"LOADING"===l.loadStatus?l.locationOrLoadError?(0,w.jsx)(i.V,{minimal:!0,intent:"primary",children:"Updating..."}):(0,w.jsx)(i.V,{minimal:!0,intent:"primary",children:"Loading..."}):"PythonError"===(null===(e=l.locationOrLoadError)||void 0===e?void 0:e.__typename)?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(o.x,{flex:{alignItems:"center",gap:12},children:[(0,w.jsx)(i.V,{minimal:!0,intent:"danger",children:"Failed"}),(0,w.jsx)(a.Z,{onClick:function(){return x(!0)},children:(0,w.jsx)("span",{style:{fontSize:"14px"},children:"View error"})})]}),(0,w.jsx)(f.p,{location:r,isOpen:d,error:l.locationOrLoadError,reloading:j,onDismiss:function(){return x(!1)},onTryReload:function(){return m()}})]}):(0,w.jsx)(i.V,{minimal:!0,intent:"success",children:"Loaded"})},_=function(n){var e=n.location,r=(0,j.TE)().canReloadRepositoryLocation;return r.enabled?(0,w.jsx)(g.s,{location:e,children:function(n){var e=n.reloading,r=n.tryReload;return(0,w.jsxs)(o.x,{flex:{direction:"row",alignItems:"center",gap:4},children:[(0,w.jsx)(a.Z,{onClick:function(){return r()},children:"Reload"}),e?(0,w.jsx)(c.$,{purpose:"body-text"}):null]})}}):(0,w.jsx)(l.u,{content:r.disabledReason,children:(0,w.jsx)(a.Z,{color:s.w.Gray400,children:"Reload"})})},E=function(){var n=p.useContext(b.C5),e=n.locationEntries;return n.loading&&!e.length?(0,w.jsxs)(o.x,{flex:{gap:8,alignItems:"center"},padding:{horizontal:24},children:[(0,w.jsx)(c.$,{purpose:"body-text"}),(0,w.jsx)("div",{children:"Loading..."})]}):e.length?(0,w.jsxs)(x.i,{children:[(0,w.jsx)("thead",{children:(0,w.jsxs)("tr",{children:[(0,w.jsx)("th",{children:"Repository location"}),(0,w.jsx)("th",{children:"Status"}),(0,w.jsx)("th",{colSpan:2,children:"Updated"})]})}),(0,w.jsx)("tbody",{children:e.map((function(n){return(0,w.jsxs)("tr",{children:[(0,w.jsx)("td",{style:{maxWidth:"50%"},children:(0,w.jsxs)(h.Z,{direction:"column",spacing:4,children:[(0,w.jsx)("strong",{children:n.name}),(0,w.jsx)("div",{children:n.displayMetadata.map((function(n,e){var r="url"===n.key?"source":n.key,t="url"===n.key?(0,w.jsx)(k,{repositoryUrl:n.value}):n.value;return(0,w.jsx)("div",{children:(0,w.jsxs)(u.YS,{style:{wordBreak:"break-word"},children:["".concat(r,": "),(0,w.jsx)("span",{style:{color:s.w.Gray400},children:t})]})},e)}))})]})}),(0,w.jsx)("td",{children:(0,w.jsx)(L,{location:n.name,locationOrError:n})}),(0,w.jsx)("td",{style:{whiteSpace:"nowrap"},children:(0,w.jsx)(m.E,{timestamp:{unix:n.updatedTimestamp},timeFormat:C})}),(0,w.jsx)("td",{style:{width:"180px"},children:(0,w.jsx)(_,{location:n.name})})]},n.name)}))})]}):(0,w.jsx)(o.x,{padding:{vertical:32},children:(0,w.jsx)(d.t,{icon:"folder",title:"No repository locations",description:"When you add a repository location to this workspace, it will appear here."})})}}}]);
//# sourceMappingURL=801.02ff7fbb.chunk.js.map