You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org

Difference between revisions of "User:Pablo Grass (WMDE)/wikidata/data-bridge/sequence"

From Wikitech
Jump to navigation Jump to search
imported>Pablo Grass (WMDE)
m
imported>Pablo Grass (WMDE)
(illustrate link destruction on client permission problem, add purging and reloading after successful save)
 
Line 18: Line 18:
 
note over WP article: infobox
 
note over WP article: infobox
  
opt Javascript enabled
+
alt Javascript enabled
   opt client edit permissions
+
   alt client edit permissions
     Bridge->WP article: overload links\n(criteria T224832)
+
     Bridge->WP article: overload links
  note over WP article: infobox w/\nlinks on steroids
+
    note over WP article: infobox w/\nlinks on steroids
  end
+
 
end
+
    User->WP article: clicks link on steroids
  
User->WP article: clicks edit link
+
    WP article->Bridge: Params:\n- item id\n- property id\n- specific statement (day 2)\n- edit strategy?\n- user
 +
   
 +
    note over Bridge: opens with loading indicator\n(T232468)
 +
   
 +
    par in parallel
 +
      Bridge->WB API:request entity
 +
      WB API->Bridge:entity
 +
    else
 +
      Bridge->WB API:check repo edit permissions
 +
      WB API->Bridge:permission
 +
    end
  
alt Javascript enabled
+
    alt repo edit permissions
  WP article->Bridge: Params:\n- item id\n- property id\n- specific statement (day 2)\n- edit strategy?\n- user
+
      alt value is supported by bridge, property is elegible for bridge
  par in parallel
+
        note over Bridge: shows input field(s)
    Bridge->WB API:request entity
+
        User->Bridge: enters new value, clicks save
    WB API->Bridge:entity
+
       
  else
+
        note over Bridge: shows saving indicator
    Bridge->WB API:check repo edit permissions
 
    WB API->Bridge:permission
 
  end
 
  
  alt repo edit permissions
+
        Bridge->WB API: saves value
    alt value is supported by bridge, property is elegible for bridge
+
        Bridge->WP article: purge article cache
      note over Bridge: shows input field(s)
+
        Bridge->User: trigger reload
      User->Bridge: enters new value, clicks save
+
        User->WP article: sees update values
      Bridge->WB API: saves value
+
       
      WB API->Bridge: returns (formatted?) value
+
        note over User: bliss
      Bridge->WP article: updates infobox
+
       else
       note over WP article: updated infobox
+
        note over Bridge: displays error message + fallback link to wikidata
      WP article->User: bliss
+
        User->Bridge: clicks fallback link
 +
        User-->WB GUI: fall back to wikidata (bridge does not support this value type yet)
 +
      end
 
     else
 
     else
       note over Bridge: displays error message + fallback link to wikidata
+
       note over Bridge: display permission problem message
      User->Bridge: clicks fallback link
 
      User-->WB GUI: fall back to wikidata (bridge does not support this value type yet)
 
 
     end
 
     end
 
   else
 
   else
     note over Bridge: display permission message
+
     Bridge->WP article: destroy link
 
   end
 
   end
 
else
 
else
   User-->WB GUI: fall back to wikidata (no JS)
+
  User->WP article: clicks native link
 +
   User-->WB GUI: goes to wikidata
 
end
 
end
 +
 
</pre>
 
</pre>

Latest revision as of 18:43, 10 October 2019

Compatible with:

title Wikidata Bridge

actor User
participantgroup **Client (wikipedia)**
  participant WP article
  participant Bridge
end
participantgroup **Repo (wikidata)**
  participant WB API
  participant WB GUI
end

User->WP article: reads
note over WP article: infobox

alt Javascript enabled
  alt client edit permissions
    Bridge->WP article: overload links
    note over WP article: infobox w/\nlinks on steroids

    User->WP article: clicks link on steroids

    WP article->Bridge: Params:\n- item id\n- property id\n- specific statement (day 2)\n- edit strategy?\n- user
    
    note over Bridge: opens with loading indicator\n(T232468)
    
    par in parallel
      Bridge->WB API:request entity
      WB API->Bridge:entity
    else
      Bridge->WB API:check repo edit permissions
      WB API->Bridge:permission
    end

    alt repo edit permissions
      alt value is supported by bridge, property is elegible for bridge
        note over Bridge: shows input field(s)
        User->Bridge: enters new value, clicks save
        
        note over Bridge: shows saving indicator

        Bridge->WB API: saves value
        Bridge->WP article: purge article cache
        Bridge->User: trigger reload
        User->WP article: sees update values
        
        note over User: bliss
      else
        note over Bridge: displays error message + fallback link to wikidata
        User->Bridge: clicks fallback link
        User-->WB GUI: fall back to wikidata (bridge does not support this value type yet)
      end
    else
      note over Bridge: display permission problem message
    end
  else
    Bridge->WP article: destroy link
  end
else
  User->WP article: clicks native link
  User-->WB GUI: goes to wikidata
end