pptb-standard-sample-tool 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -143,7 +143,6 @@ function setupEventHandlers() {
143
143
  // Settings buttons
144
144
  document.getElementById('load-setting-btn')?.addEventListener('click', loadToolSetting);
145
145
  document.getElementById('save-setting-btn')?.addEventListener('click', saveToolSetting);
146
- document.getElementById('clear-setting-btn')?.addEventListener('click', clearToolSetting);
147
146
  }
148
147
  /**
149
148
  * Show notification
@@ -547,7 +546,7 @@ async function getSetting(key) {
547
546
  try {
548
547
  // Tool settings are scoped to the tool; implementation provided by the host app
549
548
  // API shape (based on docs): toolbox.settings.get(key)
550
- const value = await toolbox.settings?.get?.(key);
549
+ const value = await toolbox.settings?.getSettings?.(key);
551
550
  return value;
552
551
  }
553
552
  catch (error) {
@@ -557,28 +556,13 @@ async function getSetting(key) {
557
556
  }
558
557
  async function setSetting(key, value) {
559
558
  try {
560
- await toolbox.settings?.set?.(key, value);
559
+ await toolbox.settings?.setSetting?.(key, value);
561
560
  }
562
561
  catch (error) {
563
562
  log(`Error saving setting: ${error.message}`, 'error');
564
563
  throw error;
565
564
  }
566
565
  }
567
- async function deleteSetting(key) {
568
- try {
569
- if (toolbox.settings?.delete) {
570
- await toolbox.settings.delete(key);
571
- }
572
- else if (toolbox.settings?.set) {
573
- // Fallback to setting undefined/null if delete not available
574
- await toolbox.settings.set(key, undefined);
575
- }
576
- }
577
- catch (error) {
578
- log(`Error clearing setting: ${error.message}`, 'error');
579
- throw error;
580
- }
581
- }
582
566
  async function loadToolSetting() {
583
567
  const textarea = document.getElementById('settings-fetchxml');
584
568
  const output = document.getElementById('settings-output');
@@ -616,24 +600,6 @@ async function saveToolSetting() {
616
600
  await showNotification('Save Failed', error.message, 'error');
617
601
  }
618
602
  }
619
- async function clearToolSetting() {
620
- const output = document.getElementById('settings-output');
621
- try {
622
- await deleteSetting(SETTINGS_KEY);
623
- const textarea = document.getElementById('settings-fetchxml');
624
- if (textarea)
625
- textarea.value = '';
626
- if (output)
627
- output.textContent = 'Cleared saved FetchXML.';
628
- await showNotification('Setting Cleared', 'Saved FetchXML removed.', 'success');
629
- log('Cleared tool setting', 'success');
630
- }
631
- catch (error) {
632
- if (output)
633
- output.textContent = `Error clearing setting: ${error.message}`;
634
- await showNotification('Clear Failed', error.message, 'error');
635
- }
636
- }
637
603
  /**
638
604
  * Demonstrate executeParallel utility by performing three Dataverse operations in parallel.
639
605
  * Falls back gracefully if no connection is available.
package/dist/index.html CHANGED
@@ -79,7 +79,6 @@
79
79
  <div class="button-group">
80
80
  <button id="load-setting-btn" class="btn">Load Setting</button>
81
81
  <button id="save-setting-btn" class="btn btn-primary">Save Setting</button>
82
- <button id="clear-setting-btn" class="btn btn-error">Clear Setting</button>
83
82
  </div>
84
83
  <div id="settings-output" class="output"></div>
85
84
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pptb-standard-sample-tool",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "displayName": "HTML Sample Tool",
5
5
  "description": "A sample Power Platform Tool Box tool built with HTML, CSS, and TypeScript",
6
6
  "main": "index.html",