(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{"./api-dev/components/release/context-bar/ReleaseInfoContextBarView/ReleaseInfoContextBarView.js":function(e,t,a){"use strict";a.r(t),function(e){a.d(t,"default",(function(){return y}));var s,n=a("../../node_modules/react/index.js"),o=a.n(n),i=a("../../node_modules/mobx-react/dist/mobx-react.module.js"),l=a("./appsdk/contextbar/ContextBarViewHeader.js"),r=a("./js/utils/ClipboardHelper.js"),c=a("./js/components/base/Buttons.js"),d=a("../../node_modules/@postman/aether/esmLib/index.js"),m=a("./node_modules/moment/moment.js"),p=a.n(m),_=a("./js/utils/util.js"),u=a("./js/components/base/Avatar.js"),v=a("./js/stores/get-store.js");let y=Object(i.observer)(s=class extends n.Component{constructor(e){super(e),this.state={isCopyingReleaseId:!1},this.handleCopyReleaseIdToClipboard=this.handleCopyReleaseIdToClipboard.bind(this),this.renderReleaseEditor=this.renderReleaseEditor.bind(this)}componentWillUnmount(){clearTimeout(this.copiedTimeout)}handleCopyReleaseIdToClipboard(){const t=e.get(this.props,"contextData.model.activeRelease.id","");this.state.isCopyingReleaseId||(r.default.copy(t),this.setState({isCopyingReleaseId:!0},(()=>{this.copiedTimeout=setTimeout((()=>this.setState({isCopyingReleaseId:!1})),3e3)})))}renderReleaseEditor(e){const t=Object(v.getStore)("CurrentUserStore");return e?o.a.createElement("div",{className:"release-info-editors__editor",key:e},o.a.createElement(u.default,{ref:"avatar",size:"medium",userId:e}),o.a.createElement("div",{className:"release-info-editors__editor--name"},_.default.getUserNameForId(e,t))):"Deactivated User"}renderReleaseIdCopyStatusIcon(){return this.state.isCopyingReleaseId?o.a.createElement(d.Icon,{name:"icon-state-success-stroke",className:"pm-icon pm-icon-normal success-tick-icon"}):o.a.createElement(d.Icon,{name:"icon-action-copy-stroke",className:"pm-icon pm-icon-normal"})}render(){const t=e.get(this.props,"contextData.model.activeRelease",{}),a=p()(e.get(t,"createdAt")).format("DD MMM YYYY, h:mm A"),s=e.get(t,"createdBy"),n=e.get(t,"id");return o.a.createElement("div",{className:"release-info-context-view-wrapper"},o.a.createElement(l.ContextBarViewHeader,{title:"Release details",onClose:this.props.onClose}),o.a.createElement("div",{className:"release-info-context-view"},o.a.createElement("div",{className:"release-info-context-view__entity"},o.a.createElement("div",{className:"release-info-context-view__entity__label"},"Release ID"),o.a.createElement("div",{className:"release-info-context-view__entity__content"},o.a.createElement("div",{className:"release-info-context-view__entity__content__id--entity",title:n},n),o.a.createElement(c.Button,{tooltip:"Copy",type:"icon",onClick:this.handleCopyReleaseIdToClipboard},this.renderReleaseIdCopyStatusIcon()))),o.a.createElement("div",{className:"release-info-context-view__entity"},o.a.createElement("div",{className:"release-info-context-view__entity__label"},"Created by"),o.a.createElement("div",{className:"release-info-context-view__entity__content"},this.renderReleaseEditor(s))),o.a.createElement("div",{className:"release-info-context-view__entity"},o.a.createElement("div",{className:"release-info-context-view__entity__label"},"Created on"),o.a.createElement("div",{className:"release-info-context-view__entity__content"},o.a.createElement("div",{className:"release-info-context-view__entity__content__id",title:a},a)))))}})||s}.call(this,a("./node_modules/lodash/lodash.js"))}}]);