Skip to content

Wiki比較パネルの初期表示不一致を修正 - #17

Open
NishikawaKoharu wants to merge 1 commit into
RCOSDP:developfrom
NishikawaKoharu:feature/fix-wiki-compare-default-current
Open

NishikawaKoharu wants to merge 1 commit into
RCOSDP:developfrom
NishikawaKoharu:feature/fix-wiki-compare-default-current

Conversation

@NishikawaKoharu

Copy link
Copy Markdown
Contributor

Purpose

Fix a Wiki Compare frontend bug: opening Compare shows "(Current)" in the compare dropdown, but the actual diff is against the previous version. Selecting the previous version does not change the diff; selecting "(Current)" again is required before the comparison matches the label.

Server-side default changes, remapping, and tests must be landed together with the RDM-osf.io companion PR (feature/fix-wiki-compare-default-current).

Changes

  • Keep updating displaySource from live edits even while Compare is closed (so opening Compare diffs against unsaved edits)
  • Change Compare default from previous to current
  • Add resolveCompareVersion() to normalize previous / empty values to the real dropdown value

Changed files:

  • addons/wiki/static/wikiPageMilkdown.js
  • website/static/js/pages/wiki-edit-page.js

QA Notes

  • Does this change require a data migration? If so, what data will we migrate?
    • No.
  • What is the level of risk?
    • Low to medium. Limited to Wiki Milkdown edit UI (Compare).
    • Any permissions code touched?
      • No.
    • Is this an additive or subtractive change, other?
      • Behavioral fix (existing Compare bug).
  • How can QA verify? (Through UI, API, AdminApp or AdminAdminApp?)
    • Through UI — Wiki edit page with 2+ versions.
      (Verify together with the RDM-osf.io companion PR.)
    1. Open Compare: dropdown shows "(Current)" and the diff is against the current saved version
    2. Change compare target to the previous version → diff changes; select "(Current)" again → returns to the previous state
  • What features or workflows might this change impact?
    • Wiki Compare panel initial selection and diff display
  • How will this impact performance?
    • Negligible.

Documentation

  • No documentation updates required.

Side Effects

  • Compare initially targets Current (the previous "one version back" behavior is still available by explicit dropdown selection).

Ticket

https://redmine.devops.rcos.nii.ac.jp/issues/63974

@yacchin1205 yacchin1205 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントさせていただきました。ご確認ください。

if (compareVersion !== 'previous') {
return String(compareVersion);
}
var select = document.getElementById('compareVersionSelect');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revious を指定しても、対応する選択肢を取得できなかった場合は、黙って current に切り替わる点が気になりました。というのと、 RCOSDP/RDM-osf.io#827 と同じ指摘をしているのですが、二重管理になっていませんでしょうか。両リポジトリの役割と、修正を同期する方針を確認させてください。

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.

2 participants