PageSourceSearch

https://cdn.archidekt.com/_next/static/chunks/pages/moderation/user-roles-e2bad1d6eeb9cfb8.js

js archidekt.com collected 2026-09-25 18:52:46 UTC 4,152 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8578],{41892:e=>{e.exports={container:"userRoles_container__RcGbO",content:"userRoles_content__hWUBN",user:"userRoles_user__mo8WP",controls:"userRoles_controls__Wnaeb",card:"userRoles_card__ecLNe",role:"userRoles_role__264zc",modal:"userRoles_modal__t4r5N",selector:"userRoles_selector__59rJ_"}},57809:(e,s,r)=>{"use strict";r.d(s,{A:()=>m});var a=r(75038),l=r(76430),n=r(90274),o=r.n(n),t=r(3957),c=r(21159),d=r(36603),i=r(97359),u=r(60875),_=r.n(u);let m=({value:e,onSelected:s,onChange:r,triggerClassName:n="",menuClassName:i="",disabled:u,placeholder:m,label:g})=>{let[x,j]=(0,l.useState)(!1),[v,p]=(0,l.useState)([]),[A,N]=(0,l.useState)([]),b=(0,l.useRef)(o()((e="")=>{j(!0),t.A.basicList(e).then(e=>{N(e.results),p(e.results.map(e=>({label:(0,a.jsx)(h,{user:e}),value:e.id})))}).catch(e=>{console.error(e),c.A.create("Unable to fetch card editions","error")}).finally(()=>j(!1))},500)).current,R=e=>{j(!0),b(e),r&&r(e)};return(0,a.jsx)(d.A,{label:g,loading:x,options:v,disabled:u,menuClassName:i,triggerClassName:`${_().trigger} ${n}`,onFocus:()=>0===A.length&&R(""),onChange:e=>{let r=A.find(s=>s.id===e);r&&s(r)},onSearchChange:R,value:("string"==typeof e?e:e?.username)||void 0,placeholder:m??(("string"==typeof e?e:e?.username)||"No user selected")})},h=({user:e})=>(0,a.jsxs)("div",{className:_().option,children:[(0,a.jsx)(i.A,{className:_().avatar,src:e.avatar,username:e.username}),(0,a.jsxs)("div",{className:_().username,children:[e.username," "]})]})},60875:e=>{e.exports={trigger:"asyncUserDropdown_trigger__UxENl",option:"asyncUserDropdown_option__lm08i",avatar:"asyncUserDropdown_avatar__dT1mA"}},83491:(e,s,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/moderation/user-roles",function(){return r(87122)}])},87122:(e,s,r)=>{"use strict";r.r(s),r.d(s,{__N_SSP:()=>j,default:()=>v});var a=r(75038),l=r(76430),n=r(22335),o=r(3957),t=r(21159),c=r(79761),d=r(57809),i=r(97359),u=r(76975),_=r(68835),m=r(7648),h=r(72770),g=r(41892),x=r.n(g),j=!0;let v=e=>{let[s,r]=(0,l.useState)(null),[g,j]=(0,l.useState)(!1),[v,p]=(0,l.useState)(n.gg.TESTER),A=Object.keys(n.gg).map(e=>({id:`${n.gg[e]}`,label:e,onClick:()=>p(n.gg[e])})),N=e=>{o.A.details(e).then(r).catch(()=>t.A.create("Unable to fetch user","User Management"))};return(0,a.jsxs)(c.A,{title:"User role management",robots:"noindex",className:x().container,children:[(0,a.jsxs)("div",{className:x().content,children:[(0,a.jsx)("h2",{children:"Role management"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{children:"Select User"}),(0,a.jsx)(d.A,{placeholder:"Select user to manage",disabled:!!s,onSelected:e=>N(e.id)})]}),s&&(0,a.jsxs)("div",{className:x().user,children:[(0,a.jsxs)("div",{className:x().controls,children:[(0,a.jsx)(_.A,{color:"blue",onClick:()=>j(!0),children:"Add role"}),(0,a.jsx)(_.A,{color:"red",onClick:()=>{r(null),j(!1),p(n.gg.TESTER)},children:"Unselect user"})]}),(0,a.jsxs)("div",{className:x().card,children:[(0,a.jsx)(i.A,{username:s.username,src:s.profile.avatar}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:["Id: ",s?.id]}),(0,a.jsxs)("div",{children:["Username: ",s?.username]}),(0,a.jsxs)("div",{children:["Date Joined: ",(0,h._)(s.date_joined)]})]})]}),(0,a.jsx)("h5",{children:"Roles"}),s?.profile.roles.map((e,r)=>(0,a.jsxs)("div",{className:x().role,children:[(0,a.jsx)("span",{children:n.DD[e]}),(0,a.jsx)(_.A,{disabled:e===n.gg.MOD,color:"red",onClick:()=>{!s||confirm(`Are you sure you want to remove the ${n.DD[e]} role from ${s.username}?`)&&o.A.removeRole(s.id,e).then(()=>N(s.id)).catch(()=>t.A.create("Unable to remove role","User Management"))},children:"Remove"})]},r))]})]}),(0,a.jsxs)(u.A,{closeButton:!0,onClose:()=>j(!1),open:g,modalClassName:x().modal,children:[(0,a.jsx)(m.A,{header:"Select a role to add",value:`${v}`,options:A,className:x().selector}),(0,a.jsx)(_.A,{color:"green",onClick:()=>{s&&o.A.addRole(s.id,v).then(()=>(j(!1),N(s.id))).catch(()=>t.A.create("Unable to add role","User Management"))},children:"Add role"})]})]})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=83491)),_N_E=e.O()}]);
2//# sourceMappingURL=user-roles-e2bad1d6eeb9cfb8.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.