1- import UI from 'solid-ui'
2- import { NamedNode , IndexedFormula , sym } from 'rdflib'
3-
4- import { Namespaces } from 'solid-namespace'
1+ import { authn , ns , store , widgets } from 'solid-ui'
2+ import { NamedNode , sym } from 'rdflib'
53
64import {
75 getStatementsToAdd ,
86 getStatementsToDelete
97} from './trustedApplicationsUtils'
108
11- const kb : IndexedFormula = UI . store
12- const ns : Namespaces = UI . ns
13-
149const thisColor = '#418d99'
1510
1611interface FormElements {
@@ -38,18 +33,18 @@ export function renderTrustedApplicationsOptions (dom: HTMLDocument) {
3833 statusArea . setAttribute ( 'style' , 'padding: 0.7em;' )
3934
4035 const context = { dom : dom , div : main , statusArea : statusArea , me : null }
41- UI . authn . logInLoadProfile ( context ) . then (
36+ authn . logInLoadProfile ( context ) . then (
4237 ( context : any ) => {
4338 let subject : NamedNode = context . me
4439
4540 const profile = subject . doc ( )
46- const editable = UI . store . updater . editable ( profile . uri , kb )
41+ const editable = store . updater . editable ( profile . uri , store )
4742
4843 main . appendChild ( createText ( 'h3' , 'Manage your trusted applications' ) )
4944
5045 if ( ! editable ) {
5146 main . appendChild (
52- UI . widgets . errorMessageBlock (
47+ widgets . errorMessageBlock (
5348 dom ,
5449 `Your profile ${
5550 subject . doc ( ) . uri
@@ -91,7 +86,7 @@ export function renderTrustedApplicationsOptions (dom: HTMLDocument) {
9186 )
9287 } ,
9388 ( err : any ) => {
94- statusArea . appendChild ( UI . widgets . errorMessageBlock ( dom , err ) )
89+ statusArea . appendChild ( widgets . errorMessageBlock ( dom , err ) )
9590 }
9691 )
9792 return div
@@ -111,12 +106,12 @@ function createApplicationTable (subject: NamedNode) {
111106 applicationsTable . appendChild ( header )
112107
113108 // creating rows
114- ; ( kb . each ( subject , ns . acl ( 'trustedApp' ) , undefined , undefined ) as any )
109+ ; ( store . each ( subject , ns . acl ( 'trustedApp' ) , undefined , undefined ) as any )
115110 . flatMap ( ( app : any ) => {
116- return kb
111+ return store
117112 . each ( app , ns . acl ( 'origin' ) , undefined , undefined )
118113 . map ( origin => ( {
119- appModes : kb . each ( app , ns . acl ( 'mode' ) , undefined , undefined ) ,
114+ appModes : store . each ( app , ns . acl ( 'mode' ) , undefined , undefined ) ,
120115 origin
121116 } ) )
122117 } )
@@ -242,7 +237,7 @@ function createApplicationEntry (
242237 const deletions = getStatementsToDelete (
243238 trustedApplicationState . origin || origin ,
244239 subject ,
245- kb ,
240+ store ,
246241 ns
247242 )
248243 const additions = getStatementsToAdd (
@@ -252,7 +247,7 @@ function createApplicationEntry (
252247 subject ,
253248 ns
254249 )
255- ; ( kb as any ) . updater . update ( deletions , additions , handleUpdateResponse )
250+ ; ( store as any ) . updater . update ( deletions , additions , handleUpdateResponse )
256251 }
257252
258253 function removeApplication ( event : Event ) {
@@ -266,8 +261,8 @@ function createApplicationEntry (
266261 )
267262 }
268263
269- const deletions = getStatementsToDelete ( origin , subject , kb , ns )
270- ; ( kb as any ) . updater . update ( deletions , [ ] , handleUpdateResponse )
264+ const deletions = getStatementsToDelete ( origin , subject , store , ns )
265+ ; ( store as any ) . updater . update ( deletions , [ ] , handleUpdateResponse )
271266 }
272267
273268 function handleUpdateResponse ( uri : any , success : boolean , errorBody : any ) {
0 commit comments