Skip to content

Commit

Permalink
Merge pull request #68 from pnp/v7.0.2
Browse files Browse the repository at this point in the history
3 new quick links
  • Loading branch information
tavikukko authored Sep 18, 2024
2 parents c56c2f0 + 9133cd4 commit 27e078e
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 24 deletions.
18 changes: 10 additions & 8 deletions iframe-sandbox-app/src/mgtiframe/MGTIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ const MGTIframe = () => {
if (data.code) {
setCode(data.code);
}
console.log('onMessageReceivedFromIframe', event.data);
//console.log('onMessageReceivedFromIframe', event.data);
}, []);

useEffect(() => {
window.addEventListener('message', onMessageReceivedFromIframe);
console.log('registered listener');
return () => console.log('removing listener, but not');
// window.removeEventListener("message", onMessageReceivedFromIframe);
//console.log('registered listener');
return () => {
//console.log('removing listener, but not');
// window.removeEventListener("message", onMessageReceivedFromIframe);
};
}, [onMessageReceivedFromIframe]);

React.useEffect(function setupListener() {
function handleResize(x: any) {
console.log('theme changed', x.detail);
//console.log('theme changed', x.detail);
if (x.detail) {
document.body.style.backgroundColor = 'black';
} else {
Expand All @@ -47,7 +49,7 @@ const MGTIframe = () => {
window.addEventListener('darkmodechanged', handleResize);

return function cleanupListener() {
console.log('removing listener');
//console.log('removing listener');
window.removeEventListener('darkmodechanged', handleResize);
};

Expand All @@ -57,7 +59,7 @@ const MGTIframe = () => {

var getAccessToken = async (scopes: any[]): Promise<string> => {
return new Promise(function (resolve) {
console.log('getting token for scopes', scopes);
//console.log('getting token for scopes', scopes);

window.parent.postMessage(
JSON.stringify({
Expand All @@ -68,7 +70,7 @@ const MGTIframe = () => {

window.addEventListener('message', function dataReady(event) {
let data = JSON.parse(event.data);
console.log('got token from parent', data);
//console.log('got token from parent', data);
if (data.token) {
Providers.globalProvider.setState(ProviderState.SignedIn);
resolve(data.token);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sp-editor",
"version": "7.0.1",
"version": "7.0.2",
"private": true,
"homepage": ".",
"dependencies": {
Expand Down
3 changes: 1 addition & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SP Editor",
"homepage_url": "https://microsoftedge.microsoft.com/addons/detail/affnnhcbfmcbbdlcadgkdbfafigmjdkk",
"version": "7.0.1",
"version": "7.0.2",
"description": "Create and update SharePoint Online/SP2013/SP2016/SP2019 css/js files, inject files to web, manage web/list properties, list Webhook",
"manifest_version": 3,
"devtools_page": "devtools.html",
Expand Down Expand Up @@ -37,7 +37,6 @@
"bundles/msaljsclient.es5.umd.bundle.js",
"bundles/sp-scriptlinks.sppkg",
"bundles/graph-sdk.es5.umd.bundle.js",
"bundles/msal.js",
"bundles/msal-browser.js",
"index.html"
],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/graphsdkconsole/components/graphsdkeditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const GraphSDKEditor = () => {
chrome.devtools.inspectedWindow.eval(script.replace(/TOKENHERE/g, response.accessToken))
}
} catch (e) {
console.log(e)
//console.log(e)
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/mgtconsole/components/mgteditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const MGTEditor = () => {
);
}
} catch (e) {
console.log(e);
//console.log(e);
}
}, [dispatch]);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/pnpjsconsole/components/pnpjseditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const PnPjsEditor = () => {
setTimeout(() => { dispatch(setLoading(false)) }, 1200)

} catch (e) {
console.log(e)
//console.log(e)
}

})
Expand Down
2 changes: 1 addition & 1 deletion src/pages/search/components/commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const SearchCommands = () => {
dispatch(setSearchResults(items, groups, res));
}
} else {
console.log('Injection failed: ', injectionResults);
//console.log('Injection failed: ', injectionResults);
}
dispatch(rootActions.setLoading(false));
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/search/components/searchqueryform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const SearchQueryForm = () => {
defaultSelectedKey={sourceIds.find((item) => item.key === searchQuery.SourceId)?.key ?? null}
allowFreeform
onChange={(event, option?: any, index?: any, value?: any) => {
console.log(option, index, value);
//console.log(option, index, value);
dispatch(
setSearchQuery({
...searchQuery,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/search/components/searchresults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const SearchResults = () => {
dispatch(setSearchResults(newItems2, newGroups, searchResults));
dispatch(rootActions.setLoading(false));
} else {
console.log('Injection failed: ', injectionResults);
//console.log('Injection failed: ', injectionResults);
dispatch(rootActions.setLoading(false));
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/spshooter/chrome/shoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const shoot = (payload: any, extPath: string) => {
});
} else {
// not an HttpRequestError so we just log message
console.log(error);
//console.log(error);
}
return {
success: false,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/webproperties/chrome/getwebproperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const getWebProperties = (extPath: string) => {
});
} else {
// not an HttpRequestError so we just log message
console.log(error);
//console.log(error);
}
return {
success: false,
Expand Down
2 changes: 1 addition & 1 deletion src/popup/Components/ChangePageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ChangePageLayout = ({ plo, tabId, ctx }: IQuickLinkListProps) => {
args: [ctx.webAbsoluteUrl, ctx.serverRequestPath, selected],
func: updatePageLayout,
}).then(injectionResults => {
console.log(injectionResults);
//console.log(injectionResults);
setShowSuccess(true);
})}
text="Save"
Expand Down
2 changes: 1 addition & 1 deletion src/popup/Components/LoadTeamsDebug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const LoadTeamsDebug = ({ tabId }: any) => {
func: loadTeamsDebugScript,
})
.then((injectionResults) => {
console.log(injectionResults);
//console.log(injectionResults);
})
}
/>
Expand Down
31 changes: 31 additions & 0 deletions src/popup/Components/QuickLinkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ const QuickLinkList = ({ ctx, appCatalogUrl, tabUrl }: IQuickLinkListProps) => {
'/_layouts/15/searchadmin/TA_SearchAdministration.aspx'
}
/>
<QuickLinkButton
text={'API access'}
iconName={'AzureAPIManagement'}
disabled={!ctx || !ctx.portalUrl}
url={
ctx.isSPO &&
ctx.portalUrl.toLocaleLowerCase().replace('.sharepoint.', '-admin.sharepoint.') +
'/_layouts/15/online/AdminHome.aspx#/webApiPermissionManagement'
}
/>
<QuickLinkButton
text={'Teams admin'}
iconName={'TeamsLogo'}
disabled={false}
url={'https://admin.teams.microsoft.com/dashboard'}
/>
<QuickLinkButton
text={'App catalog'}
iconName={'AppIconDefaultList'}
Expand All @@ -123,6 +139,21 @@ const QuickLinkList = ({ ctx, appCatalogUrl, tabUrl }: IQuickLinkListProps) => {
disabled={!ctx || !ctx.webAbsoluteUrl}
url={ctx.webAbsoluteUrl + '/_layouts/15/settings.aspx'}
/>
<QuickLinkButton
text={'Tenant site settings'}
iconName={'Settings'}
disabled={!ctx || !ctx.webAbsoluteUrl}
url={
ctx.isSPO
? ctx.portalUrl &&
ctx.portalUrl.toLocaleLowerCase().replace('.sharepoint.', '-admin.sharepoint.') +
`/_layouts/15/online/AdminHome.aspx#/siteManagement/:/SiteDetails/${ctx.siteId.replace(
/[{}]/g,
''
)}/Settings`
: null
}
/>
<QuickLinkButton
text={'Site contents'}
iconName={'ThumbnailView'}
Expand Down
2 changes: 1 addition & 1 deletion src/services/graph-client/graph-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class GraphClient {
return response.accessToken;
}
catch {
console.log('Something went wrong getting accesstoken')
//console.log('Something went wrong getting accesstoken')
}
},
},
Expand Down

0 comments on commit 27e078e

Please sign in to comment.