PageSourceSearch

https://assets.productive.io/assets/-embroider-route-entrypoint.js_route_organization.settings-BPbqdhoi.js

js productive.io collected 2026-09-24 18:26:06 UTC 11,015 bytes, 2 lines download raw bytes

1import{r as o}from"./rolldown-runtime-BEU_UCik.js";import{AJ as e,Ak as n,Go as t,IJ as a,JH as i,MJ as s,Mz as r,aC as l,bK as p,bS as m,eS as h,fJ as c,iR as u,ja as g,jz as d,kJ as f,lY as C,mJ as z,oR as y,pJ as b,qC as v,qJ as M,tS as S,xJ as F,yP as P,yz as w,zJ as A}from"./common-3yH-6heC.js";var R,k={championSelectField:"_championSelectField_11kaw_1"},E=e(f({id:null,block:'[[[10,0],[12],[1,"\\n  "],[8,[32,0],[[24,0,"mb-3"]],[["@color"],["neutral-subtle"]],[["default"],[[[[1,"\\n    "],[1,[30,1]],[1,"\\n  "]],[]]]]],[1,"\\n\\n  "],[8,[32,1],null,[["@object","@propertyName","@buildQuery","@optionLabelPath","@optionIconPath","@placeholder","@isMultiselect","@class"],[[30,2],"persons",[30,3],"fullName","avatarUrl",[30,4],true,[29,["form-for__field ",[32,2,["championSelectField"]]]]]],null],[1,"\\n"],[13]],["@label","@form","@fetchPeople","@placeholder"],[]]',moduleName:"(unknown template module)",scope:()=>({Typography:w,FormSelectField:m,styles:k}),isStrictMode:!0}),p()),N=new WeakMap,I=new WeakMap,T=class extends r{constructor(...o){super(...o),M(this,N,void z(this,"can")),M(this,I,void z(this,"flags"))}get organizationChampionsForms(){return this.args.formAggregate.organizationChampionsForms}async onSubmit(){await this.args.formAggregate.save(),this.args.afterSubmit()}get isSubmitDisabled(){return!this.args.formAggregate.isSomeFormsDirty}};c((R=T).prototype,"can",[s]),c(R.prototype,"flags",[s]),b(R.prototype,"onSubmit",[A]),e(f({id:null,block:'[[[10,0],[14,0,"settings-organization-form"],[12],[1,"\\n  "],[8,[32,0],null,null,[["info","content"],[[[[1,"\\n      "],[8,[30,1,["Title"]],null,null,[["default"],[[[[1," "],[1,[28,[32,1],["components.settings.organization-champions-form.title"],null]],[1," "]],[]]]]],[1,"\\n      "],[8,[30,1,["Description"]],null,null,[["default"],[[[[1,"\\n        "],[10,2],[12],[1,[28,[32,1],["components.settings.organization-champions-form.intro"],null]],[13],[1,"\\n        "],[10,2],[12],[1,[28,[32,1],["components.settings.organization-champions-form.purpose"],null]],[13],[1,"\\n        "],[10,2],[12],[1,[28,[32,1],["components.settings.organization-champions-form.multiple"],null]],[13],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[1]],[[[1,"\\n      "],[8,[30,2,["Card"]],null,null,[["default"],[[[[1,"\\n        "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","general"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.generalChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.generalChampionLabel"],null]]],null],[1,"\\n\\n        "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","resourcing"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.resourcingChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.resourcingChampionLabel"],null]]],null],[1,"\\n\\n"],[41,[30,0,["can","app","canViewInvoicesFeature"]],[[[1,"          "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","invoicing"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.invoicingChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.invoicingChampionLabel"],null]]],null],[1,"\\n"]],[]],null],[1,"\\n        "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","humanResources"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.humanResourcesChampionPlaceholder"],null],[52,[30,0,["can","app","canViewTimeOffsFeature"]],[28,[32,1],["components.settings.organization-champions-form.humanResourcesChampionLabel"],null],[28,[32,1],["components.settings.organization-champions-form.humanResourcesEmployeeChampionLabel"],null]]]],null],[1,"\\n\\n        "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","projectManagement"]],[30,3],[52,[30,0,["can","app","canViewProjectsFeature"]],[28,[32,1],["components.settings.organization-champions-form.projectManagementChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.budgetManagementChampionPlaceholder"],null]],[52,[30,0,["can","app","canViewProjectsFeature"]],[28,[32,1],["components.settings.organization-champions-form.projectManagementChampionLabel"],null],[28,[32,1],["components.settings.organization-champions-form.budgetManagementChampionLabel"],null]]]],null],[1,"\\n\\n"],[41,[30,0,["can","app","canViewDealsFeature"]],[[[1,"          "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","sales"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.salesChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.salesChampionLabel"],null]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["flags","aiChampion"]],[[[1,"          "],[8,[32,2],null,[["@form","@fetchPeople","@placeholder","@label"],[[30,0,["organizationChampionsForms","ai"]],[30,3],[28,[32,1],["components.settings.organization-champions-form.aiChampionPlaceholder"],null],[28,[32,1],["components.settings.organization-champions-form.aiChampionLabel"],null]]],null],[1,"\\n"]],[]],null],[1,"\\n        "],[10,0],[12],[1,"\\n          "],[8,[32,3],null,[["@formAggregate","@submitLabel","@submitAction","@isDisabled"],[[30,4],[28,[32,1],["shared.ui-actions.save"],null],[30,0,["onSubmit"]],[30,0,["isSubmitDisabled"]]]],null],[1,"\\n        "],[13],[1,"\\n      "]],[]]]]],[1,"\\n    "]],[2]]]]],[1,"\\n"],[13]],["Info","Content","@fetchPeople","@formAggregate"],["if"]]',moduleName:"(unknown template module)",scope:()=>({Section:g,t:d,ChampionSelectField:E,FormFormActions:h}),isStrictMode:!0}),R);var L,j,J=o({default:()=>O}),O=v(e(f({id:null,block:'[[[1,[28,[32,0],[[28,[32,1],["routes.organization.settings.organization-champions.champions"],null]],null]],[1,"\\n"],[10,0],[15,0,[29,[[32,2,["page"]]," ",[32,2,["pageFullWidth"]]]]],[12],[1,"\\n  "],[10,0],[15,0,[32,2,["section"]]],[12],[1,"\\n    "],[8,[32,3],[[24,0,"py-2.5"]],[["@as","@variant"],["h1","heading-medium-700"]],[["default"],[[[[1," "],[1,[28,[32,1],["templates.organization.settings.organization-champions.title"],null]],[1," "]],[]]]]],[1,"\\n    "],[8,[32,4],null,[["@afterSubmit","@fetchPeople","@formAggregate"],[[30,1,["afterSubmit"]],[30,1,["fetchPeople"]],[30,1,["formAggregate"]]]],null],[1,"\\n  "],[13],[1,"\\n"],[13]],["@controller"],[]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:l,t:d,settingsStyles:t,Typography:w,SettingsOrganizationChampionsForm:T}),isStrictMode:!0}),p())),W=new WeakMap,B=new WeakMap,G=class extends u{constructor(o,e,n){super(o,null),C(this,"formName","Organization champions type form"),M(this,W,void z(this,"store")),C(this,"championModels",void 0),C(this,"typeId",void 0),C(this,"resetUnchangedFieldsAfterSubmit",!1),M(this,B,void z(this,"persons")),this.championModels=e,this.typeId=n}
1async beforeSubmit(){await super.beforeSubmit();const o=new Set(this.championModels.map(o=>{var e;return null===(e=o.person)||void 0===e?void 0:e.id}).filter(Boolean)),e=new Set(this.persons.map(o=>o.id)),n=this.persons.filter(e=>!o.has(e.id)),t=this.championModels.filter(o=>o.person&&!e.has(o.person.id));n.forEach(o=>{const e=this.store.createRecord("organization-champion",{typeId:this.typeId,person:o});this.championModels.push(e)}),t.forEach(o=>{o.deleteRecord()})}async submit(){const o=this.championModels.filter(o=>o.isNew);await Promise.all(o.map(o=>o.save()));const e=this.championModels.filter(o=>o.isDeleted);return await Promise.all(e.map(o=>o.save())),this.championModels=this.championModels.filter(o=>!o.isDeleted),Promise.resolve()}};c((L=G).prototype,"store",[s]),c(L.prototype,"persons",[y({getValue:o=>o.championModels.map(o=>o.person).filter(Boolean)})],function(){return[]});var H=new WeakMap,_=class extends S{constructor(o,e){super(o),M(this,H,void z(this,"formsHandler")),C(this,"organizationChampions",void 0),this.organizationChampions=e}get organizationChampionsForms(){return{general:this.createForm(G,[this.organizationChampions.general,P.GENERAL]),resourcing:this.createForm(G,[this.organizationChampions.resourcing,P.RESOURCING]),invoicing:this.createForm(G,[this.organizationChampions.invoicing,P.INVOICING]),humanResources:this.createForm(G,[this.organizationChampions.humanResources,P.HUMAN_RESOURCES]),projectManagement:this.createForm(G,[this.organizationChampions.projectManagement,P.PROJECT_MANAGEMENT]),sales:this.createForm(G,[this.organizationChampions.sales,P.SALES]),ai:this.createForm(G,[this.organizationChampions.ai,P.AI])}}get forms(){return Object.values(this.organizationChampionsForms)}createFormForModel(){return null}async save(){const o=this.forms.filter(o=>o.isSaveable);await Promise.all(o.map(o=>this.formsHandler.submitForm(o)))}};c((j=_).prototype,"formsHandler",[s]),b(j.prototype,"organizationChampionsForms",[F]),b(j.prototype,"forms",[F]),b(j.prototype,"save",[A]);var x,D=o({default:()=>Z}),U=new WeakMap,V=new WeakMap,q=new WeakMap,K=new WeakMap,Q=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=class extends a{constructor(...o){super(...o),M(this,U,void z(this,"session")),M(this,V,void z(this,"can")),M(this,q,void z(this,"routing")),M(this,K,void z(this,"store")),M(this,Q,void z(this,"formsHandler")),M(this,Y,void z(this,"flags")),M(this,X,void z(this,"intl"))}beforeModel(){this.can.app.canAdminOrganization||this.routing.transitionTo("organization.settings")}async model(){const o=await n.on(this).withContext("organization-champions").run();return{general:this.getChampionsByType(o,P.GENERAL),resourcing:this.getChampionsByType(o,P.RESOURCING),invoicing:this.getChampionsByType(o,P.INVOICING),humanResources:this.getChampionsByType(o,P.HUMAN_RESOURCES),projectManagement:this.getChampionsByType(o,P.PROJECT_MANAGEMENT),sales:this.getChampionsByType(o,P.SALES),ai:this.getChampionsByType(o,P.AI)}}setupController(o,e,n){super.setupController(o,e,n),o.set("fetchPeople",this.fetchPeople),o.set("afterSubmit",this.afterSubmit);const t=this.formsHandler.createFormAggregate(_,[e]);o.set("formAggregate",t)}resetController(o){var e;null===(e=o.formAggregate)||void 0===e||e.destroy()}fetchPeople(){return i.on(this).active().users().excludeClients()}afterSubmit(){return this.refresh()}getChampionsByType(o,e){return o.filter(o=>o.typeId===e)}};c((x=Z).prototype,"session",[s]),c(x.prototype,"can",[s]),c(x.prototype,"routing",[s]),c(x.prototype,"store",[s]),c(x.prototype,"formsHandler",[s]),c(x.prototype,"flags",[s]),c(x.prototype,"intl",[s]),b(x.prototype,"fetchPeople",[A]),b(x.prototype,"afterSubmit",[A]);var $={};$["productive/templates/organization/settings/organization-champions"]=J,$["productive/routes/organization/settings/organization-champions"]=D;export{$ as default};
2//# sourceMappingURL=-embroider-route-entrypoint.js_route_organization.settings-BPbqdhoi.js.map

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.