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

fix(files): edit locally buttons and description #49150

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Nov 8, 2024

Fix #48972
Fix #49034

  • Fixed button trigger
  • Fixed icons
  • Improved modal paragraph

The file should now open on your device. If it doesn't, please check that you have the desktop app installed.

image

@skjnldsv skjnldsv added this to the Nextcloud 31 milestone Nov 8, 2024
@skjnldsv skjnldsv self-assigned this Nov 8, 2024
@skjnldsv skjnldsv requested review from susnux and sorbaugh and removed request for a team November 8, 2024 10:48
@skjnldsv

This comment was marked as outdated.

@skjnldsv

This comment was marked as outdated.

@skjnldsv

This comment was marked as outdated.

@skjnldsv skjnldsv changed the title fix(files): edit locally buttons fix(files): edit locally buttons and description Nov 8, 2024
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 8, 2024
@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 8, 2024

/backport 33a399f to stable28

@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 8, 2024

/backport 33a399f to stable29

@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 8, 2024

/backport 33a399f to stable30

@skjnldsv skjnldsv merged commit 3eadae3 into master Nov 8, 2024
116 of 118 checks passed
@skjnldsv skjnldsv deleted the fix/edit-locally-labels branch November 8, 2024 16:17
@ne0YT
Copy link

ne0YT commented Nov 8, 2024

can you create an option to disable the dialog completely?

@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 8, 2024

@ne0YT unfortunately no, that was not part of the goal.
We refrain from adding toggles for newly added features, otherwise it's unmaintainable :)

@ne0YT
Copy link

ne0YT commented Nov 8, 2024

@skjnldsv maybe you can tell me how I could get rid of it using injected js?

@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 8, 2024

You cannot, our js is compiled and not possible to edit.
The only thing I could think of is with ublock origin: ##h2:has-text('Edit file locally'):upward(div[role=dialog])

But this might not work in the long run 🤔 Use it at your own risk

@ne0YT
Copy link

ne0YT commented Nov 8, 2024

You cannot, our js is compiled and not possible to edit. The only thing I could think of is with ublock origin: ##h2:has-text('Edit file locally'):upward(div[role=dialog])

But this might not work in the long run 🤔 Use it at your own risk

is there some similar code I could use when I load my own js changing it? I injected a dialog to test that), but I'm not getting how to hide this element.

@skjnldsv
Copy link
Member Author

skjnldsv commented Nov 9, 2024

Careful, you will hide ALL modals or dialogs with that 🫣

@ne0YT
Copy link

ne0YT commented Nov 9, 2024

corrected script to hide the dialog:

// Function to hide specific elements based on exact class combinations
function hideSpecificElements() {
    const elementsToHide = document.querySelectorAll(
        '.modal-wrapper--small.modal-wrapper, .dialog__modal.modal-mask'
    );
    elementsToHide.forEach(el => {
        if (el) {
            el.style.cssText = `
                display: none !important;
                visibility: hidden !important;
                opacity: 0 !important;
                pointer-events: none !important;
            `;
        }
    });
}

// Create observer to watch for new elements
const observer = new MutationObserver((mutations) => {
    hideSpecificElements(); // Hide elements if they appear dynamically
});

// Start observing the entire document for changes
observer.observe(document.documentElement, {
    childList: true,
    subtree: true
});

// Initial hide on load
window.addEventListener('load', function() {
    hideSpecificElements(); // Initial hide
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong text for buttons on confirm local edit dialog [Bug]: "edit locally" Dialog makes no sense
4 participants