switch remix icons to spectrum in panels

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-23 10:07:50 +02:00
parent 66c5a134e5
commit b5db919ee1
3 changed files with 40 additions and 66 deletions

View File

@ -1,7 +1,7 @@
<script> <script>
import AutomationList from "./AutomationList.svelte" import AutomationList from "./AutomationList.svelte"
import CreateAutomationModal from "./CreateAutomationModal.svelte" import CreateAutomationModal from "./CreateAutomationModal.svelte"
import { Modal, Tabs, Tab } from "@budibase/bbui" import { Icon, Modal, Tabs, Tab } from "@budibase/bbui"
let modal let modal
</script> </script>
@ -16,22 +16,20 @@
</div> </div>
</Tab> </Tab>
</Tabs> </Tabs>
<i <div class="add-button">
on:click={modal.show} <Icon hoverable name="AddCircle" on:click={modal.show} />
data-cy="new-automation" </div>
class="ri-add-circle-fill" />
</div> </div>
<style> <style>
.tab-content-padding { .tab-content-padding {
padding: 0 var(--spacing-s); padding: 0 var(--spectrum-alias-item-padding-m);
} }
.add-button {
i {
font-size: 20px;
position: absolute; position: absolute;
top: var(--spacing-l); top: var(--spectrum-alias-item-padding-l);
right: var(--spacing-l); bottom: 0;
right: var(--spectrum-alias-item-padding-l);
} }
.title { .title {

View File

@ -12,7 +12,7 @@
import Layout from "components/design/NavigationPanel/Layout.svelte" import Layout from "components/design/NavigationPanel/Layout.svelte"
import NewScreenModal from "components/design/NavigationPanel/NewScreenModal.svelte" import NewScreenModal from "components/design/NavigationPanel/NewScreenModal.svelte"
import NewLayoutModal from "components/design/NavigationPanel/NewLayoutModal.svelte" import NewLayoutModal from "components/design/NavigationPanel/NewLayoutModal.svelte"
import { Modal, Select, Search, Tabs, Tab } from "@budibase/bbui" import { Icon, Modal, Select, Search, Tabs, Tab } from "@budibase/bbui"
const tabs = [ const tabs = [
{ {
@ -26,21 +26,21 @@
] ]
let modal let modal
$: selected = tabs.find(t => t.key === $params.assetType).title $: selected = tabs.find((t) => t.key === $params.assetType).title
const navigate = ({ detail }) => { const navigate = ({ detail }) => {
const { key } = tabs.find(t => t.title === detail) const { key } = tabs.find((t) => t.title === detail)
$goto(`../${key}`) $goto(`../${key}`)
} }
const updateAccessRole = event => { const updateAccessRole = (event) => {
const role = event.detail const role = event.detail
// Select a valid screen with this new role - otherwise we'll not be // Select a valid screen with this new role - otherwise we'll not be
// able to change role at all because ComponentNavigationTree will kick us // able to change role at all because ComponentNavigationTree will kick us
// back the current role again because the same screen ID is still selected // back the current role again because the same screen ID is still selected
const firstValidScreenId = $allScreens.find( const firstValidScreenId = $allScreens.find(
screen => screen.routing.roleId === role (screen) => screen.routing.roleId === role
)?._id )?._id
if (firstValidScreenId) { if (firstValidScreenId) {
store.actions.screens.select(firstValidScreenId) store.actions.screens.select(firstValidScreenId)
@ -49,7 +49,7 @@
// Otherwise clear the selected screen ID so that the first new valid screen // Otherwise clear the selected screen ID so that the first new valid screen
// can be selected by ComponentNavigationTree // can be selected by ComponentNavigationTree
else { else {
store.update(state => { store.update((state) => {
state.selectedScreenId = null state.selectedScreenId = null
return state return state
}) })
@ -72,13 +72,15 @@
on:change={updateAccessRole} on:change={updateAccessRole}
value={$selectedAccessRole} value={$selectedAccessRole}
label="Filter by Access" label="Filter by Access"
getOptionLabel={role => role.name} getOptionLabel={(role) => role.name}
getOptionValue={role => role._id} getOptionValue={(role) => role._id}
options={$roles} /> options={$roles}
/>
<Search <Search
placeholder="Enter a route to search" placeholder="Enter a route to search"
label="Search Screens" label="Search Screens"
bind:value={$screenSearchString} /> bind:value={$screenSearchString}
/>
</div> </div>
<div class="nav-items-container"> <div class="nav-items-container">
<ComponentNavigationTree /> <ComponentNavigationTree />
@ -93,7 +95,8 @@
<i <i
on:click={modal.show} on:click={modal.show}
data-cy="new-layout" data-cy="new-layout"
class="ri-add-circle-fill" /> class="ri-add-circle-fill"
/>
{#each $store.layouts as layout, idx (layout._id)} {#each $store.layouts as layout, idx (layout._id)}
<Layout {layout} border={idx > 0} /> <Layout {layout} border={idx > 0} />
{/each} {/each}
@ -103,7 +106,9 @@
</div> </div>
</Tab> </Tab>
</Tabs> </Tabs>
<i on:click={modal.show} data-cy="new-screen" class="ri-add-circle-fill" /> <div class="add-button">
<Icon hoverable name="AddCircle" on:click={modal.show} />
</div>
</div> </div>
<style> <style>
@ -114,15 +119,11 @@
align-items: stretch; align-items: stretch;
position: relative; position: relative;
} }
.title i { .add-button {
font-size: 20px;
position: absolute; position: absolute;
top: var(--spacing-l); top: var(--spectrum-alias-item-padding-l);
right: var(--spacing-l); bottom: 0;
} right: var(--spectrum-alias-item-padding-l);
.title i:hover {
cursor: pointer;
color: var(--blue);
} }
.role-select { .role-select {
@ -135,25 +136,6 @@
} }
.tab-content-padding { .tab-content-padding {
padding: 0 var(--spacing-s); padding: 0 var(--spectrum-alias-item-padding-m);
}
.search-screens {
position: relative;
}
.search-screens i {
right: 2px;
bottom: 2px;
position: absolute;
box-sizing: border-box;
padding: var(--spacing-s);
border-left: 1px solid var(--grey-4);
background-color: var(--grey-2);
border-top-right-radius: var(--border-radius-m);
border-bottom-right-radius: var(--border-radius-m);
color: var(--grey-7);
font-size: 14px;
line-height: 15px;
top: auto;
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<script> <script>
import { isActive, goto } from "@roxi/routify" import { isActive, goto } from "@roxi/routify"
import { Modal, Tabs, Tab } from "@budibase/bbui" import { Icon, Modal, Tabs, Tab } from "@budibase/bbui"
import TableNavigator from "components/backend/TableNavigator/TableNavigator.svelte" import TableNavigator from "components/backend/TableNavigator/TableNavigator.svelte"
import DatasourceNavigator from "components/backend/DatasourceNavigator/DatasourceNavigator.svelte" import DatasourceNavigator from "components/backend/DatasourceNavigator/DatasourceNavigator.svelte"
import CreateDatasourceModal from "components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte" import CreateDatasourceModal from "components/backend/DatasourceNavigator/modals/CreateDatasourceModal.svelte"
@ -20,7 +20,7 @@
let selected = $isActive("./datasource") ? "External" : "Internal" let selected = $isActive("./datasource") ? "External" : "Internal"
function selectFirstTableOrSource({ detail }) { function selectFirstTableOrSource({ detail }) {
const { key } = tabs.find(t => t.title === detail) const { key } = tabs.find((t) => t.title === detail)
if (key === "datasource") { if (key === "datasource") {
$goto("./datasource") $goto("./datasource")
} else { } else {
@ -52,11 +52,8 @@
</div> </div>
</Tab> </Tab>
</Tabs> </Tabs>
<div class="title"> <div class="add-button" data-cy={`new-${selected === "External" ? "datasource" : "tabel"}`}>
<i <Icon hoverable name="AddCircle" on:click={modal.show} />
data-cy={`new-${selected === 'External' ? 'datasource' : 'tabel'}`}
class="ri-add-circle-fill"
on:click={modal.show} />
</div> </div>
</div> </div>
<div class="content"> <div class="content">
@ -83,11 +80,8 @@
gap: var(--spacing-l); gap: var(--spacing-l);
background: var(--background); background: var(--background);
} }
.content :global(> span) {
display: contents;
}
.tab-content-padding { .tab-content-padding {
padding: 0 var(--spacing-s); padding: 0 var(--spectrum-alias-item-padding-m);
} }
.nav { .nav {
@ -101,11 +95,11 @@
border-right: var(--border-light); border-right: var(--border-light);
} }
i { .add-button {
font-size: 20px;
position: absolute; position: absolute;
top: var(--spacing-l); top: var(--spectrum-alias-item-padding-l);
right: var(--spacing-l); bottom: 0;
right: var(--spectrum-alias-item-padding-l);
} }
i:hover { i:hover {