 3e7f5fdd3f
			
		
	
	3e7f5fdd3f
	
	
	
		
			
			When legacy-data-mixin.html is imported this will tell you on the console which observers need fixing regarding this change of behavior: https://polymer-library.polymer-project.org/2.0/docs/upgrade#update-observers This change was created by running this command line: find polygerrit-ui/app/ -type f | xargs sed -i '/^ is: / a\ _legacyUndefinedCheck: true,' Once all observers are fixed, this change will be reverted. This is tracked in https://bugs.chromium.org/p/gerrit/issues/detail?id=10723 Change-Id: Icccdfaa52bf77dfb25e949b2aa2402110f6c2276
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <dom-module id="some-screen">
 | |
|   <script>
 | |
|     Gerrit.install(plugin => {
 | |
|       // Recommended approach for screen() API.
 | |
|       plugin.screen('main', 'some-screen-main');
 | |
| 
 | |
|       const mainUrl = plugin.screenUrl('main');
 | |
| 
 | |
|       // Support for deprecated screen API.
 | |
|       plugin.deprecated.screen('foo', ({token, body, show}) => {
 | |
|         body.innerHTML = `This is a plugin screen at ${token}<br/>` +
 | |
|             `<a href="${mainUrl}">Go to main plugin screen</a>`;
 | |
|         show();
 | |
|       });
 | |
| 
 | |
|       // Quick and dirty way to get something on screen.
 | |
|       plugin.screen('bar').onAttached(el => {
 | |
|         el.innerHTML = `This is a plugin screen at ${el.token}<br/>` +
 | |
|             `<a href="${mainUrl}">Go to main plugin screen</a>`;
 | |
|       });
 | |
| 
 | |
|       // Add a "Plugin screen" link to the change view screen.
 | |
|       plugin.hook('change-metadata-item').onAttached(el => {
 | |
|         el.innerHTML = `<a href="${mainUrl}">Plugin screen</a>`;
 | |
|       });
 | |
|     });
 | |
|   </script>
 | |
| </dom-module>
 | |
| 
 | |
| <dom-module id="some-screen-main">
 | |
|   <template>
 | |
|     This is the <b>main</b> plugin screen at [[token]]
 | |
|     <ul>
 | |
|       <li><a href$="[[rootUrl]]/foo">via deprecated</a></li>
 | |
|       <li><a href$="[[rootUrl]]/bar">without component</a></li>
 | |
|     </ul>
 | |
|   </template>
 | |
|   <script>
 | |
|     Polymer({
 | |
|       is: 'some-screen-main',
 | |
|       _legacyUndefinedCheck: true,
 | |
|       properties: {
 | |
|         rootUrl: String,
 | |
|       },
 | |
|       attached() {
 | |
|         this.rootUrl = `${this.plugin.screenUrl()}`;
 | |
|       },
 | |
|     });
 | |
|   </script>
 | |
| </dom-module>
 |