How to test SPFX webpart that uses pageContext? - workbench

I have a web part that uses the pageContext to get info about the page that the user is viewing. Until now I hve been available to test the webpart in my private environment by installing it in the app cataloge and then adding it to the page that I want get the info from.
Now is time to test the app in the live environment but since it uses the pageContext it can not be tested in the workbench and I don't want to install it just for testing.
Is there a way to test this app in a similar way like using workbench?
It is a Sharepoint online modern design environment.
Best regards
Americo

If you want to test SPFx projects with site contexts, pageContext, access to lists, etc., the best option is the Hosted Workbench https://your-sharepoint-site-url/_layouts/workbench.aspx (source # Step #6). This should give you at least mockups of the page context, so you ensure all your page context calls are working.
Have you considered a site collection app catalog? If you perhaps have a private site collection on the live environment, the tenant admin can enable a site-collection-scoped app catalog, so anything you install there will not be visible to anyone else in your live environment.
Other than those, I do not believe there is any other way of testing an SPFx web part without uploading/installing the package.

Related

How could an Angular/typescript developer continue collaboration with a web designer

Once an html page has been put together it starts to acquire dependencies on Angular and typescript.
This is not ideal for the web designer who really just wants to be able to view and modify their design. Usually this involves data elements too.
In our team the designer needs to be able to continue to work with html and stylesheets; they are not a separate contracted resource.
Is there a way to set up a project so that the web designer does not need to concern themselves with npm packages, Angular versions and data sources?
I have since had an idea...
As it happens I am a Linux user, the designer is a Mac user. I am wondering if it would be possible to create a project consisting of symlinks to html with typescript stubs.
A mock datasource might also be a viable solution.

Building Offline capabilites in ASP.NET Core web application

We are building a project management web application using those main technologies:-
ASP.NET Core MVC
SQL Server + Entity Framework
HTML, CSS & Bootstrap
The application mainly allows to create project >> create tasks under the projects >> assign Task to users >> and so on..
Now part of the requirement is to have certain areas that should be available offline as follow:-
My Tasks dashboard. which shows the Tasks assigned to the login user. so even if the user does not have internet access >> the dashboard should list all the Tasks assigned to the user when the user was last online.
Complete a task, by entering some fields and upload images. so even if the user does not have internet access >> the user should be able to click on a Task inside the dashboard >> fill the completion sections >> upload images/files >> click on submit >> the data should stay offline, and get submitted automatically once the user has internet access.
So can we have those offline features available inside our web application ? also some users will be accessing the web application inside their mobile web,, so are mobile browser capable of storing data and attachments and allow them to access the dashboard + edit a task and complete it and submit the change offline ? or we will need to have a mobile application instead?
Thanks
In principle, offline capabilities are available in every browser. These include things like localStorage, IndexedDB (parts of any browser), and progressive web apps (PWA) option (service workers). Note: PWA manifest and service workers are not actually related to or require blazer (mentioned above) in any way, they are web standard basically, don't get confused here. Blazer is a separate thing altogether.
The older technologies to support offline also include "application cache" mentioned in the other answer (NOTE: this one has been deprecated in favor of PWA, and support for it has been removed from Google Chrome for example)
Practically, all this means that every browser has an offline database/storage available for every application to store its data offline and synchronize later on. So, you don't have to build a mobile app to have offline capabilities.
There are some frameworks and platforms that could help you build offline-capable applications, but asp.net core mvc is not exactly one of those, meaning it does not provide offline capability right out of the box. That is, there is no checkbox to click, as far as I know, of course.
You use ASP.NET Core MVC and Entity Framework, and I think it not support offline capabilites. Because this project is compiled and run on the server.
If you want the application to support offline functions, I think it should be possible to download the entire content of the site to the browser locally.
You can refer to the official documentation below.
ASP.NET Core Blazor Progressive Web Application (PWA)
The following documents, I know are not ASP.NET Core MVC projects, but for reference.
I think to achieve offline function, first of all, the content of the complete site needs to be downloaded to the local when it is accessed for the first time. In this way, there will be no network exception errors when accessing offline.
Build an HTML5 Offline Application with Application Cache, Web Storage and ASP.NET MVC

IDE for web project working with distant copy

We currently have an intranet host on a server (just Html and js project).
contributors do not have a local copy of the project, and modify the code on a regular basis using Expression web. However, a lot of Expression web's features, like link maintenance, do not work if the project is not on a local cache.
Do you know any good web IDE capable of maintaining a web project directly on a server ?
Thanks
This IDE may work for you it is biased in the cloud.
https://c9.io/

The flow to pack php/js/css and deploy to web server

I'm developing an website now.
I found there are lots steps to do before deploying the code to web server.
e.g.
1. compact JS/CSS/HTML
2. Run unit test if any
3. Test code locally
4. Upload code to web server
Not sure if anyone could share your experiences on this process? Or how does facebook/google/yahoo ... do this?
Deployment strategy entirely depends on your project. None of those steps (except uploading code to web-server of course) is mandatory for running PHP web-site. Those steps appears when you are trying to:
Utilize build system (for configs generation, JS and CSS minification, etc);
Write unit-tests and (probably) run continuos integration;
Establish quality assurance by having QA go/no go before deployment of new release.
Needless to mention that to make, for instance, JS/CSS minification or perform unit-tests execution, you need to implement ones first.
That's why I'd not advice you to follow cargo-cult and copy all features of smbd's project (even facebook or google). Instead just follow the project needs and build your own deployment strategy.

fastest public web app framework for quick DB apps?

I'd like to pick up a new tech for my toolbox - something for rapid prototyping of web apps. Brief requirements:
public access (not hosted on my machine) - like Google's appengine, etc
no tricky configuration necessary to build a simple web app host
DB access (small storage provided) including some kind of SQLish query language
easy front end HTML templating
ability to access as a JSON service
C# or Java,PHP or Python - or a fun new language to learn is OK
free!
An example app, very simple: render an AJAXy editable (add/delete/edit/drag) list of rich-data list items via some template language, so I can quickly mock up a UI for a client. ie. I can do most of the work client-side, but need convenient back end to handle the permanent storage. (In fact I suppose it doesn't even need HTML templating if I can directly access a DB via AJAX calls.)
I realize this is a bit vague but am wondering if anyone has recommendations. A Rails host might be best for this (but probably not free) or maybe App Engine, or some other choice I'm not aware of? I've been doing everything with heavyweight servers (ASP.NET etc) for so long that I'm just not up on the latest...
Thanks - I'll follow up on comments if this isn't clear enough :)
C# or Java,PHP or Python - or a fun new language to learn is OK
How 'bout Javascript? This place hosts server-side Javascript ticking most of your other boxes. So you can use the same language for client- and server-side stuff (which I find very handy). [Caveat: I only played with their service; seemed cool though. I use Javascript on the server-side on IIS and on Tomcat (via Rhino).]
For something bleeding edge - A new version of spring roo was released recently. With it you can create a great web app in 10 minutes. Supports GAE and GWT...
http://www.springsource.org/roo
xataface is a quick way to make a front end for a MySQL database.
It makes it easy to start an app quickly with dynamically created views and then you can change it to something very customized to your needs.
It simply needs a server service with MySQL and PHP.