mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 02:16:10 +02:00
🎉 Consolidate suggested libraries and add library button (#5828)
This commit is contained in:
parent
d836cc66da
commit
af93325fd9
6 changed files with 4 additions and 57 deletions
|
@ -221,7 +221,7 @@ export class WorkspacePage extends BaseWebSocketPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
async openLibrariesModal(clickOptions = {}) {
|
async openLibrariesModal(clickOptions = {}) {
|
||||||
await this.sidebar.getByText("Libraries").click(clickOptions);
|
await this.sidebar.getByTestId("libraries").click(clickOptions);
|
||||||
await expect(this.librariesModal).toBeVisible();
|
await expect(this.librariesModal).toBeVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
[app.common.types.file :as ctf]
|
[app.common.types.file :as ctf]
|
||||||
[app.common.types.typographies-list :as ctyl]
|
[app.common.types.typographies-list :as ctyl]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.data.dashboard :as dd]
|
[app.main.data.dashboard :as dd]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.data.notifications :as ntf]
|
[app.main.data.notifications :as ntf]
|
||||||
|
@ -354,7 +353,7 @@
|
||||||
(nil? shared-libraries)
|
(nil? shared-libraries)
|
||||||
(tr "workspace.libraries.loading")
|
(tr "workspace.libraries.loading")
|
||||||
|
|
||||||
(and (str/empty? search-term) (cf/external-feature-flag "templates-03" "test"))
|
(str/empty? search-term)
|
||||||
[:*
|
[:*
|
||||||
[:div {:class (stl/css :sample-libraries-info)}
|
[:div {:class (stl/css :sample-libraries-info)}
|
||||||
(tr "workspace.libraries.empty.no-libraries")
|
(tr "workspace.libraries.empty.no-libraries")
|
||||||
|
@ -369,19 +368,6 @@
|
||||||
{:library library
|
{:library library
|
||||||
:importing importing*}])]]
|
:importing importing*}])]]
|
||||||
|
|
||||||
(str/empty? search-term)
|
|
||||||
[:*
|
|
||||||
[:span {:class (stl/css :empty-state-icon)}
|
|
||||||
library-icon]
|
|
||||||
(tr "workspace.libraries.no-shared-libraries-available")
|
|
||||||
(when (cf/external-feature-flag "templates-01" "test")
|
|
||||||
[:div {:class (stl/css :templates-info)}
|
|
||||||
(tr "workspace.libraries.more-templates")
|
|
||||||
[:a {:target "_blank"
|
|
||||||
:class (stl/css :templates-info-link)
|
|
||||||
:href "https://penpot.app/libraries-templates"}
|
|
||||||
(tr "workspace.libraries.more-templates-link")]])]
|
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(tr "workspace.libraries.no-matches-for" search-term))]))]]))
|
(tr "workspace.libraries.no-matches-for" search-term))]))]]))
|
||||||
|
|
||||||
|
|
|
@ -326,16 +326,6 @@
|
||||||
padding: $s-0 $s-16;
|
padding: $s-0 $s-16;
|
||||||
}
|
}
|
||||||
|
|
||||||
.templates-info {
|
|
||||||
color: var(--color-accent-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.templates-info-link {
|
|
||||||
color: var(--color-accent-primary);
|
|
||||||
text-decoration: underline;
|
|
||||||
font-weight: $fw400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sample-libraries-info {
|
.sample-libraries-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
(:require-macros [app.main.style :as stl])
|
(:require-macros [app.main.style :as stl])
|
||||||
(:require
|
(:require
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.config :as cf]
|
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.data.workspace.assets :as dwa]
|
[app.main.data.workspace.assets :as dwa]
|
||||||
|
@ -92,12 +91,6 @@
|
||||||
reverse-sort? (= :desc ordering)
|
reverse-sort? (= :desc ordering)
|
||||||
num-libs (count (mf/deref refs/libraries))
|
num-libs (count (mf/deref refs/libraries))
|
||||||
|
|
||||||
show-templates-04-test1?
|
|
||||||
(and (cf/external-feature-flag "templates-04" "test1") (zero? num-libs))
|
|
||||||
|
|
||||||
show-templates-04-test2?
|
|
||||||
(and (cf/external-feature-flag "templates-04" "test2") (zero? num-libs))
|
|
||||||
|
|
||||||
toggle-ordering
|
toggle-ordering
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps ordering)
|
(mf/deps ordering)
|
||||||
|
@ -166,18 +159,12 @@
|
||||||
[:article {:class (stl/css :assets-bar)}
|
[:article {:class (stl/css :assets-bar)}
|
||||||
[:div {:class (stl/css :assets-header)}
|
[:div {:class (stl/css :assets-header)}
|
||||||
(when-not ^boolean read-only?
|
(when-not ^boolean read-only?
|
||||||
(cond
|
(if (= num-libs 1)
|
||||||
show-templates-04-test1?
|
|
||||||
[:button {:class (stl/css :libraries-button)
|
|
||||||
:on-click show-libraries-dialog
|
|
||||||
:data-testid "libraries"}
|
|
||||||
(tr "workspace.assets.add-library")]
|
|
||||||
show-templates-04-test2?
|
|
||||||
[:button {:class (stl/css :add-library-button)
|
[:button {:class (stl/css :add-library-button)
|
||||||
:on-click show-libraries-dialog
|
:on-click show-libraries-dialog
|
||||||
:data-testid "libraries"}
|
:data-testid "libraries"}
|
||||||
(tr "workspace.assets.add-library")]
|
(tr "workspace.assets.add-library")]
|
||||||
:else
|
|
||||||
[:button {:class (stl/css :libraries-button)
|
[:button {:class (stl/css :libraries-button)
|
||||||
:on-click show-libraries-dialog
|
:on-click show-libraries-dialog
|
||||||
:data-testid "libraries"}
|
:data-testid "libraries"}
|
||||||
|
|
|
@ -4786,10 +4786,6 @@ msgstr "Loading…"
|
||||||
msgid "workspace.libraries.more-templates"
|
msgid "workspace.libraries.more-templates"
|
||||||
msgstr "You can look for "
|
msgstr "You can look for "
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:391
|
|
||||||
msgid "workspace.libraries.more-templates-link"
|
|
||||||
msgstr "more templates in here"
|
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:481
|
#: src/app/main/ui/workspace/libraries.cljs:481
|
||||||
msgid "workspace.libraries.no-libraries-need-sync"
|
msgid "workspace.libraries.no-libraries-need-sync"
|
||||||
msgstr "There are no Shared Libraries that need update"
|
msgstr "There are no Shared Libraries that need update"
|
||||||
|
@ -4798,10 +4794,6 @@ msgstr "There are no Shared Libraries that need update"
|
||||||
msgid "workspace.libraries.no-matches-for"
|
msgid "workspace.libraries.no-matches-for"
|
||||||
msgstr "No matches found for “%s“"
|
msgstr "No matches found for “%s“"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:384
|
|
||||||
msgid "workspace.libraries.no-shared-libraries-available"
|
|
||||||
msgstr "There are no Shared Libraries available"
|
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:337
|
#: src/app/main/ui/workspace/libraries.cljs:337
|
||||||
msgid "workspace.libraries.search-shared-libraries"
|
msgid "workspace.libraries.search-shared-libraries"
|
||||||
msgstr "Search shared libraries"
|
msgstr "Search shared libraries"
|
||||||
|
|
|
@ -4804,10 +4804,6 @@ msgstr "Cargando…"
|
||||||
msgid "workspace.libraries.more-templates"
|
msgid "workspace.libraries.more-templates"
|
||||||
msgstr "Puedes buscar "
|
msgstr "Puedes buscar "
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:391
|
|
||||||
msgid "workspace.libraries.more-templates-link"
|
|
||||||
msgstr "más plantillas aquí"
|
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:481
|
#: src/app/main/ui/workspace/libraries.cljs:481
|
||||||
msgid "workspace.libraries.no-libraries-need-sync"
|
msgid "workspace.libraries.no-libraries-need-sync"
|
||||||
msgstr "No hay bibliotecas que necesiten ser actualizadas"
|
msgstr "No hay bibliotecas que necesiten ser actualizadas"
|
||||||
|
@ -4816,10 +4812,6 @@ msgstr "No hay bibliotecas que necesiten ser actualizadas"
|
||||||
msgid "workspace.libraries.no-matches-for"
|
msgid "workspace.libraries.no-matches-for"
|
||||||
msgstr "No se encuentra “%s“"
|
msgstr "No se encuentra “%s“"
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:384
|
|
||||||
msgid "workspace.libraries.no-shared-libraries-available"
|
|
||||||
msgstr "No hay bibliotecas compartidas disponibles"
|
|
||||||
|
|
||||||
#: src/app/main/ui/workspace/libraries.cljs:337
|
#: src/app/main/ui/workspace/libraries.cljs:337
|
||||||
msgid "workspace.libraries.search-shared-libraries"
|
msgid "workspace.libraries.search-shared-libraries"
|
||||||
msgstr "Buscar bibliotecas compartidas"
|
msgstr "Buscar bibliotecas compartidas"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue