PageSourceSearch

https://www.cab.org.nz/_resources/app/client/dist/assets/InterviewCategories-D1_Vwu-m.js

js cab.org.nz collected 2026-09-24 18:50:04 UTC 11,775 bytes, 15 lines download raw bytes

1import{i as _,c as f,a as l,m as p,l as n}from"./vendor-CHCIo3bd.js";import{n as h,h as m,N as g,M as u,k as b,T as w}from"./app-oVuUJ3MT.js";import"./vendor-filepond-C-Be2LEg.js";/* empty css            */const C={components:{icon:_,MultiSelect:u,Notifications:g},props:{results:{type:Array},items:{type:Number,default:25},count:{type:Number},tags:{type:Array,default:[]}},data(){return{page:1,isExpandAll:!0,selectedtag:"",interviewCodes:[],notifications:[],isSelectAll:!1,selectedCheckboxes:[]}},watch:{results(){this.isExpandAll=!0}},computed:{idMapedTags(){return this.tags.map(s=>({value:s.id,text:s.text}))},currentPage(){let s=this.page*this.items;return s>this.count&&(s=this.count),{number:parseInt(this.page),start:(this.page-1)*this.items+1,end:s}},numPages(){return Math.ceil(this.count/this.items)}},created(){this.page=this.$route.params.page},methods:{formatDate(s){const t=l(s),i=l().diff(t,"days");return i<1?"Today":i===1?"Yesterday":i<7?t.format("dddd"):t.format("DD/MM/YYYY")},formatDateTitle(s){return l(s).format("DD/MM/YYYY")},goPrev(){this.$router.push(`/dashboard/interview-categories/${parseInt(this.page)-1}`),this.$emit("changePage")},goNext(){this.$router.push(`/dashboard/interview-categories/${parseInt(this.page)+1}`),this.$emit("changePage")},toggleExpandAll(){this.isExpandAll=!this.isExpandAll},toggleSelected(s,t){s.target.checked?this.interviewCodes.push(t.code):this.interviewCodes=this.interviewCodes.filter(e=>!t.code.includes(e))},toggleAllSelected(){this.isSelectAll=!this.isSelectAll,this.isSelectAll?this.interviewCodes=this.results.map(s=>s.code):this.interviewCodes=[]},onSubmit(){!this.selectedtag||!this.interviewCodes.length||this.$axios.post("/api/v1/interviewAddTags",{body:{tagId:this.selectedtag,interviewCodes:this.interviewCodes}}).then(s=>{this.showNotification(s.data.message),this.$emit("categoriesUpdated")}).catch(s=>{console.error(s)})},extractSourceLinks:m,showNotification(s){this.notifications.push({body:s,type:"success"});const t=document.getElementById("notifications");new f().move(t)}}};var x=function(){var t=this,e=t._self._c;return e("div",[e("div",{attrs:{id:"notifications"}},[e("Notifications",{attrs:{notifications:t.notifications}})],1),t._v(" "),t.currentPage.number<=t.numPages&&t.results?e("div",{staticClass:"dashboard-list dashboard-list--generic dashboard-list--daybook"},[t.currentPage.number<=t.numPages?e("div",{staticClass:"dashboard-list__list dashboard-list--generic-list no-list-style"},[e("div",{staticClass:"daybook-list-header"},[e("div",{staticClass:"daybook-list-header__left"},[e("a",{staticClass:"link hidden-print",attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.toggleExpandAll()}}},[t.isExpandAll?e("span",[t._v("Collapse all")]):e("span",[t._v("Expand all")])]),t._v(" "),e("a",{staticClass:"link hidden-print select-all",attrs:{href:"#"},on:{click:function(i){return i.preventDefault(),t.toggleAllSelected()}}},[t.isSelectAll?e("span",[t._v("Deselect all")]):e("span",[t._v("Select all")])])])]),t._v(" "),t._m(0),t._v(" "),t._l(t.results,function(i){return e("div",{key:i.code,staticClass:"dashboard-list__row-wrapper"},[e("div",{staticClass:"dashboard__interview-list__row dashboard-list__row read-only"},[e("div",{staticClass:"dashboard-list__item list__item--generic-50 list__item--generic-first"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.interviewCodes,expression:"interviewCodes"}],attrs:{type:"checkbox"},domProps:{value:i.code,checked:Array.isArray(t.interviewCodes)?t._i(t.interviewCodes,i.code)>-1:t.interviewCodes},on:{click:function(r){return t.toggleSelected(r,i)},change:function(r){var a=t.interviewCodes,d=r.target,v=!!d.checked;if(Array.isArray(a)){var c=i.code,o=t._i(a,c);d.checked?o<0&&(t.interviewCodes=a.concat([c])):o>-1&&(t.interviewCodes=a.slice(0,o).concat(a.slice(o+1)))}else t.interviewCodes=v}}})]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-150"},[t._v(`
2            `+t._s(i.code)+`
3          `)]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-150"},[e("time",{attrs:{datetime:i.date,title:t.formatDateTitle(i.date)}},[t._v(`
4              `+t._s(t.formatDate(i.date))+`
5            `)])]),t._v(" "),e("div",{staticClass:"dashboard-list__item list__item--generic-500"},[i.tags.length?e("ul",{staticClass:"list--no-indent"},t._l(i.tags,function(r,a){return e("li",{key:a},[t._v(`
6                `+t._s(r)+`
7              `)])}),0):t._e()])]),t._v(" "),e("div",{class:{"daybook-row-extra":!0,"daybook-row-extra--expanded":t.isExpandAll}},[i.enquiry?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title daybook-row-extra__title--first"},[t._v(`
8              Client Interview
9            `)]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(i.enquiry))}})]):t._e(),t._v(" "),i.options_offered?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Information discussed with client")]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(i.options_offered))}})]):t._e(),t._v(" "),i.source_of_information?e("div",{staticClass:"daybook-row-extra__item clearfix"},[e("div",{staticClass:"h4 daybook-row-extra__title"},[t._v("Source of Information")]),t._v(" "),e("div",{staticClass:"daybook-row-extra__content",domProps:{innerHTML:t._s(t.$options.filters.nl2br(t.extractSourceLinks(i.source_of_information)))}})]):t._e()])])})],2):t._e(),t._v(" "),e("div",{staticClass:"dashboard__interview-list__pagination dashboard-list__pagination"},[t.currentPage.number>1?e("a",{staticClass:"dashboard-list__pagination__prev",attrs:{href:"/dashboard/interview-categories/"+(t.currentPage.number-1)},on:{click:function(i){return i.preventDefault(),t.goPrev.apply(null,arguments)}}},[e("icon",{attrs:{name:"chevron-left"}}),t._v(" "),e("span",[t._v("Previous")])],1):e("div",{staticClass:"dashboard-list__pagination__prev dashboard-list__pagination__prev--disabled"},[e("icon",{attrs:{name:"chevron-left"}})],1),t._v(" "),e("div",{staticClass:"dashboard-list__pagination__page"},[t._v(`
10        `+t._s(t.currentPage.start)+" - "+t._s(t.currentPage.end)+" of "+t._s(t.count)+`
11      `)]),t._v(" "),t.currentPage.number<t.numPages?e("a",{staticClass:"dashboard-list__pagination__next",attrs:{href:"/dashboard/interview-categories/"+(t.currentPage.number+1)},on:{click:function(i){return i.preventDefault(),t.goNext.apply(null,arguments)}}},[e("span",[t._v("Next")]),t._v(" "),e("icon",{attrs:{name:"chevron-right"}})],1):e("div",{staticClass:"dashboard-list__pagination__next dashboard-list__pagination__next--disabled"},[e("icon",{attrs:{name:"chevron-right"}})],1)]),t._v(" "),e("div",{staticClass:"flex flex--start mt-5 mb-2"},[e("div",{staticClass:"column column-40 flex flex--column flex--end mb-2"},[e("MultiSelect",{attrs:{placeholder:"Categories",searchable:!0,multiple:!1,options:t.idMapedTags},model:{value:t.selectedtag,callback:function(i){t.selectedtag=i},expression:"selectedtag"}})],1),t._v(" "),e("div",{staticClass:"column flex flex--column flex--end mb-2"},[e("button",{class:{"button button--blue hidden-print d-inline-block":!0,"button--disabled":!t.selectedtag||!t.interviewCodes.length},on:{click:t.onSubmit}},[e("icon",{attrs:{name:"plus","aria-hidden":"true"}}),t._v(" "),e("span",[t._v("Add")])],1)])])]):e("div",{staticClass:"p-3"},[e("h1",{staticClass:"h1 font-avenir-medium"},[t._v("No results found.")])])])},y=[function(){var s=this,t=s._self._c;return t("div",[t("div",{staticClass:"dashboard-list__row dashboard-list__row--header read-only hidden-print"},[t("div",{staticClass:"dashboard-list__item list__item--generic-50 list__item--generic-first"},[s._v(`
12            Assign
13          `)]),s._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-150"},[s._v("Code")]),s._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-150"},[s._v("Date")]),s._v(" "),t("div",{staticClass:"dashboard-list__item list__item--generic-500"},[s._v("Categories")])])])}],k=h(C,x,y,!1,null,null);const $=k.exports,A={name:"interviewCategories",components:{MultiSelect:u,TextField:w,icon:_,InterviewCategoryResults:$},mixins:[b],data(){const s={filters:{tags:[],search:null},filterOptions:{tags:[]}};let t,e;return this.$store.state.filters[this.$options.name]?(t=n.cloneDeep(this.$store.state.filters[this.$options.name]),e=n.cloneDeep(this.$store.state.filterOptions[this.$options.name])):(t=n.cloneDeep(s.filters),e=n.cloneDeep(s.filterOptions)),{emptyFilters:s,filters:t,currentInterviews:null,previousInterviews:[],nextInterviews:[],sort:{Created:"desc",StatusCode:"asc"},count:0,filterOptions:e,showFilters:!0,notifications:[],items:25}},computed:{...p({currentUserRole:s=>s.currentUserRole})},methods:{fetchData(){const s=(this.$route.params.page-1)*this.items,t={sort:Object.keys(this.sort).map(e=>`${e},${this.sort[e]}`),limit:this.items,offset:s,allBureaux:!0};this.filters.tags&&this.filters.tags.length&&(t.tag=this.filters.tags),t.service=["Client Interview"],t.extraFields=["options_offered","source_of_information","enquiry"],this.filters.search&&this.filters.search.length>=3&&(t.query=this.filters.search),this.$axios.get("/api/v1/interview/search",{params:t}).then(e=>{this.currentInterviews=e.data.results,this.count=e.data.meta.total,this.filterOptions.tags=this.sortTags(e.data.filters.tags),this.$store.dispatch("updateFilters",{section:this.$options.name,filters:this.filters,filterOptions:this.filterOptions})})},sortTags(s){return s.sort(function(t,e){return t=t.text.toUpperCase(),e=e.text.toUpperCase(),t<e?-1:t>e?1:0})},resize(){window.matchMedia("(min-width: 576px)").matches&&(this.show
13Filters=!0)},toggleFilters(){this.showFilters=!this.showFilters}},created(){window.addEventListener("resize",this.resize)},mounted(){this.fetchData(),this.showFilters=!0}};var P=function(){var t=this,e=t._self._c;return e("div",{staticClass:"dashboard__interview-list dashboard-list"},[e("h3",[t._v("Interview Categories")]),t._v(" "),e("div",{staticClass:"dashboard__interview-filters hidden-print"},[e("h4",[t._v("Filters")]),t._v(" "),e("div",{class:{"dashboard__interview-filters__toggle":!0,"dashboard__interview-filters__toggle--open":!t.showFilters,"dashboard__interview-filters__toggle--close":t.showFilters},attrs:{tabindex:"0"},on:{click:t.toggleFilters}},[t._v(`
14       
15    `)]),t._v(" "),e("div",{class:{"dashboard__interview-filters__row":!0,"dashboard__interview-filters__row--daybook":!0,"dashboard__interview-filters__row--open":t.showFilters,"dashboard__interview-filters__row--close":!t.showFilters}},[e("div",{staticClass:"dashboard__interview-filters__tags"},[e("MultiSelect",{attrs:{placeholder:"Category",searchable:!0,multiple:!0,options:t.filterOptions.tags},on:{input:t.filter},model:{value:t.filters.tags,callback:function(i){t.$set(t.filters,"tags",i)},expression:"filters.tags"}})],1),t._v(" "),e("div",{staticClass:"dashboard__interview-filters__search"},[e("TextField",{attrs:{placeholder:"Search",type:"search"},on:{input:t.filter},model:{value:t.filters.search,callback:function(i){t.$set(t.filters,"search",i)},expression:"filters.search"}})],1)])]),t._v(" "),t.currentInterviews?e("interview-category-results",{key:t.$route.params.page,attrs:{results:t.currentInterviews,count:t.count,items:t.items,tags:t.filterOptions.tags,readOnly:!0},on:{changePage:function(i){return t.fetchData()},categoriesUpdated:function(i){return t.fetchData()}}}):e("div",{staticClass:"m-5 text-center text--gray"},[e("icon",{attrs:{name:"spinner",scale:"4",pulse:""}})],1)],1)},D=[],S=h(A,P,D,!1,null,null);const E=S.exports;export{E as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.