From 1350e1ab1ea1639d51262e6c5e3545875765a935 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sun, 22 Jan 2023 16:14:34 +0300 Subject: [PATCH 01/11] feat: visual distinction between NULL and empty string Signed-off-by: mertmit --- packages/nc-gui/components/cell/Text.vue | 2 ++ packages/nc-gui/components/cell/TextArea.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 7e0ad4279c..f1d1b1b33a 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -38,5 +38,7 @@ const focus: VNodeRef = (el) => { @mousedown.stop /> + NULL + diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index ad2fd14546..254a0d7044 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -55,6 +55,8 @@ const rowHeight = computed(() => { @mousedown.stop /> + NULL + {{ vModel }} From 47b90a35e2736fe35ad69e5590092021c1d40d07 Mon Sep 17 00:00:00 2001 From: navi Date: Wed, 25 Jan 2023 09:27:25 +0000 Subject: [PATCH 02/11] New translations en.json (Polish) --- packages/nc-gui/lang/pl.json | 224 +++++++++++++++++------------------ 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/packages/nc-gui/lang/pl.json b/packages/nc-gui/lang/pl.json index 775a022aea..454674960c 100644 --- a/packages/nc-gui/lang/pl.json +++ b/packages/nc-gui/lang/pl.json @@ -1,31 +1,31 @@ { "general": { - "home": "Dom", - "load": "Obciążenie", - "open": "otwarty", - "close": "Blisko", - "yes": "tak", + "home": "Start", + "load": "Załaduj", + "open": "Otwórz", + "close": "Zamknij", + "yes": "Tak", "no": "Nie", - "ok": "ok", + "ok": "OK", "and": "i", "or": "Lub", - "add": "Dodać", - "edit": "Edytować", - "remove": "Usunąć", - "save": "Zapisać", + "add": "Dodaj", + "edit": "Edytuj", + "remove": "Usuń", + "save": "Zapisz", "cancel": "Anuluj", - "submit": "Składać", + "submit": "Zapisz", "create": "Utwórz", "duplicate": "Duplikuj", - "insert": "Wstawić", - "delete": "Kasować", - "update": "Aktualizacja", - "rename": "Przemianować", - "reload": "Przeładować", - "reset": "Resetowanie", - "install": "zainstalować", - "show": "Pokazać", - "hide": "Ukrywać", + "insert": "Wstaw", + "delete": "Usuń", + "update": "Aktualizuj", + "rename": "Zmień nazwę", + "reload": "Przeładuj", + "reset": "Reset", + "install": "Zainstaluj", + "show": "Pokaż", + "hide": "Ukryj", "showAll": "Pokaż wszystko", "hideAll": "Schowaj wszystko", "showMore": "Pokaż więcej", @@ -33,31 +33,31 @@ "hideOptions": "Ukryj opcje", "showMenu": "Pokaż menu", "hideMenu": "Ukryj menu", - "addAll": "Dodać wszystko", + "addAll": "Dodaj wszystko", "removeAll": "Usuń wszystko", - "signUp": "Zapisać się", - "signIn": "ZALOGUJ SIĘ", - "signOut": "Wyloguj się", + "signUp": "ZAREJESTRUJ SIĘ", + "signIn": "Zaloguj", + "signOut": "Wyloguj", "required": "Wymagany", "preferred": "Preferowany", "mandatory": "Obowiązkowy", "loading": "Ładowanie ...", "title": "Tytuł", - "upload": "Wgrywać", - "download": "Pobierać", - "default": "Domyślna", + "upload": "Prześlij", + "download": "Pobierz", + "default": "Domyślny", "more": "Więcej", "less": "Mniej", - "event": "Wydarzenie", - "condition": "Stan: schorzenie", - "after": "Później", - "before": "Zanim", + "event": "Zdarzenie", + "condition": "Stan", + "after": "Po", + "before": "Przed", "search": "Szukaj", "notification": "Powiadomienie", - "reference": "Sprawdzenie", - "function": "Funkcjonować", + "reference": "Odniesienie", + "function": "Funkcja", "confirm": "Zatwierdź", - "generate": "Wygeneruj", + "generate": "Generuj", "copy": "Kopiuj", "misc": "Pozostałe", "lock": "Zablokuj", @@ -74,51 +74,51 @@ "insertBefore": "Wstaw przed", "hideField": "Ukryj pole", "sortAsc": "Sortowanie rosnące", - "sortDesc": "Sortuj w dół" + "sortDesc": "Sortuj malejąco" }, "objects": { "project": "Projekt", - "projects": "Projektowanie", + "projects": "Projekty", "table": "Tabela", - "tables": "Stoły", + "tables": "Tabele", "field": "Pole", "fields": "Pola", "column": "Kolumna", "columns": "Kolumny", "page": "Strona", "pages": "Strony", - "record": "Nagrywać", - "records": "Dokumentacja", + "record": "rekord", + "records": "rekordy", "webhook": "WebHook.", "webhooks": "Webhooks.", - "view": "Pogląd", - "views": "Wyświetlenia", + "view": "Widok", + "views": "Widoki", "viewType": { - "grid": "Siatka", + "grid": "Tabela", "gallery": "Galeria", "form": "Formularz", - "kanban": "Kanban.", + "kanban": "Kanban", "calendar": "Kalendarz" }, "user": "Użytkownik", - "users": "Użytkownicy.", + "users": "Użytkownicy", "role": "Rola", - "roles": "Role.", + "roles": "Role", "roleType": { "owner": "Właściciel", - "creator": "Twórca", - "editor": "Redaktor", + "creator": "Projektant", + "editor": "Edytor", "commenter": "Komentator", - "viewer": "Widz", - "orgLevelCreator": "Poziom organizacji Twórca", - "orgLevelViewer": "Przeglądarka poziomu organizacji" + "viewer": "Obserwator", + "orgLevelCreator": "Poziom organizacji Projektant", + "orgLevelViewer": "Poziomu organizacji obserwator" }, "sqlVIew": "Widok SQL" }, "datatype": { "ID": "Identyfikator", "ForeignKey": "Klucz obcy", - "SingleLineText": "Tekst pojedynczy linii", + "SingleLineText": "Tekst w pojedynczej linii", "LongText": "Długi tekst", "Attachment": "Załącznik", "Checkbox": "Pole wyboru", @@ -138,20 +138,20 @@ "Duration": "Czas trwania", "Rating": "Ocena", "Formula": "Formuła", - "Rollup": "Rollup.", - "Count": "Liczyć", - "Lookup": "Spojrzeć w górę", - "DateTime": "Czas daty", - "CreateTime": "Utwórz czas", - "LastModifiedTime": "Ostatni zmodyfikowany czas", - "AutoNumber": "Numer samochodu", - "Barcode": "kod kreskowy", + "Rollup": "Zliczanie", + "Count": "Licznik", + "Lookup": "Wyszukaj", + "DateTime": "Data", + "CreateTime": "Data utworzenia", + "LastModifiedTime": "Data modyfikacji", + "AutoNumber": "Automatyczny numer", + "Barcode": "Kod kreskowy", "Button": "Przycisk", "Password": "Hasło", "relationProperties": { "noAction": "Bez akcji", "cascade": "Kaskada", - "restrict": "Ograniczać", + "restrict": "Ograniczenie", "setNull": "Ustaw null.", "setDefault": "Ustaw domyślny" } @@ -159,8 +159,8 @@ "filterOperation": { "isEqual": "jest równy", "isNotEqual": "nie jest równy", - "isLike": "jest jak", - "isNot like": "nie jest taki", + "isLike": "podobny do", + "isNot like": "różny od", "isEmpty": "jest pusty", "isNotEmpty": "nie jest pusty", "isNull": "jest null.", @@ -170,31 +170,31 @@ "erdView": "Widok ERD", "newProj": "Nowy projekt", "myProject": "Moje projekty", - "formTitle": "Tytuł formy", - "collabView": "Widok współpracy", - "lockedView": "Zamknięty widok", + "formTitle": "Tytuł formularza", + "collabView": "Współtworzony", + "lockedView": "Zablokowany widok", "personalView": "Widok osobisty", "appStore": "Sklep z aplikacjami", - "teamAndAuth": "Team & Auth.", + "teamAndAuth": "Zespół i autoryzacja", "rolesUserMgmt": "Role i zarządzanie użytkownikami", "userMgmt": "Zarządzanie użytkownikami", - "apiTokenMgmt": "Zarządzanie Tokeny API.", - "rolesMgmt": "Zarządzanie rólami", + "apiTokenMgmt": "Zarządzanie Tokenami API", + "rolesMgmt": "Zarządzanie rolami", "projMeta": "Metadane projektu.", - "metaMgmt": "Meta Management.", - "metadata": "Metadata.", - "exportImportMeta": "Eksport / Importuj metadane", + "metaMgmt": "Zarządzanie Meta", + "metadata": "Metadata", + "exportImportMeta": "Eksport / Importuj Metadane", "uiACL": "Kontrola dostępu do interfejsu użytkownika", - "metaOperations": "Operacje metadanych", + "metaOperations": "Operacje na metadanych", "audit": "Rewizja", - "auditLogs": "Dziennik kontroli", - "sqlMigrations": "Migracje SQL.", - "dbCredentials": "Poświadczenia bazy danych.", - "advancedParameters": "Parametry SSL i zaawansowane", - "headCreateProject": "Utwórz projekt |. NOCODB.", - "headLogin": "Zaloguj się | NOCODB.", - "resetPassword": "Zresetuj swoje hasło", - "teamAndSettings": "Ustawienia zespołu", + "auditLogs": "Dziennik zmian", + "sqlMigrations": "Migracja SQL", + "dbCredentials": "Poświadczenia bazy danych", + "advancedParameters": "SSL i parametry zaawansowane", + "headCreateProject": "Utwórz projekt | Nocodb", + "headLogin": "Zaloguj się | Nocodb", + "resetPassword": "Resetowanie hasła", + "teamAndSettings": "Zespół i ustawienia", "apiDocs": "Dokumentacja API", "importFromAirtable": "Importuj z Airtable", "generateToken": "Wygeneruj token", @@ -209,19 +209,19 @@ }, "labels": { "createdBy": "Stworzony przez", - "notifyVia": "Powiadomić VIA.", + "notifyVia": "Powiadomienie przez", "projName": "Nazwa Projektu", "tableName": "Nazwa tabeli", - "viewName": "Zobacz nazwę.", - "viewLink": "Wyświetl link", + "viewName": "Nazwa widoku", + "viewLink": "Zobacz link", "columnName": "Nazwa kolumny", "columnType": "Typ kolumny", - "roleName": "Nazwa roli.", - "roleDescription": "opis roli", - "databaseType": "Wpisz bazy danych", + "roleName": "Nazwa roli", + "roleDescription": "Opisy roli", + "databaseType": "Typ w bazie danych", "lengthValue": "Długość / wartość", - "dbType": "Typ bazy danych.", - "sqliteFile": "Plik sqlite.", + "dbType": "Typ bazy danych", + "sqliteFile": "Plik SQLite", "hostAddress": "Adres hosta", "port": "Numer portu", "username": "Nazwa użytkownika", @@ -229,13 +229,13 @@ "schemaName": "Nazwa schematu", "database": "Baza danych", "action": "Akcja", - "actions": "działania", + "actions": "Akcje", "operation": "Operacja", - "operationType": "Typ pracy", - "operationSubType": "Podtypowy typ pracy", + "operationType": "Typ operacji", + "operationSubType": "Podtypowy akcji", "description": "Opis", "authentication": "Uwierzytelnianie", - "token": "Znak", + "token": "Token", "where": "Gdzie", "cache": "Pamięć podręczna", "chat": "Czat", @@ -243,49 +243,49 @@ "storage": "Przechowywanie", "uiAcl": "UI-ACL", "models": "Modele", - "syncState": "Synchronizowany stan", + "syncState": "Stan synchronizacji", "created": "Utworzony", "sqlOutput": "Wyjście SQL.", - "addOption": "Dodaj opcję.", + "addOption": "Dodaj opcję", "qrCodeValueColumn": "Kolumna z wartością kodu QR", "barcodeValueColumn": "Kolumna z wartością kodu kreskowego", "barcodeFormat": "Format kodu kreskowego", "qrCodeValueTooLong": "Zbyt wiele znaków dla kodu QR", "barcodeValueTooLong": "Zbyt wiele znaków dla kodu kreskowego", - "aggregateFunction": "Funkcja kruszywa", + "aggregateFunction": "Funkcja agregacji", "dbCreateIfNotExists": "Baza danych: Utwórz, jeśli nie istnieje", "clientKey": "Klucz klienta", - "clientCert": "Cert Client.", + "clientCert": "Certyfikat klienta", "serverCA": "Serwer ca.", - "requriedCa": "Wymagany-ca.", - "requriedIdentity": "Wymagana tożsamość", + "requriedCa": "Wymagany-CA", + "requriedIdentity": "Wymagana IDENTYFIKACJA", "inflection": { "tableName": "Nazwa tabeli", - "columnName": "Fleksja - Nazwa kolumny" + "columnName": "Nazwa tabeli" }, "community": { "starUs1": "Gwiazda", "starUs2": "My na Github.", "bookDemo": "Zarezerwuj darmowe demo", "getAnswered": "Odpowiedzi na pytania", - "joinDiscord": "Dołącz do Discord.", + "joinDiscord": "Dołącz do Discord", "joinCommunity": "Dołącz do społeczności NocoDB", "joinReddit": "Dołącz /r/NocoDB", "followNocodb": "Śledź NocoDB" }, "docReference": "Odnośnik do dokumentu", "selectUserRole": "Wybierz rolę użytkownika", - "childTable": "Stół dziecka.", - "childColumn": "Kolumna dla dzieci", + "childTable": "Tabele podrzędne", + "childColumn": "Kolumna podrzędna", "linkToAnotherRecord": "Link do innego rekordu", - "onUpdate": "Na aktualizacji", - "onDelete": "Na delete.", + "onUpdate": "Przy aktualizacji", + "onDelete": "Przy usuwaniu", "account": "Konto", "language": "Język", "primaryColor": "Kolor podstawowy", "accentColor": "Kolor akcentu", - "customTheme": "Motyw Niestandardowy", - "requestDataSource": "Poproś o źródło danych, którego potrzebujesz.", + "customTheme": "Motyw indywidualny", + "requestDataSource": "Poproś o źródło danych, którego potrzebujesz", "apiKey": "Klucz API", "sharedBase": "Udostępniona baza", "importData": "Import Danych", @@ -295,7 +295,7 @@ "importAttachmentColumns": "Importuj kolumny załączników", "importFormulaColumns": "Importuj kolumny formuły", "noData": "Brak danych", - "goToDashboard": "Przejdź do pulpitu", + "goToDashboard": "Przejdź do panelu", "importing": "Importowanie", "flattenNested": "Spłaszcz zagnieżdżone", "downloadAllowed": "Pobieranie dozwolone", @@ -313,18 +313,18 @@ "agreeToTos": "Rejestrując się, akceptujesz warunki korzystania z usługi", "welcomeToNc": "Witaj w NocoDB!", "inviteOnlySignup": "Zezwalaj na rejestrację tylko przy użyciu adresu url zaproszenia", - "nextRow": "Następny rząd", + "nextRow": "Następny wiersz", "prevRow": "Poprzedni wiersz" }, "activity": { "createProject": "Utwórz projekt", "importProject": "Importuj projekt.", "searchProject": "Szukaj projektu", - "editProject": "Edytuj projekt.", + "editProject": "Edytuj projekt", "stopProject": "Zatrzymaj projekt", - "startProject": "Rozpocznij projekt.", + "startProject": "Rozpocznij projekt", "restartProject": "Restartuj projekt", - "deleteProject": "Usuń Projekt.", + "deleteProject": "Usuń Projekt", "refreshProject": "Odśwież projekty", "saveProject": "Zapisz Projekt", "deleteKanbanStack": "Usunąć stos?", @@ -337,7 +337,7 @@ "upgrade": { "available": "Aktualizacja dostępna", "releaseNote": "Informacje o wydaniu", - "howTo": "Jak ulepszyć?" + "howTo": "Jak uaktualnić?" }, "translate": "Pomóż przetłumaczyć", "account": { From a581bbc7fd94ce97a7c1a87f1f4bf82104ce0285 Mon Sep 17 00:00:00 2001 From: mertmit Date: Wed, 25 Jan 2023 16:07:47 +0300 Subject: [PATCH 03/11] feat: extended support for NULL indicator Signed-off-by: mertmit --- packages/nc-gui/assets/style.scss | 7 +++++++ packages/nc-gui/components/cell/Currency.vue | 2 ++ packages/nc-gui/components/cell/DatePicker.vue | 3 ++- packages/nc-gui/components/cell/DateTimePicker.vue | 5 ++++- packages/nc-gui/components/cell/Decimal.vue | 1 + packages/nc-gui/components/cell/Duration.vue | 2 ++ packages/nc-gui/components/cell/Email.vue | 2 ++ packages/nc-gui/components/cell/Float.vue | 1 + packages/nc-gui/components/cell/Integer.vue | 1 + packages/nc-gui/components/cell/Json.vue | 2 ++ packages/nc-gui/components/cell/Percent.vue | 1 + packages/nc-gui/components/cell/Text.vue | 2 +- packages/nc-gui/components/cell/TextArea.vue | 2 +- packages/nc-gui/components/cell/TimePicker.vue | 5 ++++- packages/nc-gui/components/cell/Url.vue | 2 ++ packages/nc-gui/components/cell/YearPicker.vue | 3 ++- 16 files changed, 35 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scss index 14de553535..666f0ebc83 100644 --- a/packages/nc-gui/assets/style.scss +++ b/packages/nc-gui/assets/style.scss @@ -294,3 +294,10 @@ a { .ant-select-selection-search-input:focus { @apply !ring-0; } + +.nc-null { + @apply text-gray-300 italic; + input::placeholder { + @apply text-gray-300 italic; + } +} diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue index 2ff0e2560a..12850e1be1 100644 --- a/packages/nc-gui/components/cell/Currency.vue +++ b/packages/nc-gui/components/cell/Currency.vue @@ -81,6 +81,8 @@ onMounted(() => { @mousedown.stop /> + NULL + {{ currency }} diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index c0c662732d..b0d736267a 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -71,7 +71,7 @@ watch( { flush: 'post' }, ) -const placeholder = computed(() => (isDateInvalid ? 'Invalid date' : '')) +const placeholder = computed(() => (modelValue === null ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -169,6 +169,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { v-model:value="localState" :bordered="false" class="!w-full !px-0 !border-none" + :class="{ 'nc-null': modelValue === null }" :format="dateFormat" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index af47b62e02..7789a458ef 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -79,6 +79,8 @@ watch( { flush: 'post' }, ) +const placeholder = computed(() => (modelValue === null ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) + useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { case 'Enter': @@ -172,8 +174,9 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { :show-time="true" :bordered="false" class="!w-full !px-0 !border-none" + :class="{ 'nc-null': modelValue === null }" :format="dateTimeFormat" - :placeholder="isDateInvalid ? 'Invalid date' : ''" + :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" :input-read-only="true" :dropdown-class-name="`${randomClass} nc-picker-datetime ${open ? 'active' : ''}`" diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue index 0529cb206e..0703c10326 100644 --- a/packages/nc-gui/components/cell/Decimal.vue +++ b/packages/nc-gui/components/cell/Decimal.vue @@ -49,6 +49,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @selectstart.capture.stop @mousedown.stop /> + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index e640754c38..3de34ba1ba 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -93,6 +93,8 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @mousedown.stop /> + NULL + {{ localState }}
diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue index 9d0de8ad18..e304275b07 100644 --- a/packages/nc-gui/components/cell/Email.vue +++ b/packages/nc-gui/components/cell/Email.vue @@ -39,6 +39,8 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @mousedown.stop /> + NULL + {{ vModel }} diff --git a/packages/nc-gui/components/cell/Float.vue b/packages/nc-gui/components/cell/Float.vue index 44e9babee2..ffa0c2c6e9 100644 --- a/packages/nc-gui/components/cell/Float.vue +++ b/packages/nc-gui/components/cell/Float.vue @@ -49,6 +49,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @selectstart.capture.stop @mousedown.stop /> + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue index 7b4426925f..7d7a25bc31 100644 --- a/packages/nc-gui/components/cell/Integer.vue +++ b/packages/nc-gui/components/cell/Integer.vue @@ -53,6 +53,7 @@ function onKeyDown(evt: KeyboardEvent) { @selectstart.capture.stop @mousedown.stop /> + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue index b4176d0d64..4eeec392ae 100644 --- a/packages/nc-gui/components/cell/Json.vue +++ b/packages/nc-gui/components/cell/Json.vue @@ -154,6 +154,8 @@ useSelectedCellKeyupListener(active, (e) => {
+ NULL + {{ vModel }} diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index bea2acd71b..e29be38a6c 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -47,5 +47,6 @@ const focus: VNodeRef = (el) => { @selectstart.capture.stop @mousedown.stop /> + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index f1d1b1b33a..32baee6fc4 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -38,7 +38,7 @@ const focus: VNodeRef = (el) => { @mousedown.stop /> - NULL + NULL diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index 254a0d7044..c09f9717fa 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -55,7 +55,7 @@ const rowHeight = computed(() => { @mousedown.stop /> - NULL + NULL diff --git a/packages/nc-gui/components/cell/TimePicker.vue b/packages/nc-gui/components/cell/TimePicker.vue index 23f6af1919..a873643986 100644 --- a/packages/nc-gui/components/cell/TimePicker.vue +++ b/packages/nc-gui/components/cell/TimePicker.vue @@ -72,6 +72,8 @@ watch( { flush: 'post' }, ) +const placeholder = computed(() => (modelValue === null ? 'NULL' : isTimeInvalid ? 'Invalid time' : '')) + useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { case 'Enter': @@ -97,7 +99,8 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { use12-hours format="HH:mm" class="!w-full !px-0 !border-none" - :placeholder="isTimeInvalid ? 'Invalid time' : ''" + :class="{ 'nc-null': modelValue === null }" + :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" :input-read-only="true" :open="(readOnly || (localState && isPk)) && !active && !editable ? false : open" diff --git a/packages/nc-gui/components/cell/Url.vue b/packages/nc-gui/components/cell/Url.vue index 742ee0e661..fe84746c32 100644 --- a/packages/nc-gui/components/cell/Url.vue +++ b/packages/nc-gui/components/cell/Url.vue @@ -88,6 +88,8 @@ watch( @mousedown.stop /> + NULL + (isYearInvalid ? 'Invalid year' : '')) +const placeholder = computed(() => (modelValue === null ? 'NULL' : isYearInvalid ? 'Invalid year' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -82,6 +82,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { picker="year" :bordered="false" class="!w-full !px-0 !border-none" + :class="{ 'nc-null': modelValue === null }" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" :input-read-only="true" From 46b5640dce0ca4aa0e5c2dc4f22621cb10629b52 Mon Sep 17 00:00:00 2001 From: mertmit Date: Wed, 25 Jan 2023 16:26:22 +0300 Subject: [PATCH 04/11] feat: add showNull to global state to control indicator Signed-off-by: mertmit --- packages/nc-gui/components/cell/Currency.vue | 4 +++- packages/nc-gui/components/cell/DatePicker.vue | 6 ++++-- packages/nc-gui/components/cell/DateTimePicker.vue | 6 ++++-- packages/nc-gui/components/cell/Decimal.vue | 4 +++- packages/nc-gui/components/cell/Duration.vue | 4 +++- packages/nc-gui/components/cell/Email.vue | 4 +++- packages/nc-gui/components/cell/Float.vue | 4 +++- packages/nc-gui/components/cell/Integer.vue | 4 +++- packages/nc-gui/components/cell/Json.vue | 4 +++- packages/nc-gui/components/cell/Percent.vue | 4 +++- packages/nc-gui/components/cell/Text.vue | 4 +++- packages/nc-gui/components/cell/TextArea.vue | 4 +++- packages/nc-gui/components/cell/TimePicker.vue | 6 ++++-- packages/nc-gui/components/cell/Url.vue | 4 +++- packages/nc-gui/components/cell/YearPicker.vue | 6 ++++-- packages/nc-gui/components/dashboard/settings/Misc.vue | 6 +++++- packages/nc-gui/components/dashboard/settings/Modal.vue | 6 +++--- packages/nc-gui/composables/useGlobal/state.ts | 1 + packages/nc-gui/composables/useGlobal/types.ts | 1 + tests/playwright/pages/Dashboard/Settings/index.ts | 2 +- 20 files changed, 60 insertions(+), 24 deletions(-) diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue index 12850e1be1..9aa50944c5 100644 --- a/packages/nc-gui/components/cell/Currency.vue +++ b/packages/nc-gui/components/cell/Currency.vue @@ -10,6 +10,8 @@ const props = defineProps() const emit = defineEmits(['update:modelValue', 'save']) +const { showNull } = useGlobal() + const column = inject(ColumnInj)! const editEnabled = inject(EditModeInj)! @@ -81,7 +83,7 @@ onMounted(() => { @mousedown.stop /> - NULL + NULL {{ currency }} diff --git a/packages/nc-gui/components/cell/DatePicker.vue b/packages/nc-gui/components/cell/DatePicker.vue index b0d736267a..1beb28fc9a 100644 --- a/packages/nc-gui/components/cell/DatePicker.vue +++ b/packages/nc-gui/components/cell/DatePicker.vue @@ -22,6 +22,8 @@ const { modelValue, isPk } = defineProps() const emit = defineEmits(['update:modelValue']) +const { showNull } = useGlobal() + const columnMeta = inject(ColumnInj, null)! const readOnly = inject(ReadonlyInj, ref(false)) @@ -71,7 +73,7 @@ watch( { flush: 'post' }, ) -const placeholder = computed(() => (modelValue === null ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) +const placeholder = computed(() => (modelValue === null && showNull.value ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -169,7 +171,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { v-model:value="localState" :bordered="false" class="!w-full !px-0 !border-none" - :class="{ 'nc-null': modelValue === null }" + :class="{ 'nc-null': modelValue === null && showNull }" :format="dateFormat" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index 7789a458ef..63931e018a 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/packages/nc-gui/components/cell/DateTimePicker.vue @@ -25,6 +25,8 @@ const emit = defineEmits(['update:modelValue']) const { isMysql } = useProject() +const { showNull } = useGlobal() + const readOnly = inject(ReadonlyInj, ref(false)) const active = inject(ActiveCellInj, ref(false)) @@ -79,7 +81,7 @@ watch( { flush: 'post' }, ) -const placeholder = computed(() => (modelValue === null ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) +const placeholder = computed(() => (modelValue === null && showNull.value ? 'NULL' : isDateInvalid ? 'Invalid date' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -174,7 +176,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { :show-time="true" :bordered="false" class="!w-full !px-0 !border-none" - :class="{ 'nc-null': modelValue === null }" + :class="{ 'nc-null': modelValue === null && showNull }" :format="dateTimeFormat" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" diff --git a/packages/nc-gui/components/cell/Decimal.vue b/packages/nc-gui/components/cell/Decimal.vue index 0703c10326..04b5659968 100644 --- a/packages/nc-gui/components/cell/Decimal.vue +++ b/packages/nc-gui/components/cell/Decimal.vue @@ -14,6 +14,8 @@ const props = defineProps() const emits = defineEmits() +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const _vModel = useVModel(props, 'modelValue', emits) @@ -49,7 +51,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @selectstart.capture.stop @mousedown.stop /> - NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Duration.vue b/packages/nc-gui/components/cell/Duration.vue index 3de34ba1ba..fae891769f 100644 --- a/packages/nc-gui/components/cell/Duration.vue +++ b/packages/nc-gui/components/cell/Duration.vue @@ -19,6 +19,8 @@ const { modelValue } = defineProps() const emit = defineEmits(['update:modelValue']) +const { showNull } = useGlobal() + const column = inject(ColumnInj) const editEnabled = inject(EditModeInj) @@ -93,7 +95,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @mousedown.stop /> - NULL + NULL {{ localState }} diff --git a/packages/nc-gui/components/cell/Email.vue b/packages/nc-gui/components/cell/Email.vue index e304275b07..de25a13451 100644 --- a/packages/nc-gui/components/cell/Email.vue +++ b/packages/nc-gui/components/cell/Email.vue @@ -14,6 +14,8 @@ const props = defineProps() const emits = defineEmits() +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const vModel = useVModel(props, 'modelValue', emits) @@ -39,7 +41,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @mousedown.stop /> - NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Float.vue b/packages/nc-gui/components/cell/Float.vue index ffa0c2c6e9..fe0fcd9c85 100644 --- a/packages/nc-gui/components/cell/Float.vue +++ b/packages/nc-gui/components/cell/Float.vue @@ -14,6 +14,8 @@ const props = defineProps() const emits = defineEmits() +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const _vModel = useVModel(props, 'modelValue', emits) @@ -49,7 +51,7 @@ const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() @selectstart.capture.stop @mousedown.stop /> - NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Integer.vue b/packages/nc-gui/components/cell/Integer.vue index 7d7a25bc31..d654e3d127 100644 --- a/packages/nc-gui/components/cell/Integer.vue +++ b/packages/nc-gui/components/cell/Integer.vue @@ -14,6 +14,8 @@ const props = defineProps() const emits = defineEmits() +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const _vModel = useVModel(props, 'modelValue', emits) @@ -53,7 +55,7 @@ function onKeyDown(evt: KeyboardEvent) { @selectstart.capture.stop @mousedown.stop /> - NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Json.vue b/packages/nc-gui/components/cell/Json.vue index 4eeec392ae..3042946ff4 100644 --- a/packages/nc-gui/components/cell/Json.vue +++ b/packages/nc-gui/components/cell/Json.vue @@ -25,6 +25,8 @@ const props = defineProps() const emits = defineEmits() +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj, ref(false)) const active = inject(ActiveCellInj, ref(false)) @@ -154,7 +156,7 @@ useSelectedCellKeyupListener(active, (e) => {
- NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index e29be38a6c..37ac682b56 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -10,6 +10,8 @@ const props = defineProps() const emits = defineEmits(['update:modelValue']) +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const _vModel = useVModel(props, 'modelValue', emits) @@ -47,6 +49,6 @@ const focus: VNodeRef = (el) => { @selectstart.capture.stop @mousedown.stop /> - NULL + NULL {{ vModel }} diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 32baee6fc4..d185167b56 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -10,6 +10,8 @@ const props = defineProps() const emits = defineEmits(['update:modelValue']) +const { showNull } = useGlobal() + const editEnabled = inject(EditModeInj) const readonly = inject(ReadonlyInj, ref(false)) @@ -38,7 +40,7 @@ const focus: VNodeRef = (el) => { @mousedown.stop /> - NULL + NULL diff --git a/packages/nc-gui/components/cell/TextArea.vue b/packages/nc-gui/components/cell/TextArea.vue index c09f9717fa..96dc64ebdf 100644 --- a/packages/nc-gui/components/cell/TextArea.vue +++ b/packages/nc-gui/components/cell/TextArea.vue @@ -11,6 +11,8 @@ const emits = defineEmits(['update:modelValue']) const editEnabled = inject(EditModeInj) +const { showNull } = useGlobal() + const view = inject(ActiveViewInj, ref()) const vModel = useVModel(props, 'modelValue', emits, { defaultValue: '' }) @@ -55,7 +57,7 @@ const rowHeight = computed(() => { @mousedown.stop /> - NULL + NULL diff --git a/packages/nc-gui/components/cell/TimePicker.vue b/packages/nc-gui/components/cell/TimePicker.vue index a873643986..862d7a3036 100644 --- a/packages/nc-gui/components/cell/TimePicker.vue +++ b/packages/nc-gui/components/cell/TimePicker.vue @@ -13,6 +13,8 @@ const emit = defineEmits(['update:modelValue']) const { isMysql } = useProject() +const { showNull } = useGlobal() + const readOnly = inject(ReadonlyInj, ref(false)) const active = inject(ActiveCellInj, ref(false)) @@ -72,7 +74,7 @@ watch( { flush: 'post' }, ) -const placeholder = computed(() => (modelValue === null ? 'NULL' : isTimeInvalid ? 'Invalid time' : '')) +const placeholder = computed(() => (modelValue === null && showNull.value ? 'NULL' : isTimeInvalid ? 'Invalid time' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -99,7 +101,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { use12-hours format="HH:mm" class="!w-full !px-0 !border-none" - :class="{ 'nc-null': modelValue === null }" + :class="{ 'nc-null': modelValue === null && showNull }" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" :input-read-only="true" diff --git a/packages/nc-gui/components/cell/Url.vue b/packages/nc-gui/components/cell/Url.vue index fe84746c32..11a2ba5562 100644 --- a/packages/nc-gui/components/cell/Url.vue +++ b/packages/nc-gui/components/cell/Url.vue @@ -24,6 +24,8 @@ const emit = defineEmits(['update:modelValue']) const { t } = useI18n() +const { showNull } = useGlobal() + const column = inject(ColumnInj)! const editEnabled = inject(EditModeInj)! @@ -88,7 +90,7 @@ watch( @mousedown.stop /> - NULL + NULL () const emit = defineEmits(['update:modelValue']) +const { showNull } = useGlobal() + const readOnly = inject(ReadonlyInj, ref(false)) const active = inject(ActiveCellInj, ref(false)) @@ -58,7 +60,7 @@ watch( { flush: 'post' }, ) -const placeholder = computed(() => (modelValue === null ? 'NULL' : isYearInvalid ? 'Invalid year' : '')) +const placeholder = computed(() => (modelValue === null && showNull.value ? 'NULL' : isYearInvalid ? 'Invalid year' : '')) useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { switch (e.key) { @@ -82,7 +84,7 @@ useSelectedCellKeyupListener(active, (e: KeyboardEvent) => { picker="year" :bordered="false" class="!w-full !px-0 !border-none" - :class="{ 'nc-null': modelValue === null }" + :class="{ 'nc-null': modelValue === null && showNull }" :placeholder="placeholder" :allow-clear="!readOnly && !localState && !isPk" :input-read-only="true" diff --git a/packages/nc-gui/components/dashboard/settings/Misc.vue b/packages/nc-gui/components/dashboard/settings/Misc.vue index 1a33f606b7..b177e0b912 100644 --- a/packages/nc-gui/components/dashboard/settings/Misc.vue +++ b/packages/nc-gui/components/dashboard/settings/Misc.vue @@ -1,7 +1,7 @@