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

No workspace banner #3101

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
14 changes: 14 additions & 0 deletions app/images/NoWorkspace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
<file>SyncFailed.svg</file>
<file>NoPermissions.svg</file>
<file>SignIn.svg</file>
<file>NoWorkspace.svg</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions app/mmstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ class MMStyle: public QObject
Q_PROPERTY( QUrl crosshairCircleImage READ crosshairCircleImage CONSTANT )
Q_PROPERTY( QUrl crosshairForegroundImage READ crosshairForegroundImage CONSTANT )
Q_PROPERTY( QUrl crosshairPlusImage READ crosshairPlusImage CONSTANT )
Q_PROPERTY( QUrl noWorkspaceImage READ noWorkspaceImage CONSTANT )


/*
* Pixel sizes used across the app
Expand Down Expand Up @@ -448,6 +450,7 @@ class MMStyle: public QObject
QUrl crosshairCircleImage() {return QUrl( "qrc:/images/CrosshairCircle.svg" );}
QUrl crosshairForegroundImage() {return QUrl( "qrc:/images/CrosshairForeground.svg" );}
QUrl crosshairPlusImage() {return QUrl( "qrc:/images/CrosshairPlus.svg" );}
QUrl noWorkspaceImage() {return QUrl( "qrc:/images/NoWorkspace.svg" );}

static QUrl lineLayerImage() {return QUrl( "qrc:/images/mIconLineLayer.svg" );}
static QUrl pointLayerImage() {return QUrl( "qrc:/images/mIconPointLayer.svg" );}
Expand Down
1 change: 0 additions & 1 deletion app/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(MM_QML
InputStyle.qml
Notification.qml
NotificationBanner.qml
misc/NoWorkspaceBanner.qml
account/MMAcountPage.qml
account/MMAcountPageItem.qml
account/MMSwitchWorkspacePage.qml
Expand Down
1 change: 1 addition & 0 deletions app/qml/components/MMWarningBubble.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Item {

required property string title
property string description
property alias imageSource: icon.source

signal clicked

Expand Down
1 change: 0 additions & 1 deletion app/qml/gps/MMBluetoothConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ Drawer {

MMBusyIndicator {
id: loadingSpinner
size: parent.height / 2
anchors.centerIn: parent
running: rootstate.state === "working"
}
Expand Down
1 change: 0 additions & 1 deletion app/qml/layers/MMFeaturesListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Page {

MMBusyIndicator {
id: busyIndicator
size: parent.width/8
running: featuresModel.fetchingResults
anchors.centerIn: parent
}
Expand Down
1 change: 0 additions & 1 deletion app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import "./map"
import "./dialogs"
import "./layers"
import "./components"
import "./misc"
import "./project"
import "./settings"
import "./gps"
Expand Down
39 changes: 0 additions & 39 deletions app/qml/misc/NoWorkspaceBanner.qml

This file was deleted.

31 changes: 25 additions & 6 deletions app/qml/project/MMProjectHomePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ import QtQuick
import mm 1.0 as MM

import "../components"
import "../misc"
import "../inputs"

Item {
id: root

property string activeProjectId: ""
property alias list: projectlist
property alias noWorkspaceBannerVisible: noWorkspaceBanner.visible

signal openProjectRequested( string projectFilePath )
signal showLocalChangesRequested( string projectId )
signal createWorkspaceRequested()

function refreshProjectsList() {
searchBar.deactivate()
Expand Down Expand Up @@ -50,20 +51,36 @@ Item {
}

MMWarningBubble {
id: warningBubble
visible: __merginApi.subscriptionInfo ? __merginApi.subscriptionInfo.actionRequired : false
id: attentionRequiredBanner
visible: !noWorkspaceBanner.visible && (__merginApi.subscriptionInfo ? __merginApi.subscriptionInfo.actionRequired : false)
width: root.width - 2 * root.hPadding
anchors {
top: searchBar.bottom
left: parent.left
right: parent.right
topMargin: root.spacing
}
title: qsTr("Your attention is required.")
title: qsTr("Your attention is required")
description: qsTr("Click here to visit Mergin Maps dashboard")
onClicked: Qt.openUrlExternally( __inputHelp.merginDashboardLink )
}

MMWarningBubble {
id: noWorkspaceBanner
PeterPetrik marked this conversation as resolved.
Show resolved Hide resolved
visible: false // Set from parent
width: root.width - 2 * root.hPadding
anchors {
top: searchBar.bottom
left: parent.left
right: parent.right
topMargin: root.spacing
}
title: qsTr("No workspace detected")
description: qsTr("Create your workspace by clicking here")
imageSource: __style.noWorkspaceImage
onClicked: root.createWorkspaceRequested()
}

Component {
id: activeProjectComponent

Expand Down Expand Up @@ -161,8 +178,10 @@ Item {
left: parent.left
right: parent.right
top: {
if( warningBubble.visible )
return warningBubble.bottom
if( attentionRequiredBanner.visible )
return attentionRequiredBanner.bottom
if( noWorkspaceBanner.visible )
return noWorkspaceBanner.bottom
return searchBar.bottom
}
bottom: parent.bottom
Expand Down
1 change: 0 additions & 1 deletion app/qml/project/MMProjectList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ Item {
MMBusyIndicator {
x: parent.width / 2 - width / 2
running: controllerModel.isLoading
size: __style.row63
}
}

Expand Down
1 change: 0 additions & 1 deletion app/qml/project/MMProjectListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import QtQuick
import mm 1.0 as MM

import "../components"
import "../misc"
import "../inputs"

Item {
Expand Down
49 changes: 19 additions & 30 deletions app/qml/project/MMProjectPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import QtQuick.Dialogs

import mm 1.0 as MM

import "../misc"
import "../components"
import "../onboarding"
import "../inputs"
Expand Down Expand Up @@ -88,40 +87,13 @@ Item {
stackView.focus = true
}

NoWorkspaceBanner {
id: noWorkspaceBanner
visible: {
if ( !__merginApi.apiSupportsWorkspaces ) {
return false;
}
if ( !__merginApi.userAuth.hasAuthData() ) {
return false;
}
// do not show the banner in case of accepting invitation or creating a workspace
if (onboardingController.inProgress) {
return false;
}
return !__merginApi.userInfo.hasWorkspaces
}
z: parent.z + 1
anchors {
top: parent.top
left: parent.left
right: parent.right
}

onCreateWorkspaceRequested: {
createWorkspaceController.createNewWorkspace()
}
}

StackView {
id: stackView

initialItem: workspaceProjectsPanelComp

anchors {
top: noWorkspaceBanner.visible ? noWorkspaceBanner.bottom : parent.top
top: parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
Expand Down Expand Up @@ -189,7 +161,6 @@ Item {

MMBusyIndicator {
id: busyIndicator
size: parent.width/8
running: stackView.pending
anchors.centerIn: parent
z: parent.z + 1
Expand Down Expand Up @@ -377,6 +348,24 @@ Item {
showChanges( projectId )
}
list.onActiveProjectDeleted: setupProjectOpen( "" )

noWorkspaceBannerVisible: {
if ( !__merginApi.apiSupportsWorkspaces ) {
return false;
}
if ( !__merginApi.userAuth.hasAuthData() ) {
return false;
}
// do not show the banner in case of accepting invitation or creating a workspace
if (onboardingController.inProgress) {
return false;
}
return !__merginApi.userInfo.hasWorkspaces
}

onCreateWorkspaceRequested: {
createWorkspaceController.createNewWorkspace()
}
}

MMProjectListPage {
Expand Down
1 change: 0 additions & 1 deletion app/qml/settings/MMSettingsController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import QtQuick.Layouts
import mm 1.0 as MM

import "../components"
import "../misc"
import "../gps"

Item {
Expand Down
1 change: 0 additions & 1 deletion app/qml/settings/MMSettingsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import mm 1.0 as MM

import "."
import "../components"
import "../misc"

Page {
id: root
Expand Down
1 change: 1 addition & 0 deletions gallery/qml/pages/ImagesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ ScrollView {
Column { Image { source: __style.warnLogoImage } Text { text: "warnLogoImage" } }
Column { Image { source: __style.attentionImage } Text { text: "attentionImage" } }
Column { Image { source: __style.bubbleImage } Text { text: "bubbleImage" } }
Column { Image { source: __style.noWorkspaceImage } Text { text: "noWorkspaceImage" } }
}
}

Expand Down
1 change: 0 additions & 1 deletion gallery/qml/pages/MiscPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ ScrollView {
anchors.fill: parent
MMBusyIndicator {
running: true
size: 55
}
}
}
Expand Down
Loading