0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-05 19:41:27 -05:00

🎉 Consolidate suggested libraries and add library button (#5828)

This commit is contained in:
Marina López 2025-02-13 20:06:28 +01:00 committed by GitHub
parent d836cc66da
commit af93325fd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 4 additions and 57 deletions

View file

@ -221,7 +221,7 @@ export class WorkspacePage extends BaseWebSocketPage {
}
async openLibrariesModal(clickOptions = {}) {
await this.sidebar.getByText("Libraries").click(clickOptions);
await this.sidebar.getByTestId("libraries").click(clickOptions);
await expect(this.librariesModal).toBeVisible();
}

View file

@ -14,7 +14,6 @@
[app.common.types.file :as ctf]
[app.common.types.typographies-list :as ctyl]
[app.common.uuid :as uuid]
[app.config :as cf]
[app.main.data.dashboard :as dd]
[app.main.data.modal :as modal]
[app.main.data.notifications :as ntf]
@ -354,7 +353,7 @@
(nil? shared-libraries)
(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)}
(tr "workspace.libraries.empty.no-libraries")
@ -369,19 +368,6 @@
{:library library
: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
(tr "workspace.libraries.no-matches-for" search-term))]))]]))

View file

@ -326,16 +326,6 @@
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 {
display: flex;
flex-direction: column;

View file

@ -8,7 +8,6 @@
(:require-macros [app.main.style :as stl])
(:require
[app.common.data.macros :as dm]
[app.config :as cf]
[app.main.data.modal :as modal]
[app.main.data.workspace :as dw]
[app.main.data.workspace.assets :as dwa]
@ -92,12 +91,6 @@
reverse-sort? (= :desc ordering)
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
(mf/use-fn
(mf/deps ordering)
@ -166,18 +159,12 @@
[:article {:class (stl/css :assets-bar)}
[:div {:class (stl/css :assets-header)}
(when-not ^boolean read-only?
(cond
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?
(if (= num-libs 1)
[:button {:class (stl/css :add-library-button)
:on-click show-libraries-dialog
:data-testid "libraries"}
(tr "workspace.assets.add-library")]
:else
[:button {:class (stl/css :libraries-button)
:on-click show-libraries-dialog
:data-testid "libraries"}

View file

@ -4786,10 +4786,6 @@ msgstr "Loading…"
msgid "workspace.libraries.more-templates"
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
msgid "workspace.libraries.no-libraries-need-sync"
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"
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
msgid "workspace.libraries.search-shared-libraries"
msgstr "Search shared libraries"

View file

@ -4804,10 +4804,6 @@ msgstr "Cargando…"
msgid "workspace.libraries.more-templates"
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
msgid "workspace.libraries.no-libraries-need-sync"
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"
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
msgid "workspace.libraries.search-shared-libraries"
msgstr "Buscar bibliotecas compartidas"