Skip to content

Issue #7225: Made repository URL not a link for student assignment view#7807

Open
Karl-Michaud wants to merge 10 commits intoMarkUsProject:masterfrom
Karl-Michaud:issue-7225
Open

Issue #7225: Made repository URL not a link for student assignment view#7807
Karl-Michaud wants to merge 10 commits intoMarkUsProject:masterfrom
Karl-Michaud:issue-7225

Conversation

@Karl-Michaud
Copy link
Contributor

@Karl-Michaud Karl-Michaud commented Jan 31, 2026

Proposed Changes

This PR addresses issue #7225. Specifically, this PR makes the repository URL not a link for student assignment view.


Problem

See link

<% if allowed_to?(:access_repo?, @grouping) %>
      <h3><%= t('groups.student_interface.url_repository') %></h3>
      <div class='sub_block'>
        HTTPS: <a href='#'><%= @grouping.group.repository_external_access_url %></a>  # Problem 1
        <% if allowed_to?(:view?, with: KeyPairPolicy) %>
          <br>
          SSH: <a href='#'><%= @grouping.group.repository_ssh_access_url %></a>  # Problem 2
        <% end %>
      </div>
<% end %>
Before Changes
Screen.Recording.2026-01-31.at.6.08.30.PM.mov
After Changes (updated)
Screen.Recording.2026-02-02.at.5.11.14.PM.mov

Additional additions

As requested, I've added "copy" buttons to easily copy the specific URL.

On top of that, I've taken the liberty to add a "Successfully copied to clipboard." notification to the top of the page. This change can be easily reverted if necessary.

Notification showcase Screenshot 2026-02-02 at 5 12 43 PM

Note: The copy notification banner is implemented by directly manipulating the flash message DOM element, rather than using Rails server-side flash_message helper, because it is handled entirely client-side with navigator.clipboard (does not involve a server request or page reload).

Final notes

  1. No tests were added since there are no existing view or system tests for this page. Furthermore, the copy button relies on navigator.clipboard, which would require Capybara (seems to be included in the gemfile) to test. This would be outside the scope of this task.

Would love to get feedback on this ^^ :0

  1. The flash message string is defined as an i18n key in config/locales/views/groups/en.yml under student_interface, since that's where the other keys used by the repository URL section are located.

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

@Karl-Michaud Karl-Michaud changed the title Issue #7225: Made repository URL not be a link for student assignment view Issue #7225: Made repository URL not a link for student assignment view Jan 31, 2026
@david-yz-liu
Copy link
Collaborator

Hi @Karl-Michaud, yes you can add a "Copy" button. Take a look at what we're doing to support text file copying in the TextViewer component. I'm also good if you want to add the "copy" icon from FontAwesome.

@Karl-Michaud Karl-Michaud marked this pull request as ready for review February 2, 2026 22:47
@coveralls
Copy link
Collaborator

coveralls commented Feb 2, 2026

Pull Request Test Coverage Report for Build 21699486524

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.683%

Totals Coverage Status
Change from base Build 21688899174: 0.0%
Covered Lines: 44519
Relevant Lines: 47749

💛 - Coveralls

@Karl-Michaud
Copy link
Contributor Author

Hi @david-yz-liu,

Here is an updated screenshot of the page after changes. Notably, switching from <span> tags to <code> tags which changed the font of URL text.

Screenshot 2026-02-05 at 12 05 08 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants