How to use the solid-ui.ns.acl function in solid-ui

To help you get started, we’ve selected a few solid-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github solid / solid-panes / src / dashboard / trustedApplications / trustedApplicationsPane.ts View on Github external
.map(origin => ({
          appModes: store.each(app, ns.acl('mode'), undefined, undefined),
          origin
        }))
    })
    .sort((a: any, b: any) => (a.origin.value < b.origin.value ? -1 : 1))
    .forEach(
      ({ appModes, origin }: { appModes: NamedNode[]; origin: NamedNode }) =>
        applicationsTable.appendChild(
          createApplicationEntry(subject, origin, appModes, updateTable)
        )
    )

  // adding a row for new applications
  applicationsTable.appendChild(
    createApplicationEntry(subject, null, [ns.acl('Read')], updateTable)
  )

  return applicationsTable

  function updateTable () {
    applicationsTable.parentElement!.replaceChild(
      createApplicationTable(subject),
      applicationsTable
    )
  }
}
github solid / solid-panes / src / dashboard / trustedApplications / trustedApplicationsPane.ts View on Github external
function createApplicationTable (subject: NamedNode) {
  const applicationsTable = createElement('table', {
    class: 'results'
  })

  // creating headers
  const header = createContainer('tr', [
    createText('th', 'Application URL'),
    createText('th', 'Access modes'),
    createText('th', 'Actions')
  ])
  applicationsTable.appendChild(header)

  // creating rows
  ;(store.each(subject, ns.acl('trustedApp'), undefined, undefined) as any)
    .flatMap((app: any) => {
      return store
        .each(app, ns.acl('origin'), undefined, undefined)
        .map(origin => ({
          appModes: store.each(app, ns.acl('mode'), undefined, undefined),
          origin
        }))
    })
    .sort((a: any, b: any) => (a.origin.value < b.origin.value ? -1 : 1))
    .forEach(
      ({ appModes, origin }: { appModes: NamedNode[]; origin: NamedNode }) =>
        applicationsTable.appendChild(
          createApplicationEntry(subject, origin, appModes, updateTable)
        )
    )
github solid / solid-panes / src / dashboard / trustedApplications / trustedApplicationsPane.ts View on Github external
.flatMap((app: any) => {
      return store
        .each(app, ns.acl('origin'), undefined, undefined)
        .map(origin => ({
          appModes: store.each(app, ns.acl('mode'), undefined, undefined),
          origin
        }))
    })
    .sort((a: any, b: any) => (a.origin.value < b.origin.value ? -1 : 1))
github solid / solid-panes / src / dashboard / trustedApplications / trustedApplicationsPane.ts View on Github external
.map(origin => ({
          appModes: store.each(app, ns.acl('mode'), undefined, undefined),
          origin
        }))
    })
github solid / solid-panes / src / dashboard / trustedApplications / trustedApplicationsPane.ts View on Github external
return ['Read', 'Write', 'Append', 'Control'].map(mode => {
    const isChecked = appModes.some(
      appMode => appMode.value === ns.acl(mode).value
    )
    return createContainer('label', [
      createElement(
        'input',
        {
          type: 'checkbox',
          ...(isChecked ? { checked: '' } : {}),
          value: ns.acl(mode).uri
        },
        {},
        element => formElements.modes.push(element)
      ),
      createText('span', mode)
    ])
  })
}