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

Improving UX by hiding editing buttons for readers of a project #3682

Merged
merged 23 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
36b2f39
wip - reader and guests cant edit
VitorVieiraZ Nov 18, 2024
8ecf262
in progress
VitorVieiraZ Nov 21, 2024
b3ded65
in progress
VitorVieiraZ Nov 22, 2024
5da5eca
updating project role on opening a project from active project and ch…
VitorVieiraZ Nov 27, 2024
7a01cc6
updating role every time we open a project + visibility condition on …
VitorVieiraZ Nov 28, 2024
eabfc85
in progress
VitorVieiraZ Dec 9, 2024
6596705
ensuring user role is cached/updated each time we open a project
VitorVieiraZ Dec 10, 2024
8a92bff
cleaning code
VitorVieiraZ Dec 10, 2024
193574d
merging master to branch
VitorVieiraZ Dec 10, 2024
493bb18
Merge branch 'master' into enhancementUiUx/readerCantEdit
VitorVieiraZ Jan 10, 2025
4a6deda
post review changes
VitorVieiraZ Jan 13, 2025
e0f23b2
tests and removing truncate
VitorVieiraZ Jan 13, 2025
9cd5999
decoupling mergin api from activeProject and rebuilding connections
VitorVieiraZ Jan 15, 2025
713b347
final adjustments
VitorVieiraZ Jan 18, 2025
3b94135
Merge branch 'master' into enhancementUiUx/readerCantEdit
VitorVieiraZ Jan 18, 2025
48d244f
replaceValueInJson tests
VitorVieiraZ Jan 20, 2025
585412e
post review updates
VitorVieiraZ Jan 21, 2025
709b3fc
merging master
VitorVieiraZ Jan 21, 2025
97888cb
code layout adjustment
VitorVieiraZ Jan 21, 2025
8e4a046
small fix
VitorVieiraZ Jan 21, 2025
0b28d3b
include merginprojectmetadata in activeproject
VitorVieiraZ Jan 21, 2025
49b2a6a
updating tests
VitorVieiraZ Jan 22, 2025
721c762
fixing tests
VitorVieiraZ Jan 22, 2025
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
Prev Previous commit
Next Next commit
ensuring user role is cached/updated each time we open a project
VitorVieiraZ committed Dec 10, 2024
commit 6596705ed7b7b33cb5cd8182159fb5d4e5234c5d
10 changes: 7 additions & 3 deletions app/activeproject.cpp
Original file line number Diff line number Diff line change
@@ -113,9 +113,6 @@ bool ActiveProject::load( const QString &filePath )

bool ActiveProject::forceLoad( const QString &filePath, bool force )
{
// update user's role each time a project is opened, following #3174
mMerginApi->updateProjectMetadataRole( projectFullName() );

CoreUtils::log( QStringLiteral( "Project loading" ), filePath + " " + ( force ? "true" : "false" ) );

// clear autosync
@@ -204,6 +201,7 @@ bool ActiveProject::forceLoad( const QString &filePath, bool force )
updateRecordingLayers();
updateActiveLayer();
updateMapSettingsLayers();
updateUserRoleInActiveProject();

emit localProjectChanged( mLocalProject );
emit projectReloaded( mQgsProject );
@@ -588,3 +586,9 @@ void ActiveProject::setProjectRole( const QString &role )
emit projectRoleChanged();
}
}

void ActiveProject::updateUserRoleInActiveProject()
{
// update user's role each time a project is opened, following #3174
mMerginApi->updateProjectMetadataRole( projectFullName() );
}
5 changes: 5 additions & 0 deletions app/activeproject.h
Original file line number Diff line number Diff line change
@@ -128,6 +128,11 @@ class ActiveProject: public QObject

void setProjectRole( const QString &role );

/**
* Calls Mergin API to update current project’s role
*/
void updateUserRoleInActiveProject();

signals:
void qgsProjectChanged();
void localProjectChanged( LocalProject project );
4 changes: 2 additions & 2 deletions app/qml/project/MMProjectController.qml
Original file line number Diff line number Diff line change
@@ -48,10 +48,10 @@ Item {
function setupProjectOpen( projectPath ) {
if ( projectPath === __activeProject.localProject.qgisProjectFilePath )
{
// update user's role in project ( in case user has changed )
__activeProject.updateUserRoleInActiveProject()
// just hide the panel - project already loaded
hidePanel()
// update user's role in project ( in case user has changed )
__merginApi.updateProjectMetadataRole( __activeProject.projectFullName() )
}
else
{