Skip to content

Commit

Permalink
Merge pull request #17 from Dreller/beta01
Browse files Browse the repository at this point in the history
Batch Updates for V1
  • Loading branch information
Dreller committed Oct 30, 2023
2 parents 2e965c1 + 0dacf28 commit ede1525
Show file tree
Hide file tree
Showing 6 changed files with 530 additions and 245 deletions.
43 changes: 5 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SelectEntries|Multiple lines of text
ShowEntries|Multiple lines of text
SortEntries|Multiple lines of text
Query|Multiple lines of text
BatchSize|Number (0 decimal)

## Install the Package

Expand All @@ -48,47 +49,13 @@ It is a file that set global JavaScript variables, used by the main library, so
### Set the SharePoint Site URL

Variable `_URL` must be set to the root addess of the SharePoint site that contains your data.
Variable `_SPR_URL` must be set to the root addess of the SharePoint site that contains your data.

### Set the SharePoint List Name where to store Reports

Variable `_REPORT_LIST` must contains the Name/Title of the SharePoint List where reports are saved.

---

**dconf.js**

```JavaScript
/**
* Configuration File
*/

// SharePoint Site URL
var _URL = "https://123.sharepoint.com/sites/Mysite";

// List for saving Reports
var _REPORT_LIST = "Reports";

// Allow reporting on Libraries.
var _ALLOW_LIBRARY = false;

// Allow reporting on Hidden Libraries
var _ALLOW_LIBRARY_HIDDEN = false;

// Allow reporting on Lists.
var _ALLOW_LIST = true;

// Allow reporting on Hidden Lists
var _ALLOW_LIST_HIDDEN = false;

// Always-available Fields (columns) -> Array of "Name"
var _ALLOW_FIELDS_ALWAYS = ["ID"];

var _SPREPORTIFY_BUILDER_PAGE = "dbr.aspx";
var _SPREPORTIFY_RUNNER_PAGE = "drr.aspx";
```


To tell spReportify where to read/write report definitions, you must fill the following variables:
- Variable `_SPR_REPORTLISTTYPE`: must contains `title` or `guid`, depending on if you want to refer the list using it's Title or it's GUID.
- Variable `_SPR_REPORTLISTREF`: set the List Title or GUID according to the value you have set in `_SPR_REPORTLISTTYPE`.


## Download
Expand Down
127 changes: 111 additions & 16 deletions bin/dconf.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,121 @@
* Configuration File
*/

// SharePoint Site URL
var _URL = "https://123.sharepoint.com/sites/Mysite";

// List for saving Reports
var _REPORT_LIST = "Reports";
/**
* SHAREPOINT SITE URL
* ------------------------------------------------------------------
* This is the URL to the SharePoint site where you want to install
* spReportify. This value is used to send HTTP requests to get data
* to report and to generate URLs to Reports.
*
* Controlled transformations:
* - with or without "https://" (will be added if missing),
* - http will be changed to https,
* - code will ensure there is "/" at the end,
*
* Examples:
* - tenant.sharepoint.com/sites/MySite/
* - https://tenant.sharepoint.com/sites/MySite
*/
var _SPR_URL = "https://123.sharepoint.com/sites/Mysite/";

/**
* LIST TO STORE REPORTS
* ------------------------------------------------------------------
* This is the name of the SharePoint List where Reports definitions
* are stored. There is 2 methods to identify this list, you can
* use it's GUID or it's name, please, ensure both variables are
* correctly set.
*
* --- Variable _SPR_REPORTLISTTYPE (ReportListType) ----------------
* This is a flag to tell if the reference is a GUID or the Title.
*
* Acceptable values:
* - "guid"
* - "title"
*
* --- Variable _SPR_REPORTLISTREF (ReportListRef) ------------------
* This is the GUID or the Title of the SharePoint List.
*/
var _SPR_REPORTLISTTYPE = "title";
var _SPR_REPORTLISTREF = "Reports";

// Allow reporting on Libraries.
var _ALLOW_LIBRARY = false;
/**
* ALLOW REPORTING ON LIBRARIES
* ------------------------------------------------------------------
* Set this value to 'true' if you want to allow using Libraries as
* datasource for reports.
*/
var _SPR_ALLOWLIBRARY = false;

/**
* ALLOW REPORTING ON HIDDEN LIBRARIES
* ------------------------------------------------------------------
* Set this value to 'true' if you want to allow using hidden
* libraries as datasource for reports.
*/
var _SPR_ALLOWHIDDENLIBRARY = false;

// Allow reporting on Hidden Libraries
var _ALLOW_LIBRARY_HIDDEN = false;
/**
* ALLOW REPORTING ON LISTS
* ------------------------------------------------------------------
* Set this to 'true' if you want to allow using Lists as datasources
* for reports. THIS SHOULD BE SET TO 'true' FOR NORMAL USE.
*/
var _SPR_ALLOWLIST = true;

// Allow reporting on Lists.
var _ALLOW_LIST = true;
/**
* ALLOW REPORTING ON HIDDEN LISTS
* ------------------------------------------------------------------
* Set this to 'true' if you want to allow using hidden Lists as
* datasources for reports.
*/
var _SPR_ALLOWHIDDENLIST = false;

// Allow reporting on Hidden Lists
var _ALLOW_LIST_HIDDEN = false;
/**
* ALWAYS ALLOW FIELDS
* ------------------------------------------------------------------
* This is an Array of Fields that should always be available. Use
* this parameter to make the field 'ID' always available. You
* can also use this parameter for 'Content Type' per example.
*/
var _SPR_ALLOWFIELDS = [
"ID"
];

// Always-available Fields (columns) -> Array of "Name"
var _ALLOW_FIELDS_ALWAYS = ["ID"];
/**
* LOG LEVEL
* ------------------------------------------------------------------
* Set the level of details written to the Browser Console.
*
* Accepted values:
* error Errors only. 4
* warn Potential issues that may lead to errors. 3
* info General Information. 2
* trace Output everything to the console. 1
*
* (empty) Disabled. 0
*/
var _SPR_LOGLEVEL = "trace";

var _SPREPORTIFY_BUILDER_PAGE = "dbr.aspx";
var _SPREPORTIFY_RUNNER_PAGE = "drr.aspx";
/**
* SCRIPT PAGE NAMES
* ------------------------------------------------------------------
* This is the name of the pages for spReportify Script. This is a
* more technical parameter, used to generate URLs to share Reports,
* and to determine if the user is using the Runner or the Builder.
*
* If you change the name of '.aspx' pages, update these parameters.
*
* --- Variable _SPR_PAGEBUILDER (PageBuilder) ----------------------
* Set this value to the name of the '.aspx' page of the Report
* Builder. Example: 'file.aspx'.
*
* --- Variable _SPR_PAGERUNNER (PageRunner) -----------------------
* Set this value to the name of the '.aspx' page of the Report
* Runner. Example: 'file.aspx'.
*
*/
var _SPR_PAGEBUILDER = "dbr.aspx";
var _SPR_PAGERUNNER = "drr.aspx";
13 changes: 13 additions & 0 deletions dbr.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<!-- Toolbar -->
<section id="BuilderToolbar" class="toolbar">
<ul class="toolbar">
<li onclick="spReportify.builderCloseReport();">Close</li>
<li data-modal="BuilderDataDictionary">Dictionary</li>
<li onclick="spReportify.builderSave();">Save</li>
<li onclick="abc">Save & Run</li>
Expand Down Expand Up @@ -209,6 +210,18 @@
</textarea>
</td>
</tr>
<!-- Report Max Items to returns per page -->
<tr>
<td>
Items by page
</td>
<td>
Number of items to display per page.
</td>
<td>
<input type="number" id="BuilderFormOptionBatchSize" />
</td>
</tr>
<!-- .. -->
</tbody>
</table>
Expand Down
4 changes: 4 additions & 0 deletions drr.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@
</tbody>
</table>

<section id="RunnerFetchNextPage">
<a href="#!" id="RunnerFetchNextPageButton" role="button" class="button" onclick="spReportify.runnerGetNextBatch();">Load more...</a>
<span id="RunnerFetchNextPageFinished" style="display:none;">(All data loaded)</span>
</section>

</body>
2 changes: 1 addition & 1 deletion spReportify.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
font-family: Roboto, sans-serif;
}

input[type="text"], textarea{
input[type="text"],input[type="number"], textarea{
width: 90%;
background-color: #f5f5f5;
border: thin solid #c3c3c3;
Expand Down
Loading

0 comments on commit ede1525

Please sign in to comment.