Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfct: rename 'database' to 'workspace' on front end #2317

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/cljs/athens/electron/db_menu/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[:> Button {:mr "auto"
:onClick #(reset! merge-open? true)} "Merge from Roam"]
(when-not (= :in-memory (:type db))
[:> Tooltip {:label "Can't remove last database"
[:> Tooltip {:label "Can't remove the last workspace"
:placement "right"
:isDisabled (< 1 (count all-dbs))}
[:> Button {:isDisabled (= 1 (count all-dbs))
Expand All @@ -48,7 +48,7 @@
[:> PopoverTrigger
[:> IconButton {:p 0
:variant "ghost"
:aria-label "Database menu"}
:aria-label "Workspaces menu"}
;; DB Icon + Dropdown toggle
[db-icon {:db active-db
:status sync-status}]]]
Expand Down Expand Up @@ -76,7 +76,7 @@
:textTransform "uppercase"
:fontWeight "bold"
:color "foreground.secondary"}
"Other databases"]
"Other workspaces"]
[:> VStack {:align "stretch"
:position "relative"
:spacing 0
Expand Down Expand Up @@ -107,4 +107,4 @@
:ml 10
:justifyContent "flex-start"}
[:> Button {:onClick #(dispatch [:modal/toggle])}
"Add Database"]]]]]]]))
"Add Workspace"]]]]]]]))
12 changes: 6 additions & 6 deletions src/cljs/athens/electron/db_modal.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
[:> FormControl {:isReadOnly true}
[:> FormLabel (if @loading
"No DB Found At"
"Current database location")]
"Current workspace location")]
[:> HStack
[:> Text {:as "output"
:borderRadius "md"
Expand Down Expand Up @@ -71,7 +71,7 @@
(->>
[:> VStack {:spacing 4}
[:> FormControl
[:> FormLabel "Database name"]
[:> FormLabel "Workspace name"]
[:> Input {:defaultValue @name
:onChange #(reset! name (js-event->val %))}]]
[:> FormControl
Expand Down Expand Up @@ -109,7 +109,7 @@
[:> ModalOverlay]
[:> ModalContent
[:> ModalHeader
"Add Database"]
"Add Workspace"]
(when-not @loading
[:> ModalCloseButton])
[:> ModalBody {:display "contents"}
Expand All @@ -121,9 +121,9 @@
:defaultIndex (if utils/electron? 0 1)}
(when utils/electron?
[:> TabList
[:> Tab "Open Local"]
[:> Tab "Join Remote"]
[:> Tab "Create New"]])
[:> Tab "Open Local Workspace"]
[:> Tab "Join Remote Workspace"]
[:> Tab "Create Workspace"]])
[:> TabPanels {:display "contents"}
[:> TabPanel {:display "contents"}
[open-local-comp loading selected-db]]
Expand Down
4 changes: 2 additions & 2 deletions src/cljs/athens/electron/db_picker.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
db-exists? (utils/db-exists? target-db)]
(cond
(not synced?)
{:dispatch [:alert/js "Database is saving your changes, if you switch now your changes will not be saved."]}
{:dispatch [:alert/js "Athens is saving your changes, if you switch now your changes will not be saved."]}

db-exists?
{:db (select-db db id)
Expand All @@ -96,7 +96,7 @@
[:boot]]}

:else
{:dispatch-n [[:alert/js "This database does not exist anymore, removing it from list."]
{:dispatch-n [[:alert/js "This workspace does not exist. It will be removed from the list."]
[:db-picker/remove-db target-db]]}))))


Expand Down
6 changes: 3 additions & 3 deletions src/cljs/athens/electron/dialogs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@


(defn open-dialog!
"Allow user to open db elsewhere from filesystem."
"Allow user to open workspace elsewhere from filesystem."
[]
(let [res (.showOpenDialogSync (utils/dialog) open-dir-opts)
db-location (first res)]
Expand All @@ -71,7 +71,7 @@


(defn create-dialog!
"Create a new database."
"Create a new workspace"
[db-name]
(let [res (.showOpenDialogSync (utils/dialog) open-dir-opts)
db-location (first res)]
Expand All @@ -94,7 +94,7 @@


(defn delete-dialog!
"Delete an existing database. Select the first db of the remaining ones if user is deleting the currently selected db."
"Delete an existing workspace. Select the first db of the remaining ones if user is deleting the currently selected db."
[{:keys [id] :as db}]
(let [remote-db? (utils/remote-db? db)
confirmation-msg (delete-msg-prompt db)
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/events/remote.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
:remote/connection-failed
(fn [_ _]
(log/warn ":remote/connection-failed")
{:fx [[:dispatch-n [[:alert/js "Was not able to connect to the remote database."]
{:fx [[:dispatch-n [[:alert/js "Couldn't connect to remote workspace."]
[:conn-status :disconnected]
[:db-picker/select-default-db]]]]}))

Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/import/roam.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
[:> ButtonGroup
[:> Button
{:onClick #(.click @inputRef)}
"Upload database"]]]])
"Upload workspace"]]]])
(let [athens-db @athens.db/dsdb
roam-db @transformed-roam-db
[shared-pages roam-pages] (shared-and-non-shared-pages athens-db roam-db)]
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/views/app_toolbar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
:onPressMinimize on-minimize
:currentPageTitle (or @current-page-title nil)
:onPressClose on-close
:databaseMenu (r/as-element [db-menu])
:workspacesMenu (r/as-element [db-menu])
:presenceDetails (when (electron.utils/remote-db? @selected-db)
(r/as-element [toolbar-presence-el]))}
(when (notifications/enabled?)
Expand Down
6 changes: 3 additions & 3 deletions src/cljs/athens/views/pages/settings.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
:onChange #(handle-monitoring-click monitoring update-fn)}
"Send usage data and diagnostics to Athens"]]
[help
[:<> [:p "Athens has never and will never look at the contents of your database."]
[:<> [:p "Athens has never and will never look at the contents of your workspace."]
[:p "Athens will never ever sell your data."]]]]])


Expand Down Expand Up @@ -305,8 +305,8 @@
"Reset all settings to defaults"]]
[help
[:<> [:> Text "All settings saved between sessions will be restored to defaults."]
[:> Text "Databases on disk will not be deleted, but you will need to add them to Athens again."]
[:> Text "Athens will restart after reset and open the default database path."]]]]])
[:> Text "Workspaces on disk will not be deleted, but you will need to add them to Athens again."]
[:> Text "Athens will restart after reset and open the default workspace path."]]]]])


(defn page
Expand Down
12 changes: 6 additions & 6 deletions src/js/components/AppToolbar/AppToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ export interface AppToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
*/
isCommandBarOpen: boolean;
/**
* Whether the choose database dialog is open
* Whether the choose workspaces dialog is open
*/
isDatabaseDialogOpen: boolean;
isWorkspacesDialogOpen: boolean;
/**
* Whether the help dialog is open
*/
Expand Down Expand Up @@ -122,7 +122,7 @@ export interface AppToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
onPressLeftSidebarToggle(): void;
onPressRightSidebarToggle(): void;
onPressNotification(): void;
databaseMenu?: React.FC;
workspacesMenu?: React.FC;
notificationPopover?: React.FC;
presenceDetails?: React.FC;
}
Expand Down Expand Up @@ -178,7 +178,7 @@ export const AppToolbar = (props: AppToolbarProps): React.ReactElement => {
onPressMinimize: handlePressMinimize,
onPressMaximizeRestore: handlePressMaximizeRestore,
onPressClose: handlePressClose,
databaseMenu,
workspacesMenu,
notificationPopover,
currentPageTitle,
presenceDetails,
Expand Down Expand Up @@ -206,7 +206,7 @@ export const AppToolbar = (props: AppToolbarProps): React.ReactElement => {
return () => scrollContainer.removeEventListener('scroll', handleScroll);
}, []);

// If the database color mode doesn't match
// If the workspace color mode doesn't match
// the chakra color mode, update the chakra color mode
React.useEffect(() => {
if (isThemeDark && colorMode !== 'dark') {
Expand Down Expand Up @@ -300,7 +300,7 @@ export const AppToolbar = (props: AppToolbarProps): React.ReactElement => {
>
<MenuIcon />
</IconButton>
{databaseMenu}
{workspacesMenu}
</ToolbarButtonGroup>
{/* Right side */}
{isElectron && (
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/PresenceDetails/PresenceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const PresenceDetails = withErrorBoundary((props: PresenceDetailsProps) =
{hostAddress && (
<>
<MenuItem onClick={() => handleCopyHostAddress(hostAddress)}>
Copy link to database
Copy link to workspace
</MenuItem>
{handleCopyPermalink && <MenuItem onClick={() => handleCopyPermalink()}>
Copy link to page
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/utils/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type HostAddress = string;
/**
* A knowledge graph
*/
type Database = {
type Workspace = {
id: string;
name: string;
isRemote: boolean;
Expand Down
38 changes: 19 additions & 19 deletions src/js/components/utils/useAppState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@ const mockData = {
export const useAppState = () => {

// Session
const [ currentUser, setCurrentUser ] = React.useState<Person | null>(mockData.currentUser);
const [ hostAddress, setHostAddress ] = React.useState<string | null>(mockData.hostAddress);
const [ currentPageMembers, setCurrentPageMembers ] = React.useState<PersonPresence[]>(mockData.currentPageMembers);
const [ differentPageMembers, setDifferentPageMembers ] = React.useState<PersonPresence[]>(mockData.differentPageMembers);
const [currentUser, setCurrentUser] = React.useState<Person | null>(mockData.currentUser);
const [hostAddress, setHostAddress] = React.useState<string | null>(mockData.hostAddress);
const [currentPageMembers, setCurrentPageMembers] = React.useState<PersonPresence[]>(mockData.currentPageMembers);
const [differentPageMembers, setDifferentPageMembers] = React.useState<PersonPresence[]>(mockData.differentPageMembers);

// Preferences
const [ isThemeDark, setIsThemeDark ] = React.useState<boolean>(false);
const [isThemeDark, setIsThemeDark] = React.useState<boolean>(false);

// App properties
const [ route, setRoute ] = React.useState<string>('');
const [ isOnline, setIsOnline ] = React.useState<boolean>(false);
const [route, setRoute] = React.useState<string>('');
const [isOnline, setIsOnline] = React.useState<boolean>(false);

// Window properties
const [ isWinFullscreen, setIsWinFullscreen ] = React.useState<boolean>(false);
const [ isWinFocused, setIsWinFocused ] = React.useState<boolean>(true);
const [ isWinMaximized, setIsWinMaximized ] = React.useState<boolean>(false);
const [ isElectron, setIsElectron ] = React.useState<boolean>(true);
const [isWinFullscreen, setIsWinFullscreen] = React.useState<boolean>(false);
const [isWinFocused, setIsWinFocused] = React.useState<boolean>(true);
const [isWinMaximized, setIsWinMaximized] = React.useState<boolean>(false);
const [isElectron, setIsElectron] = React.useState<boolean>(true);

// Layout components
const [ isLeftSidebarOpen, setIsLeftSidebarOpen ] = React.useState<boolean>(false);
const [ isRightSidebarOpen, setIsRightSidebarOpen ] = React.useState<boolean>(false);
const [ isCommandBarOpen, setIsCommandBarOpen ] = React.useState<boolean>(false);
const [isLeftSidebarOpen, setIsLeftSidebarOpen] = React.useState<boolean>(false);
const [isRightSidebarOpen, setIsRightSidebarOpen] = React.useState<boolean>(false);
const [isCommandBarOpen, setIsCommandBarOpen] = React.useState<boolean>(false);

// Dialogs and Workflows
const [ isMergeDialogOpen, setIsMergeDialogOpen ] = React.useState<boolean>(false);
const [ isDatabaseDialogOpen, setIsDatabaseDialogOpen ] = React.useState<boolean>(false);
const [ isSettingsOpen, setIsSettingsOpen ] = React.useState<boolean>(false);
const [isMergeDialogOpen, setIsMergeDialogOpen] = React.useState<boolean>(false);
const [isWorkspaceDialogOpen, setIsWorkspaceDialogOpen] = React.useState<boolean>(false);
const [isSettingsOpen, setIsSettingsOpen] = React.useState<boolean>(false);

return {
currentUser,
Expand Down Expand Up @@ -77,7 +77,7 @@ export const useAppState = () => {
setIsCommandBarOpen,
isMergeDialogOpen,
setIsMergeDialogOpen,
isDatabaseDialogOpen,
setIsDatabaseDialogOpen,
isWorkspaceDialogOpen,
setIsWorkspaceDialogOpen,
}
}
2 changes: 1 addition & 1 deletion test/athens/db_test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


(deftest search-in-node-title-test
;; Given that database contains nodes with titles node-titles and we search
;; Given that workspace contains nodes with titles node-titles and we search
;; for query, check that expected-titles were returned by the search.
(are [node-titles query expected-titles]
(with-redefs
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export const isMac = process.platform === "darwin";
export const createLocalAthensDB = async (page: Page, dbName: string) => {
// click db picker
await page.click('button:nth-child(1)');
// click "Add Database"
await page.click('button:has-text("Add Database")');
// click "Add Workspace"
await page.click('button:has-text("Add Workspace")');

// click "New"
await page.click('button:has-text("New")');

// Click [placeholder="DB Name"]
await page.click('[placeholder="DB Name"]');
// Click [placeholder="Workspace name"]
await page.click('[placeholder="Workspace name"]');

// Fill [placeholder="DB Name"]
await page.fill('[placeholder="DB Name"]', dbName);
// Fill [placeholder="Workspace name"]
await page.fill('[placeholder="Workspace name"]', dbName);

const [fileChooser] = await Promise.all([
// TODO this is broken in Playwright for electron, no fix in sight
Expand Down