билд успешен

This commit is contained in:
gorbenko.pavel
2026-07-28 18:00:40 +05:00
parent 9cb5080bf9
commit 486080b268
31 changed files with 1256 additions and 5 deletions
@@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var ReactDom = tslib_1.__importStar(require("react-dom"));
var sp_core_library_1 = require("@microsoft/sp-core-library");
var sp_property_pane_1 = require("@microsoft/sp-property-pane");
var sp_webpart_base_1 = require("@microsoft/sp-webpart-base");
var strings = tslib_1.__importStar(require("ApprovalAdminWebPartStrings"));
var ApprovalAdmin_1 = tslib_1.__importDefault(require("./components/ApprovalAdmin"));
var ApprovalAdminWebPart = /** @class */ (function (_super) {
tslib_1.__extends(ApprovalAdminWebPart, _super);
function ApprovalAdminWebPart() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._isDarkTheme = false;
_this._environmentMessage = '';
return _this;
}
ApprovalAdminWebPart.prototype.render = function () {
var element = React.createElement(ApprovalAdmin_1.default, {
description: this.properties.description,
isDarkTheme: this._isDarkTheme,
environmentMessage: this._environmentMessage,
hasTeamsContext: !!this.context.sdks.microsoftTeams,
userDisplayName: this.context.pageContext.user.displayName
});
ReactDom.render(element, this.domElement);
};
ApprovalAdminWebPart.prototype.onInit = function () {
var _this = this;
return this._getEnvironmentMessage().then(function (message) {
_this._environmentMessage = message;
});
};
ApprovalAdminWebPart.prototype._getEnvironmentMessage = function () {
var _this = this;
if (!!this.context.sdks.microsoftTeams) { // running in Teams, office.com or Outlook
return this.context.sdks.microsoftTeams.teamsJs.app.getContext()
.then(function (context) {
var environmentMessage = '';
switch (context.app.host.name) {
case 'Office': // running in Office
environmentMessage = _this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentOffice : strings.AppOfficeEnvironment;
break;
case 'Outlook': // running in Outlook
environmentMessage = _this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentOutlook : strings.AppOutlookEnvironment;
break;
case 'Teams': // running in Teams
case 'TeamsModern':
environmentMessage = _this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentTeams : strings.AppTeamsTabEnvironment;
break;
default:
environmentMessage = strings.UnknownEnvironment;
}
return environmentMessage;
});
}
return Promise.resolve(this.context.isServedFromLocalhost ? strings.AppLocalEnvironmentSharePoint : strings.AppSharePointEnvironment);
};
ApprovalAdminWebPart.prototype.onThemeChanged = function (currentTheme) {
if (!currentTheme) {
return;
}
this._isDarkTheme = !!currentTheme.isInverted;
var semanticColors = currentTheme.semanticColors;
if (semanticColors) {
this.domElement.style.setProperty('--bodyText', semanticColors.bodyText || null);
this.domElement.style.setProperty('--link', semanticColors.link || null);
this.domElement.style.setProperty('--linkHovered', semanticColors.linkHovered || null);
}
};
ApprovalAdminWebPart.prototype.onDispose = function () {
ReactDom.unmountComponentAtNode(this.domElement);
};
Object.defineProperty(ApprovalAdminWebPart.prototype, "dataVersion", {
get: function () {
return sp_core_library_1.Version.parse('1.0');
},
enumerable: false,
configurable: true
});
ApprovalAdminWebPart.prototype.getPropertyPaneConfiguration = function () {
return {
pages: [
{
header: {
description: strings.PropertyPaneDescription
},
groups: [
{
groupName: strings.BasicGroupName,
groupFields: [
(0, sp_property_pane_1.PropertyPaneTextField)('description', {
label: strings.DescriptionFieldLabel
})
]
}
]
}
]
};
};
return ApprovalAdminWebPart;
}(sp_webpart_base_1.BaseClientSideWebPart));
exports.default = ApprovalAdminWebPart;
//# sourceMappingURL=ApprovalAdminWebPart.js.map
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json",
"id": "4825e72c-4ff3-479e-917e-f6b04e003a82",
"alias": "ApprovalAdminWebPart",
"componentType": "WebPart",
// The "*" signifies that the version should be taken from the package.json
"version": "*",
"manifestVersion": 2,
// If true, the component can only be installed on sites where Custom Script is allowed.
// Components that allow authors to embed arbitrary script code should set this to true.
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
"requiresCustomScript": false,
"supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"],
"supportsThemeVariants": true,
"preconfiguredEntries": [{
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Advanced
"group": { "default": "Advanced" },
"title": { "default": "approval-admin" },
"description": { "default": "approval-admin description" },
"officeFabricIconFontName": "Page",
"properties": {
"description": "approval-admin"
}
}]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var ApprovalAdmin_module_scss_1 = tslib_1.__importDefault(require("./ApprovalAdmin.module.scss"));
var sp_lodash_subset_1 = require("@microsoft/sp-lodash-subset");
var ApprovalAdmin = /** @class */ (function (_super) {
tslib_1.__extends(ApprovalAdmin, _super);
function ApprovalAdmin() {
return _super !== null && _super.apply(this, arguments) || this;
}
ApprovalAdmin.prototype.render = function () {
var _a = this.props, description = _a.description, isDarkTheme = _a.isDarkTheme, environmentMessage = _a.environmentMessage, hasTeamsContext = _a.hasTeamsContext, userDisplayName = _a.userDisplayName;
return (React.createElement("section", { className: "".concat(ApprovalAdmin_module_scss_1.default.approvalAdmin, " ").concat(hasTeamsContext ? ApprovalAdmin_module_scss_1.default.teams : '') },
React.createElement("div", { className: ApprovalAdmin_module_scss_1.default.welcome },
React.createElement("img", { alt: "", src: isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png'), className: ApprovalAdmin_module_scss_1.default.welcomeImage }),
React.createElement("h2", null,
"Well done, ",
(0, sp_lodash_subset_1.escape)(userDisplayName),
"!"),
React.createElement("div", null, environmentMessage),
React.createElement("div", null,
"Web part property value: ",
React.createElement("strong", null, (0, sp_lodash_subset_1.escape)(description)))),
React.createElement("div", null,
React.createElement("h3", null, "Welcome to SharePoint Framework!"),
React.createElement("p", null, "The SharePoint Framework (SPFx) is a extensibility model for Microsoft Viva, Microsoft Teams and SharePoint. It's the easiest way to extend Microsoft 365 with automatic Single Sign On, automatic hosting and industry standard tooling."),
React.createElement("h4", null, "Learn more about SPFx development:"),
React.createElement("ul", { className: ApprovalAdmin_module_scss_1.default.links },
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx", target: "_blank", rel: "noreferrer" }, "SharePoint Framework Overview")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx-yeoman-graph", target: "_blank", rel: "noreferrer" }, "Use Microsoft Graph in your solution")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx-yeoman-teams", target: "_blank", rel: "noreferrer" }, "Build for Microsoft Teams using SharePoint Framework")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx-yeoman-viva", target: "_blank", rel: "noreferrer" }, "Build for Microsoft Viva Connections using SharePoint Framework")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx-yeoman-store", target: "_blank", rel: "noreferrer" }, "Publish SharePoint Framework applications to the marketplace")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/spfx-yeoman-api", target: "_blank", rel: "noreferrer" }, "SharePoint Framework API reference")),
React.createElement("li", null,
React.createElement("a", { href: "https://aka.ms/m365pnp", target: "_blank", rel: "noreferrer" }, "Microsoft 365 Developer Community"))))));
};
return ApprovalAdmin;
}(React.Component));
exports.default = ApprovalAdmin;
//# sourceMappingURL=ApprovalAdmin.js.map
@@ -0,0 +1 @@
{"version":3,"file":"ApprovalAdmin.js","sourceRoot":"","sources":["../../../../src/webparts/approvalAdmin/components/ApprovalAdmin.tsx"],"names":[],"mappings":";;;AAAA,mDAA+B;AAC/B,kGAAiD;AAEjD,gEAAqD;AAErD;IAA2C,yCAAoC;IAA/E;;IAqCA,CAAC;IApCQ,8BAAM,GAAb;QACQ,IAAA,KAMF,IAAI,CAAC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,EAAC,GAAG,EAAC,YAAY,mEAAiE,CAAK;oBACrJ;wBAAI,2BAAG,IAAI,EAAC,gCAAgC,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,yCAAuC,CAAK;oBACzH;wBAAI,2BAAG,IAAI,EAAC,wBAAwB,EAAC,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,wCAAsC,CAAK,CAC7G,CACD,CACE,CACX,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AArCD,CAA2C,KAAK,CAAC,SAAS,GAqCzD","sourcesContent":["import * as React from 'react';\nimport styles from './ApprovalAdmin.module.scss';\nimport type { IApprovalAdminProps } from './IApprovalAdminProps';\nimport { escape } from '@microsoft/sp-lodash-subset';\n\nexport default class ApprovalAdmin extends React.Component<IApprovalAdminProps> {\n public render(): React.ReactElement<IApprovalAdminProps> {\n const {\n description,\n isDarkTheme,\n environmentMessage,\n hasTeamsContext,\n userDisplayName\n } = this.props;\n\n return (\n <section className={`${styles.approvalAdmin} ${hasTeamsContext ? styles.teams : ''}`}>\n <div className={styles.welcome}>\n <img alt=\"\" src={isDarkTheme ? require('../assets/welcome-dark.png') : require('../assets/welcome-light.png')} className={styles.welcomeImage} />\n <h2>Well done, {escape(userDisplayName)}!</h2>\n <div>{environmentMessage}</div>\n <div>Web part property value: <strong>{escape(description)}</strong></div>\n </div>\n <div>\n <h3>Welcome to SharePoint Framework!</h3>\n <p>\n The SharePoint Framework (SPFx) is a extensibility model for Microsoft Viva, Microsoft Teams and SharePoint. It&#39;s the easiest way to extend Microsoft 365 with automatic Single Sign On, automatic hosting and industry standard tooling.\n </p>\n <h4>Learn more about SPFx development:</h4>\n <ul className={styles.links}>\n <li><a href=\"https://aka.ms/spfx\" target=\"_blank\" rel=\"noreferrer\">SharePoint Framework Overview</a></li>\n <li><a href=\"https://aka.ms/spfx-yeoman-graph\" target=\"_blank\" rel=\"noreferrer\">Use Microsoft Graph in your solution</a></li>\n <li><a href=\"https://aka.ms/spfx-yeoman-teams\" target=\"_blank\" rel=\"noreferrer\">Build for Microsoft Teams using SharePoint Framework</a></li>\n <li><a href=\"https://aka.ms/spfx-yeoman-viva\" target=\"_blank\" rel=\"noreferrer\">Build for Microsoft Viva Connections using SharePoint Framework</a></li>\n <li><a href=\"https://aka.ms/spfx-yeoman-store\" target=\"_blank\" rel=\"noreferrer\">Publish SharePoint Framework applications to the marketplace</a></li>\n <li><a href=\"https://aka.ms/spfx-yeoman-api\" target=\"_blank\" rel=\"noreferrer\">SharePoint Framework API reference</a></li>\n <li><a href=\"https://aka.ms/m365pnp\" target=\"_blank\" rel=\"noreferrer\">Microsoft 365 Developer Community</a></li>\n </ul>\n </div>\n </section>\n );\n }\n}\n"]}
@@ -0,0 +1,32 @@
/*
Your use of the content in the files referenced here is subject to the terms of the license at http://aka.ms/fabric-assets-license
*/
.approvalAdmin {
overflow: hidden;
padding: 1em;
color: "[theme:bodyText, default: #323130]";
color: var(--bodyText);
}
.approvalAdmin.teams {
font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
}
.welcome {
text-align: center;
}
.welcomeImage {
width: 100%;
max-width: 420px;
}
.links a {
text-decoration: none;
color: "[theme:link, default:#03787c]";
color: var(--link);
}
.links a:hover {
text-decoration: underline;
color: "[theme:linkHovered, default: #014446]";
color: var(--linkHovered);
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=IApprovalAdminProps.js.map
@@ -0,0 +1 @@
{"version":3,"file":"IApprovalAdminProps.js","sourceRoot":"","sources":["../../../../src/webparts/approvalAdmin/components/IApprovalAdminProps.ts"],"names":[],"mappings":"","sourcesContent":["export interface IApprovalAdminProps {\n description: string;\n isDarkTheme: boolean;\n environmentMessage: string;\n hasTeamsContext: boolean;\n userDisplayName: string;\n}\n"]}
@@ -0,0 +1,16 @@
define([], function() {
return {
"PropertyPaneDescription": "Description",
"BasicGroupName": "Group Name",
"DescriptionFieldLabel": "Description Field",
"AppLocalEnvironmentSharePoint": "The app is running on your local environment as SharePoint web part",
"AppLocalEnvironmentTeams": "The app is running on your local environment as Microsoft Teams app",
"AppLocalEnvironmentOffice": "The app is running on your local environment in office.com",
"AppLocalEnvironmentOutlook": "The app is running on your local environment in Outlook",
"AppSharePointEnvironment": "The app is running on SharePoint page",
"AppTeamsTabEnvironment": "The app is running in Microsoft Teams",
"AppOfficeEnvironment": "The app is running in office.com",
"AppOutlookEnvironment": "The app is running in Outlook",
"UnknownEnvironment": "The app is running in an unknown environment"
}
});