<commit_before>(function () {
  'use strict';

  angular
    .module('irma')
    .factory('scanModel', Scan);

  Scan.$inject = ['$rootScope', '$fileUploader', '$timeout', '$log', 'api', 'constants'];

  function Scan($rootScope, $fileUploader, $timeout, $log, api, constants) {
    function ScanModel(id) {
      this.id = id;
      this.state = undefined;
      this.api = api;
      this.task = undefined;
      this.base = undefined;
      this.uploader = $fileUploader.create();
      this.status = constants.scanStatusCodes.STOPPED;
      this.results = undefined;
      this.scanProgress = {
        progress: 0,
        total: 0,
        successful: 0,
        finished: 0
      };

      // Bind uploader events
      this.uploader.bind('error',       this.errorUpload.bind(this));
      this.uploader.bind('completeall', this.doneUpload.bind(this));
    }

    ScanModel.prototype = {
      setState: setState,
      hasFiles: hasFiles,
      buildProbes: buildProbes,
      getPopover: getPopover,
      startUpload: startUpload,
      cancelUpload: cancelUpload,
      errorUpload: errorUpload,
      doneUpload: doneUpload,
      startScan: startScan,
      cancelScan: cancelScan,
      updateScan: updateScan,
      setProgress: setProgress,
      getResults: getResults,
      getResult: getResult,
      populateResults: populateResults,
      buildAntivirus: buildAntivirus
    };

    return ScanModel;

    // Functions binded to ScanModel
    function setState(state) {
      this.state = state;
    }

    function hasFiles() {
      return this.uploader.queue.length > 0;
    }

    function buildProbes(data) {
      var base = {};

      if(data){
        var sample = data[_.keys(data)[0]].results;
        for(var probe in sample){
          if(sample.hasOwnProperty(probe)){
            base[probe] = {result: '__loading__', name: probe, version: sample[probe].version, type: sample[probe].type};
          }
        }
      } else {
        _.forEach(this.state.probes, function(probe){
          if(probe.active){
            base[probe.name] = {result: '__loading__'};
          }
        });
      }

      this.base = base;
    }

    function getPopover(probe, results) {
      if(results.status === 0 || results.status === '0'){
        return {
          title: probe,
          content: 'File clean'
        };
      } else if(results.status === 1 || results.status === '1'){
        return {
          title: probe,
          content: 'File compromised'
        };
      } else if(results.status === 'loading'){
        return {
          title: probe,
          content: 'Waiting for response'
        };
      } else {
        return {
          title: probe,
          content: 'An error occured'
        };
      }
    }

    /*
     *  Upload handling:
     *  - Start:   Retrieves a scan id, sets the files url, start uploading
     *  - Cancel:  Stops the upload
     *  - Error:   Broadcasts the event
     *  - Done:    Checks for errors, broadcasts the appropriate event
     */
    function startUpload() {
      this.buildProbes();
      this.api.scan.getNewId().then(function(response){
        this.id = response.scan_id;
        var items = this.uploader.getNotUploadedItems();
        _.each(items, function(item){
          item.url = this.api.scan.getAddUrl(this);
        }.bind(this));
        $log.info('Upload has started');
        this.uploader.uploadAll();
      }.bind(this));
    }

    function cancelUpload() {
      $log.info('Upload was cancelled');
      this.uploader.cancelAll();
    }

    function errorUpload() {
      $rootScope.$broadcast('errorUpload');
    }

    function doneUpload(event, items) {
      if(!!_.find(items, function(item){ return (!item.isSuccess || JSON.parse(item._xhr.response).code !== 0); })){
        this.errorUpload();
      } else {
        $rootScope.$broadcast('successUpload');
      }
    }

    function startScan() {
      var params = this.state.getLaunchParams();
      $log.info('Scan was launched');

      this.status = constants.scanStatusCodes.STARTED;
      this.api.scan.launch(this, params).then(function(response){
        this.updateScan();
      }.bind(this));
    }

    function cancelScan() {
      $log.info('Scan was cancelled');
      $timeout.cancel(this.task);
      if(this.id){
        this.api.scan.cancel(this);
      }
    }

    function updateScan() {
      this.api.scan.getResults(this).then(function(data) {
        if(data.code === 0) {
          this.setProgress(data.scan_results.total, data.scan_results.finished);
          this.results = data.scan_results.files;

          if (data.scan_results.status !== 50) {
            this.status = constants.scanStatusCodes.RUNNING;
            this.task = $timeout(this.updateScan.bind(this), constants.refresh);
          } else {
            $log.info('Scan was successful');
            $rootScope.$broadcast('successScan');

            this.status = constants.scanStatusCodes.FINISHED;
          }
        } else {
            this.task = $timeout(this.updateScan.bind(this), constants.refresh);
        }
      }.bind(this));
    }

    function setProgress(total, finished) {
      this.scanProgress = {
        progress: Math.round(100 * finished / total),
        total: total,
        successful: finished,
        finished: finished
      };
    }

    function getResults() {
      $log.info('Updating results');

      return this.api.scan.getResults(this).then(function(data) {
        this.results = data.scan_results; //this.populateResults(data.scan_results);
      }.bind(this), function(data) {
        $rootScope.$broadcast('errorResults', data);
      }.bind(this));
    }

    function getResult(resultid) {
      $log.info('Retrieve file result ' + resultid);

      return api.scan.getResult(this, resultid);
    }

    function populateResults(data) {
      if(!this.base){
        this.buildProbes(data);
      }

      for(var fileId in data){
        if(data.hasOwnProperty(fileId)){
          data[fileId].results = _.extend({}, this.base, data[fileId].results);
        }
      }
      return data;
    }

    function buildAntivirus() {
      this.antivirus = {};
      this.antivirusProbes = {};
      _.forOwn(this.results, function(fileData, fileId){
        _.forOwn(fileData.results, function(probeData, probeName){
          if(probeData.type === 'antivirus'){
            this.antivirusProbes[probeName] = _.pick(probeData, ['name', 'type', 'version']);
          }
        }, this);
      }.bind(this), this);

      _.forOwn(this.results, function(fileData, fileId){
        this.antivirus[fileId] = _.omit(fileData, 'results');
        this.antivirus[fileId].results = {};
        _.forOwn(this.antivirusProbes, function(probeData, probeName){
          if(_.has(fileData.results, probeName) && fileData.results[probeName].result !== '__loading__'){
            this.antivirus[fileId].results[probeName] = fileData.results[probeName];
          } else {
            this.antivirus[fileId].results[probeName] = {status: 'loading'};
          }
        }, this);
      }, this);
    }
  }
}) ();
<commit_msg>Remove unused functions.<commit_after>(function () {
  'use strict';

  angular
    .module('irma')
    .factory('scanModel', Scan);

  Scan.$inject = ['$rootScope', '$fileUploader', '$timeout', '$log', 'api', 'constants'];

  function Scan($rootScope, $fileUploader, $timeout, $log, api, constants) {
    function ScanModel(id) {
      this.id = id;
      this.state = undefined;
      this.api = api;
      this.task = undefined;
      this.base = undefined;
      this.uploader = $fileUploader.create();
      this.status = constants.scanStatusCodes.STOPPED;
      this.results = undefined;
      this.scanProgress = {
        progress: 0,
        total: 0,
        successful: 0,
        finished: 0
      };

      // Bind uploader events
      this.uploader.bind('error',       this.errorUpload.bind(this));
      this.uploader.bind('completeall', this.doneUpload.bind(this));
    }

    ScanModel.prototype = {
      setState: setState,
      hasFiles: hasFiles,
      getPopover: getPopover,
      startUpload: startUpload,
      cancelUpload: cancelUpload,
      errorUpload: errorUpload,
      doneUpload: doneUpload,
      startScan: startScan,
      cancelScan: cancelScan,
      updateScan: updateScan,
      setProgress: setProgress,
      getResults: getResults,
      getResult: getResult
    };

    return ScanModel;

    // Functions binded to ScanModel
    function setState(state) {
      this.state = state;
    }

    function hasFiles() {
      return this.uploader.queue.length > 0;
    }

    function getPopover(probe, results) {
      if(results.status === 0 || results.status === '0'){
        return {
          title: probe,
          content: 'File clean'
        };
      } else if(results.status === 1 || results.status === '1'){
        return {
          title: probe,
          content: 'File compromised'
        };
      } else if(results.status === 'loading'){
        return {
          title: probe,
          content: 'Waiting for response'
        };
      } else {
        return {
          title: probe,
          content: 'An error occured'
        };
      }
    }

    /*
     *  Upload handling:
     *  - Start:   Retrieves a scan id, sets the files url, start uploading
     *  - Cancel:  Stops the upload
     *  - Error:   Broadcasts the event
     *  - Done:    Checks for errors, broadcasts the appropriate event
     */
    function startUpload() {
      this.api.scan.getNewId().then(function(response){
        this.id = response.scan_id;
        var items = this.uploader.getNotUploadedItems();
        _.each(items, function(item){
          item.url = this.api.scan.getAddUrl(this);
        }.bind(this));
        $log.info('Upload has started');
        this.uploader.uploadAll();
      }.bind(this));
    }

    function cancelUpload() {
      $log.info('Upload was cancelled');
      this.uploader.cancelAll();
    }

    function errorUpload() {
      $rootScope.$broadcast('errorUpload');
    }

    function doneUpload(event, items) {
      if(!!_.find(items, function(item){ return (!item.isSuccess || JSON.parse(item._xhr.response).code !== 0); })){
        this.errorUpload();
      } else {
        $rootScope.$broadcast('successUpload');
      }
    }

    function startScan() {
      var params = this.state.getLaunchParams();
      $log.info('Scan was launched');

      this.status = constants.scanStatusCodes.STARTED;
      this.api.scan.launch(this, params).then(function(response){
        this.updateScan();
      }.bind(this));
    }

    function cancelScan() {
      $log.info('Scan was cancelled');
      $timeout.cancel(this.task);
      if(this.id){
        this.api.scan.cancel(this);
      }
    }

    function updateScan() {
      this.api.scan.getResults(this).then(function(data) {
        if(data.code === 0) {
          this.setProgress(data.scan_results.total, data.scan_results.finished);
          this.results = data.scan_results.files;

          if (data.scan_results.status !== 50) {
            this.status = constants.scanStatusCodes.RUNNING;
            this.task = $timeout(this.updateScan.bind(this), constants.refresh);
          } else {
            $log.info('Scan was successful');
            $rootScope.$broadcast('successScan');

            this.status = constants.scanStatusCodes.FINISHED;
          }
        } else {
            this.task = $timeout(this.updateScan.bind(this), constants.refresh);
        }
      }.bind(this));
    }

    function setProgress(total, finished) {
      this.scanProgress = {
        progress: Math.round(100 * finished / total),
        total: total,
        successful: finished,
        finished: finished
      };
    }

    function getResults() {
      $log.info('Updating results');

      return this.api.scan.getResults(this).then(function(data) {
        this.results = data.scan_results;
      }.bind(this), function(data) {
        $rootScope.$broadcast('errorResults', data);
      }.bind(this));
    }

    function getResult(resultid) {
      $log.info('Retrieve file result ' + resultid);

      return api.scan.getResult(this, resultid);
    }
  }
}) ();
<|endoftext|>


<commit_before>(function(Browser) {

	Browser.Items = Browser.Items || {};
	Browser.Items.Views = Browser.Items || {};

	Browser.Items.Views.List = Backbone.View.extend({

		tagName : 'tr',
		className : 'list-media list-fancymedia',

		initialize: function () {

			this.el.id = this.model.id;

			//this is for fancy box to know to group these into a gallery
			$(this.el).attr("rel", "group");

			//list item has a thumbnail item with same model as a subview
			this.thumbnailView = new Browser.Items.Views.Thumb({
				model:this.model,
				thumbnail_width:100,
				thumbnail_height:80,
				show_caption:false,
				fancybox:false,
				draggable:false
			});

		},

		render: function ( done )
		{
			var _this = this;

			var template;
			switch( this.model.get('media_type') )
			{
				case 'Image':
					template = this.getImageTemplate();
					break;
				case 'Document':
					template = this.getDefaultTemplate();
					break;
				case 'Website':
					template = this.getWebsiteTemplate();
					break;
				case 'Tweet':
					template = this.getTweetTemplate();
					break;
				case 'Text':
					template = this.getTestimonialTemplate();
					break;
				case 'Video':
					template = this.getDefaultTemplate();
					break;
				case 'Audio':
					template = this.getDefaultTemplate();
					break;
				case 'PDF':
					template = this.getDefaultTemplate();
					break;
				case 'Collection':
					$(this.el).removeClass('list-fancymedia');
					template = this.getCollectionTemplate();
					break;

				default:
					template = this.getDefaultTemplate();
			}

			var blanks = this.model.attributes;

			if (!_.isUndefined(this.model.get("media_date_created"))&&!_.isNull(this.model.get("media_date_created"))){
				blanks["media_date"] = new Date(this.model.get("media_date_created").replace(" ", "T"));
				blanks["media_date"]=blanks["media_date"].format("mmmm dS, yyyy
h:MM TT");
			} else {
				blanks["media_date"] = "n/a";
			}
			if (this.model.get("text") !== null){
				var excerpt = this.model.get("text").replace(/\r\n/gi, '
');
				blanks["text"] = this.linkifyTweet(excerpt);

			}
			if (this.model.get("description") === null){
				blanks["description"] = " ";
			}
			if (this.model.get("description") !== null && this.model.get("description").length > 255){
				blanks["description"] = this.model.get("description").substring(0,255) + "...";
			}
			if (this.model.get("title") === null || this.model.get("title") == "none" || this.model.get("title") === ""){
				blanks["title"] = "";
			}

			if (this.model.get("media_creator_realname") === null || this.model.get("media_creator_realname") === "" || this.model.get("media_creator_realname") == "Unknown" || this.model.get("media_creator_realname") == "unknown"){
				blanks["author"] = this.model.get("media_creator_username");
			} else {
				blanks["author"] = this.model.get("media_creator_realname");
			}
			if (this.model.get("media_type") == "Text" && this.model.get('description').length < this.model.get('text').length){
				blanks["description"] = this.model.get('description') + '...';
			}

			if (this.model.get("media_type") == "Website"){
			    var parts = this.model.get('attribution_uri').split('http');
			    alert(this.model.get('attribution_uri'));
			    alert(parts);
				blanks["original_url"] = "http"+parts[2];
			}

			$(this.el).html( _.template( template, blanks ) );

			$(this.el).find('.zeega-item-thumbnail').append(this.thumbnailView.render().el);

			if (blanks["author"] === ""){
				$(this.el).find('.jda-item-author').hide();
			}

			if (this.model.get("media_type") == "Collection"){
				this.draggable=false;
			}
			else {
				this.draggable=true;
			}

			if(this.draggable){
				$(this.el).draggable({
					cursor : 'crosshair',
					cursorAt : {
						top : 50,
						left : 50
					},
					appendTo : 'body',
					opacity : 0.8,

					helper : function(){
						var drag = $(this).find('.thumbnail')
						.clone()
						.css({
							'z-index':'101'
						});
						return drag;
					},

					//init the dragged item variable
					start : function(){
						$(this).draggable('option','revert',true);
						jda.app.draggedItem = _this.model;
					}
			});
			}
			$(this.el).find(".jdicon-small-drag").tooltip({'title':'Drag to add to your collection','placement':'bottom', delay: { show: 600, hide: 100 }});
			$(this.el).find(".jda-user-link").click(function(){jda.app.goToUser(_this.model.get('user_id')); return false;});
			return this;
		},

		/* formats tweet text, doesn't linkify bc tweet is already linked to fancybox */
		linkifyTweet : function(tweet){

			// urls
			var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
			tweet = tweet.replace(exp,"$1");

			// users
			tweet = tweet.replace(/(^|)@(\w+)/gi, function (s) {
				return '' + s + '';
			});

			// tags
			tweet = tweet.replace(/(^|)#(\w+)/gi, function (s) {
				return '' + s + '';
			});

			return tweet;
		},

		getImageTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

by: <%= author %>'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getDefaultTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

by: <%= author %>
'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
			'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getDocumentTemplate : function()
		{
			html =

			''+
				''+
				'
<%= author %>
'+
			'	'+
			''+
				'
<%= title %>
'+
				'
<%= description %>
'+
			'	'+
			''+
				'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getWebsiteTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>
'+
				'
<%= original_url %>
'+
				'
<%= description %>
'+
			'	'+
			''+
				'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getTweetTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= text %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getTestimonialTemplate : function()
		{
			html =
			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

Testimonial by: <%= author %>
'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';
			return html;
		},

		getCollectionTemplate : function()
		{
			html =

				''+
				'

'+
				'	'+
				''+
					'
<%= title %>

by <%= display_name %>
'+
					'
<%= description %>
'+
				'	'+
				'<%= media_date %>'+
					'<input class="jda-item-checkbox" type="checkbox">'+
				'	';

			return html;
		}

	});

})(jda.module("browser"));<commit_msg>fixing issue with original url on backbone model<commit_after>(function(Browser) {

	Browser.Items = Browser.Items || {};
	Browser.Items.Views = Browser.Items || {};

	Browser.Items.Views.List = Backbone.View.extend({

		tagName : 'tr',
		className : 'list-media list-fancymedia',

		initialize: function () {

			this.el.id = this.model.id;

			//this is for fancy box to know to group these into a gallery
			$(this.el).attr("rel", "group");

			//list item has a thumbnail item with same model as a subview
			this.thumbnailView = new Browser.Items.Views.Thumb({
				model:this.model,
				thumbnail_width:100,
				thumbnail_height:80,
				show_caption:false,
				fancybox:false,
				draggable:false
			});

		},

		render: function ( done )
		{
			var _this = this;

			var template;
			switch( this.model.get('media_type') )
			{
				case 'Image':
					template = this.getImageTemplate();
					break;
				case 'Document':
					template = this.getDefaultTemplate();
					break;
				case 'Website':
					template = this.getWebsiteTemplate();
					break;
				case 'Tweet':
					template = this.getTweetTemplate();
					break;
				case 'Text':
					template = this.getTestimonialTemplate();
					break;
				case 'Video':
					template = this.getDefaultTemplate();
					break;
				case 'Audio':
					template = this.getDefaultTemplate();
					break;
				case 'PDF':
					template = this.getDefaultTemplate();
					break;
				case 'Collection':
					$(this.el).removeClass('list-fancymedia');
					template = this.getCollectionTemplate();
					break;

				default:
					template = this.getDefaultTemplate();
			}

			var blanks = this.model.attributes;

			if (!_.isUndefined(this.model.get("media_date_created"))&&!_.isNull(this.model.get("media_date_created"))){
				blanks["media_date"] = new Date(this.model.get("media_date_created").replace(" ", "T"));
				blanks["media_date"]=blanks["media_date"].format("mmmm dS, yyyy
h:MM TT");
			} else {
				blanks["media_date"] = "n/a";
			}
			if (this.model.get("text") !== null){
				var excerpt = this.model.get("text").replace(/\r\n/gi, '
');
				blanks["text"] = this.linkifyTweet(excerpt);

			}
			if (this.model.get("description") === null){
				blanks["description"] = " ";
			}
			if (this.model.get("description") !== null && this.model.get("description").length > 255){
				blanks["description"] = this.model.get("description").substring(0,255) + "...";
			}
			if (this.model.get("title") === null || this.model.get("title") == "none" || this.model.get("title") === ""){
				blanks["title"] = "";
			}

			if (this.model.get("media_creator_realname") === null || this.model.get("media_creator_realname") === "" || this.model.get("media_creator_realname") == "Unknown" || this.model.get("media_creator_realname") == "unknown"){
				blanks["author"] = this.model.get("media_creator_username");
			} else {
				blanks["author"] = this.model.get("media_creator_realname");
			}
			if (this.model.get("media_type") == "Text" && this.model.get('description').length < this.model.get('text').length){
				blanks["description"] = this.model.get('description') + '...';
			}

			if (this.model.get("media_type") == "Website"){
			    var parts = this.model.get('attribution_uri').split('http');
			    blanks["original_url"] = parts[2] != undefined ? "http" + parts[2] : this.model.get('attribution_uri');
			}

			$(this.el).html( _.template( template, blanks ) );

			$(this.el).find('.zeega-item-thumbnail').append(this.thumbnailView.render().el);

			if (blanks["author"] === ""){
				$(this.el).find('.jda-item-author').hide();
			}

			if (this.model.get("media_type") == "Collection"){
				this.draggable=false;
			}
			else {
				this.draggable=true;
			}

			if(this.draggable){
				$(this.el).draggable({
					cursor : 'crosshair',
					cursorAt : {
						top : 50,
						left : 50
					},
					appendTo : 'body',
					opacity : 0.8,

					helper : function(){
						var drag = $(this).find('.thumbnail')
						.clone()
						.css({
							'z-index':'101'
						});
						return drag;
					},

					//init the dragged item variable
					start : function(){
						$(this).draggable('option','revert',true);
						jda.app.draggedItem = _this.model;
					}
			});
			}
			$(this.el).find(".jdicon-small-drag").tooltip({'title':'Drag to add to your collection','placement':'bottom', delay: { show: 600, hide: 100 }});
			$(this.el).find(".jda-user-link").click(function(){jda.app.goToUser(_this.model.get('user_id')); return false;});
			return this;
		},

		/* formats tweet text, doesn't linkify bc tweet is already linked to fancybox */
		linkifyTweet : function(tweet){

			// urls
			var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
			tweet = tweet.replace(exp,"$1");

			// users
			tweet = tweet.replace(/(^|)@(\w+)/gi, function (s) {
				return '' + s + '';
			});

			// tags
			tweet = tweet.replace(/(^|)#(\w+)/gi, function (s) {
				return '' + s + '';
			});

			return tweet;
		},

		getImageTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

by: <%= author %>'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getDefaultTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

by: <%= author %>
'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
			'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getDocumentTemplate : function()
		{
			html =

			''+
				''+
				'
<%= author %>
'+
			'	'+
			''+
				'
<%= title %>
'+
				'
<%= description %>
'+
			'	'+
			''+
				'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getWebsiteTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= title %>
'+
				'
<%= original_url %>
'+
				'
<%= description %>
'+
			'	'+
			''+
				'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getTweetTemplate : function()
		{
			html =

			''+
				'

'+
			'	'+
			''+
				'
<%= text %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';

			return html;
		},

		getTestimonialTemplate : function()
		{
			html =
			''+
				'

'+
			'	'+
			''+
				'
<%= title %>

Testimonial by: <%= author %>
'+
				'
<%= description %>
'+
			'	'+
			'<%= media_date %><input class="jda-item-checkbox" type="checkbox">'+
				'

via <%= display_name %>

'+
			'	';
			return html;
		},

		getCollectionTemplate : function()
		{
			html =

				''+
				'

'+
				'	'+
				''+
					'
<%= title %>

by <%= display_name %>
'+
					'
<%= description %>
'+
				'	'+
				'<%= media_date %>'+
					'<input class="jda-item-checkbox" type="checkbox">'+
				'	';

			return html;
		}

	});

})(jda.module("browser"));<|endoftext|>


<commit_before>exports.config = {
	//
	// =====================
	// Server Configurations
	// =====================
	// Host address of the running Selenium server. This information is usually obsolete as
	// WebdriverIO automatically connects to localhost. Also, if you are using one of the
	// supported cloud services like Sauce Labs, Browserstack, or Testing Bot you don't
	// need to define host and port information because WebdriverIO can figure that out
	// according to your user and key information. However, if you are using a private Selenium
	// backend you should define the host address, port, and path here.
	//
	host: 'hub.crossbrowsertesting.com',
	port: 80,
	path: '',

	//
	// =================
	// Service Providers
	// =================
	// WebdriverIO supports Sauce Labs, Browserstack, and Testing Bot (other cloud providers
	// should work too though). These services define specific user and key (or access key)
	// values you need to put in here in order to connect to these services.
	//
	user: process.env.XBROWSERTESTING_USERNAME,
	key: process.env.XBROWSERTESTING_ACCESS_KEY,

	//
	// ==================
	// Specify Test Files
	// ==================
	// Define which test specs should run. The pattern is relative to the directory
	// from which `wdio` was called. Notice that, if you are calling `wdio` from an
	// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
	// directory is where your package.json resides, so `wdio` will be called from there.
	//
	specs: ['./tests/functional/dist/*.js'],
	// Patterns to exclude.
	exclude: [
        // 'path/to/excluded/files'
	],
	//
	// ============
	// Capabilities
	// ============
	// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
	// time. Depending on the number of capabilities, WebdriverIO launches several test
	// sessions. Within your capabilities you can overwrite the spec and exclude options in
	// order to group specific specs to a specific capability.
	//
	// First, you can define how many instances should be started at the same time. Let's
	// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
	// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
	// files and you set maxInstances to 10, all spec files will get tested at the same time
	// and 30 processes will get spawned. The property handles how many capabilities
	// from the same test should run tests.
	//
	maxInstances: 5,
	//
	// If you have trouble getting all important capabilities together, check out the
	// Sauce Labs platform configurator - a great tool to configure your capabilities:
	// https://docs.saucelabs.com/reference/platforms-configurator
	//
	capabilities: [
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 5,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.13',
			browserName: 'Safari',
			version: '11.0'
		}/*,
		// TODO: Fix the test cases regarding older versions of safari/selenium
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 1,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.12',
			browserName: 'Safari',
			version: '10'
		},
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 1,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.11',
			browserName: 'Safari',
			version: '9'
		}
		*/
	],
	//
	// ===================
	// Test Configurations
	// ===================
	// Define all options that are relevant for the WebdriverIO instance here
	//
	// By default WebdriverIO commands are executed in a synchronous way using
	// the wdio-sync package. If you still want to run your tests in an async way
	// e.g. using promises you can set the sync option to false.
	sync: true,
	//
	// Level of logging verbosity: silent | verbose | command | data | result | error
	logLevel: 'error',
	//
	// Enables colors for log output.
	coloredLogs: true,
	//
	// Warns when a deprecated command is used
	deprecationWarnings: true,
	//
	// If you only want to run your tests until a specific amount of tests have failed use
	// bail (default is 0 - don't bail, run all tests).
	bail: 0,
	//
	// Saves a screenshot to a given path if a command fails.
	screenshotPath: './errorShots/',
	//
	// Set a base URL in order to shorten url command calls. If your `url` parameter starts
	// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
	// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
	// gets prepended directly.
	baseUrl: 'https://mfranzke.github.io/datalist-polyfill/demos/',
	//
	// Default timeout for all waitFor* commands.
	waitforTimeout: 10000,
	//
	// Default timeout in milliseconds for request
	// if Selenium Grid doesn't send response
	connectionRetryTimeout: 90000,
	//
	// Default request retries count
	connectionRetryCount: 3,
	//
	// Initialize the browser instance with a WebdriverIO plugin. The object should have the
	// plugin name as key and the desired plugin options as properties. Make sure you have
	// the plugin installed before running any tests. The following plugins are currently
	// available:
	// WebdriverCSS: https://github.com/webdriverio/webdrivercss
	// WebdriverRTC: https://github.com/webdriverio/webdriverrtc
	// Browserevent: https://github.com/webdriverio/browserevent
	// plugins: {
	//     webdrivercss: {
	//         screenshotRoot: 'my-shots',
	//         failedComparisonsRoot: 'diffs',
	//         misMatchTolerance: 0.05,
	//         screenWidth: [320,480,640,1024]
	//     },
	//     webdriverrtc: {},
	//     browserevent: {}
	// },
	//
	// Test runner services
	// Services take over a specific job you don't want to take care of. They enhance
	// your test setup with almost no effort. Unlike plugins, they don't add new
	// commands. Instead, they hook themselves up into the test process.
	// services: [],//
	// Framework you want to run your specs with.
	// The following are supported: Mocha, Jasmine, and Cucumber
	// see also: http://webdriver.io/guide/testrunner/frameworks.html
	//
	// Make sure you have the wdio adapter package for the specific framework installed
	// before running any tests.
	framework: 'mocha',
	//
	// Test reporter for stdout.
	// The only one supported by default is 'dot'
	// see also: http://webdriver.io/guide/reporters/dot.html
	// reporters: ['dot'],
	//
	// Options to be passed to Mocha.
	// See the full list at http://mochajs.org/
	mochaOpts: {
		ui: 'bdd'
	}
	//
	// =====
	// Hooks
	// =====
	// WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
	// it and to build services around it. You can either apply a single function or an array of
	// methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
	// resolved to continue.
	/**
	 * Gets executed once before all workers get launched.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 */
	// onPrepare: function (config, capabilities) {
	// },
	/**
	 * Gets executed just before initialising the webdriver session and test framework. It allows you
	 * to manipulate configurations depending on the capability or spec.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that are to be run
	 */
	// beforeSession: function (config, capabilities, specs) {
	// },
	/**
	 * Gets executed before test execution begins. At this point you can access to all global
	 * variables like `browser`. It is the perfect place to define custom commands.
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that are to be run
	 */
	// before: function (capabilities, specs) {
	// },
	/**
	 * Runs before a WebdriverIO command gets executed.
	 * @param {String} commandName hook command name
	 * @param {Array} args arguments that command would receive
	 */
	// beforeCommand: function (commandName, args) {
	// },

	/**
	 * Hook that gets executed before the suite starts
	 * @param {Object} suite suite details
	 */
	// beforeSuite: function (suite) {
	// },
	/**
	 * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
	 * @param {Object} test test details
	 */
	// beforeTest: function (test) {
	// },
	/**
	 * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
	 * beforeEach in Mocha)
	 */
	// beforeHook: function () {
	// },
	/**
	 * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
	 * afterEach in Mocha)
	 */
	// afterHook: function () {
	// },
	/**
	 * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends.
	 * @param {Object} test test details
	 */
	// afterTest: function (test) {
	// },
	/**
	 * Hook that gets executed after the suite has ended
	 * @param {Object} suite suite details
	 */
	// afterSuite: function (suite) {
	// },

	/**
	 * Runs after a WebdriverIO command gets executed
	 * @param {String} commandName hook command name
	 * @param {Array} args arguments that command would receive
	 * @param {Number} result 0 - command success, 1 - command error
	 * @param {Object} error error object if any
	 */
	// afterCommand: function (commandName, args, result, error) {
	// },
	/**
	 * Gets executed after all tests are done. You still have access to all global variables from
	 * the test.
	 * @param {Number} result 0 - test pass, 1 - test fail
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that ran
	 */
	// after: function (result, capabilities, specs) {
	// },
	/**
	 * Gets executed right after terminating the webdriver session.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that ran
	 */
	// afterSession: function (config, capabilities, specs) {
	// },
	/**
	 * Gets executed after all workers got shut down and the process is about to exit.
	 * @param {Object} exitCode 0 - success, 1 - fail
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 */
	// onComplete: function(exitCode, config, capabilities) {
	// }
};
<commit_msg>code prettify<commit_after>exports.config = {
	//
	// =====================
	// Server Configurations
	// =====================
	// Host address of the running Selenium server. This information is usually obsolete as
	// WebdriverIO automatically connects to localhost. Also, if you are using one of the
	// supported cloud services like Sauce Labs, Browserstack, or Testing Bot you don't
	// need to define host and port information because WebdriverIO can figure that out
	// according to your user and key information. However, if you are using a private Selenium
	// backend you should define the host address, port, and path here.
	//
	host: 'hub.crossbrowsertesting.com',
	port: 80,
	path: '',

	//
	// =================
	// Service Providers
	// =================
	// WebdriverIO supports Sauce Labs, Browserstack, and Testing Bot (other cloud providers
	// should work too though). These services define specific user and key (or access key)
	// values you need to put in here in order to connect to these services.
	//
	user: process.env.XBROWSERTESTING_USERNAME,
	key: process.env.XBROWSERTESTING_ACCESS_KEY,

	//
	// ==================
	// Specify Test Files
	// ==================
	// Define which test specs should run. The pattern is relative to the directory
	// from which `wdio` was called. Notice that, if you are calling `wdio` from an
	// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
	// directory is where your package.json resides, so `wdio` will be called from there.
	//
	specs: ['./tests/functional/dist/*.js'],
	// Patterns to exclude.
	exclude: [
		// 'path/to/excluded/files'
	],
	//
	// ============
	// Capabilities
	// ============
	// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
	// time. Depending on the number of capabilities, WebdriverIO launches several test
	// sessions. Within your capabilities you can overwrite the spec and exclude options in
	// order to group specific specs to a specific capability.
	//
	// First, you can define how many instances should be started at the same time. Let's
	// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
	// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
	// files and you set maxInstances to 10, all spec files will get tested at the same time
	// and 30 processes will get spawned. The property handles how many capabilities
	// from the same test should run tests.
	//
	maxInstances: 5,
	//
	// If you have trouble getting all important capabilities together, check out the
	// Sauce Labs platform configurator - a great tool to configure your capabilities:
	// https://docs.saucelabs.com/reference/platforms-configurator
	//
	capabilities: [
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 5,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.13',
			browserName: 'Safari',
			version: '11.0'
		} /*,
		// TODO: Fix the test cases regarding older versions of safari/selenium
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 1,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.12',
			browserName: 'Safari',
			version: '10'
		},
		{
			// maxInstances can get overwritten per capability. So if you have an in-house Selenium
			// grid with only 5 firefox instances available you can make sure that not more than
			// 5 instances get started at a time.
			maxInstances: 1,
			// https://app.crossbrowsertesting.com/selenium/run
			platform: 'Mac OSX 10.11',
			browserName: 'Safari',
			version: '9'
		}
		*/
	],
	//
	// ===================
	// Test Configurations
	// ===================
	// Define all options that are relevant for the WebdriverIO instance here
	//
	// By default WebdriverIO commands are executed in a synchronous way using
	// the wdio-sync package. If you still want to run your tests in an async way
	// e.g. using promises you can set the sync option to false.
	sync: true,
	//
	// Level of logging verbosity: silent | verbose | command | data | result | error
	logLevel: 'error',
	//
	// Enables colors for log output.
	coloredLogs: true,
	//
	// Warns when a deprecated command is used
	deprecationWarnings: true,
	//
	// If you only want to run your tests until a specific amount of tests have failed use
	// bail (default is 0 - don't bail, run all tests).
	bail: 0,
	//
	// Saves a screenshot to a given path if a command fails.
	screenshotPath: './errorShots/',
	//
	// Set a base URL in order to shorten url command calls. If your `url` parameter starts
	// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
	// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
	// gets prepended directly.
	baseUrl: 'https://mfranzke.github.io/datalist-polyfill/demos/',
	//
	// Default timeout for all waitFor* commands.
	waitforTimeout: 10000,
	//
	// Default timeout in milliseconds for request
	// if Selenium Grid doesn't send response
	connectionRetryTimeout: 90000,
	//
	// Default request retries count
	connectionRetryCount: 3,
	//
	// Initialize the browser instance with a WebdriverIO plugin. The object should have the
	// plugin name as key and the desired plugin options as properties. Make sure you have
	// the plugin installed before running any tests. The following plugins are currently
	// available:
	// WebdriverCSS: https://github.com/webdriverio/webdrivercss
	// WebdriverRTC: https://github.com/webdriverio/webdriverrtc
	// Browserevent: https://github.com/webdriverio/browserevent
	// plugins: {
	//     webdrivercss: {
	//         screenshotRoot: 'my-shots',
	//         failedComparisonsRoot: 'diffs',
	//         misMatchTolerance: 0.05,
	//         screenWidth: [320,480,640,1024]
	//     },
	//     webdriverrtc: {},
	//     browserevent: {}
	// },
	//
	// Test runner services
	// Services take over a specific job you don't want to take care of. They enhance
	// your test setup with almost no effort. Unlike plugins, they don't add new
	// commands. Instead, they hook themselves up into the test process.
	// services: [],//
	// Framework you want to run your specs with.
	// The following are supported: Mocha, Jasmine, and Cucumber
	// see also: http://webdriver.io/guide/testrunner/frameworks.html
	//
	// Make sure you have the wdio adapter package for the specific framework installed
	// before running any tests.
	framework: 'mocha',
	//
	// Test reporter for stdout.
	// The only one supported by default is 'dot'
	// see also: http://webdriver.io/guide/reporters/dot.html
	// reporters: ['dot'],
	//
	// Options to be passed to Mocha.
	// See the full list at http://mochajs.org/
	mochaOpts: {
		ui: 'bdd'
	}
	//
	// =====
	// Hooks
	// =====
	// WebdriverIO provides several hooks you can use to interfere with the test process in order to enhance
	// it and to build services around it. You can either apply a single function or an array of
	// methods to it. If one of them returns with a promise, WebdriverIO will wait until that promise got
	// resolved to continue.
	/**
	 * Gets executed once before all workers get launched.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 */
	// onPrepare: function (config, capabilities) {
	// },
	/**
	 * Gets executed just before initialising the webdriver session and test framework. It allows you
	 * to manipulate configurations depending on the capability or spec.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that are to be run
	 */
	// beforeSession: function (config, capabilities, specs) {
	// },
	/**
	 * Gets executed before test execution begins. At this point you can access to all global
	 * variables like `browser`. It is the perfect place to define custom commands.
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that are to be run
	 */
	// before: function (capabilities, specs) {
	// },
	/**
	 * Runs before a WebdriverIO command gets executed.
	 * @param {String} commandName hook command name
	 * @param {Array} args arguments that command would receive
	 */
	// beforeCommand: function (commandName, args) {
	// },

	/**
	 * Hook that gets executed before the suite starts
	 * @param {Object} suite suite details
	 */
	// beforeSuite: function (suite) {
	// },
	/**
	 * Function to be executed before a test (in Mocha/Jasmine) or a step (in Cucumber) starts.
	 * @param {Object} test test details
	 */
	// beforeTest: function (test) {
	// },
	/**
	 * Hook that gets executed _before_ a hook within the suite starts (e.g. runs before calling
	 * beforeEach in Mocha)
	 */
	// beforeHook: function () {
	// },
	/**
	 * Hook that gets executed _after_ a hook within the suite ends (e.g. runs after calling
	 * afterEach in Mocha)
	 */
	// afterHook: function () {
	// },
	/**
	 * Function to be executed after a test (in Mocha/Jasmine) or a step (in Cucumber) ends.
	 * @param {Object} test test details
	 */
	// afterTest: function (test) {
	// },
	/**
	 * Hook that gets executed after the suite has ended
	 * @param {Object} suite suite details
	 */
	// afterSuite: function (suite) {
	// },

	/**
	 * Runs after a WebdriverIO command gets executed
	 * @param {String} commandName hook command name
	 * @param {Array} args arguments that command would receive
	 * @param {Number} result 0 - command success, 1 - command error
	 * @param {Object} error error object if any
	 */
	// afterCommand: function (commandName, args, result, error) {
	// },
	/**
	 * Gets executed after all tests are done. You still have access to all global variables from
	 * the test.
	 * @param {Number} result 0 - test pass, 1 - test fail
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that ran
	 */
	// after: function (result, capabilities, specs) {
	// },
	/**
	 * Gets executed right after terminating the webdriver session.
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 * @param {Array.<String>} specs List of spec file paths that ran
	 */
	// afterSession: function (config, capabilities, specs) {
	// },
	/**
	 * Gets executed after all workers got shut down and the process is about to exit.
	 * @param {Object} exitCode 0 - success, 1 - fail
	 * @param {Object} config wdio configuration object
	 * @param {Array.<Object>} capabilities list of capabilities details
	 */
	// onComplete: function(exitCode, config, capabilities) {
	// }
};
<|endoftext|>


<commit_before>// Import utility method
import { format } from 'c/utilCommon';

// Import custom labels
import commonAssistiveError from '@salesforce/label/c.commonAssistiveError';
import commonAssistiveInfo from '@salesforce/label/c.commonAssistiveInfo';
import commonAssistiveSuccess from '@salesforce/label/c.commonAssistiveSuccess';
import commonAssistiveWarning from '@salesforce/label/c.commonAssistiveWarning';
import commonBatches from '@salesforce/label/c.commonBatches';
import commonCancel from '@salesforce/label/c.commonCancel';
import commonClone from '@salesforce/label/c.commonClone';
import commonDefaultValue from '@salesforce/label/c.commonDefaultValue';
import commonDelete from '@salesforce/label/c.commonDelete';
import commonEdit from '@salesforce/label/c.commonEdit';
import commonError from '@salesforce/label/c.commonError';
import commonFieldLabel from '@salesforce/label/c.commonFieldLabel';
import commonNoItems from '@salesforce/label/c.commonNoItems';
import commonReadMore from '@salesforce/label/c.commonReadMore';
import commonRequired from '@salesforce/label/c.commonRequired';
import commonSave from '@salesforce/label/c.commonSave';
import commonSaveAndClose from '@salesforce/label/c.commonSaveAndClose';
import commonTemplates from '@salesforce/label/c.commonTemplates';
import commonUnknownError from '@salesforce/label/c.commonUnknownError';
import commonViewAll from '@salesforce/label/c.commonViewAll';
import commonViewMore from '@salesforce/label/c.commonViewMore';
import commonWarning from '@salesforce/label/c.commonWarning';
import geAssistiveActiveSection from '@salesforce/label/c.geAssistiveActiveSection';
import geAssistiveBatchHeaderRemoveField from '@salesforce/label/c.geAssistiveBatchHeaderRemoveField';
import geAssistiveFieldDown from '@salesforce/label/c.geAssistiveFieldDown';
import geAssistiveFieldUp from '@salesforce/label/c.geAssistiveFieldUp';
import geAssistiveFormFieldsCollapseAll from '@salesforce/label/c.geAssistiveFormFieldsCollapseAll';
import geAssistiveFormFieldsExpandAll from '@salesforce/label/c.geAssistiveFormFieldsExpandAll';
import geAssistiveFormFieldsRemoveField from '@salesforce/label/c.geAssistiveFormFieldsRemoveField';
import geAssistiveFormFieldsSectionEdit from '@salesforce/label/c.geAssistiveFormFieldsSectionEdit';
import geAssistiveModalCancelAndDiscard from '@salesforce/label/c.geAssistiveModalCancelAndDiscard';
import geAssistiveRemoveSelectedOption from '@salesforce/label/c.geAssistiveRemoveSelectedOption';
import geAssistiveSectionDown from '@salesforce/label/c.geAssistiveSectionDown';
import geAssistiveSectionUp from '@salesforce/label/c.geAssistiveSectionUp';
import geAssistiveShowMenu from '@salesforce/label/c.geAssistiveShowMenu';
import geAssistiveSpinner from '@salesforce/label/c.geAssistiveSpinner';
import geBodyBatchHeaderLeftCol from '@salesforce/label/c.geBodyBatchHeaderLeftCol';
import geBodyBatchHeaderRightCol from '@salesforce/label/c.geBodyBatchHeaderRightCol';
import geBodyBatchHeaderWarning from '@salesforce/label/c.geBodyBatchHeaderWarning';
import geBodyEmptyFormSection from '@salesforce/label/c.geBodyEmptyFormSection';
import geBodyFormFieldsLeftCol from '@salesforce/label/c.geBodyFormFieldsLeftCol';
import geBodyFormFieldsLeftColAdditional from '@salesforce/label/c.geBodyFormFieldsLeftColAdditional';
import geBodyFormFieldsModalDeleteSection from '@salesforce/label/c.geBodyFormFieldsModalDeleteSection';
import geBodyFormFieldsRightCol from '@salesforce/label/c.geBodyFormFieldsRightCol';
import geBodyTemplateInfoLeftCol from '@salesforce/label/c.geBodyTemplateInfoLeftCol';
import geBodyTemplatesTabDescription from '@salesforce/label/c.geBodyTemplatesTabDescription';
import geButtonBuilderNavBackFormFields from '@salesforce/label/c.geButtonBuilderNavBackFormFields';
import geButtonBuilderNavBackTemplateInfo from '@salesforce/label/c.geButtonBuilderNavBackTemplateInfo';
import geButtonBuilderNavBatchHeader from '@salesforce/label/c.geButtonBuilderNavBatchHeader';
import geButtonBuilderNavFormFields from '@salesforce/label/c.geButtonBuilderNavFormFields';
import geButtonEnterGifts from '@salesforce/label/c.geButtonEnterGifts';
import geButtonFormFieldsAddSection from '@salesforce/label/c.geButtonFormFieldsAddSection';
import geButtonFormFieldsCollapseAll from '@salesforce/label/c.geButtonFormFieldsCollapseAll';
import geButtonFormFieldsExpandAll from '@salesforce/label/c.geButtonFormFieldsExpandAll';
import geButtonFormFieldsModalDeleteSectionAndFields from '@salesforce/label/c.geButtonFormFieldsModalDeleteSectionAndFields';
import geButtonTemplatesTabCreateTemplate from '@salesforce/label/c.geButtonTemplatesTabCreateTemplate';
import geErrorCompleteThisField from '@salesforce/label/c.geErrorCompleteThisField';
import geErrorExistingTemplateName from '@salesforce/label/c.geErrorExistingTemplateName';
import geErrorFieldPermission from '@salesforce/label/c.geErrorFieldPermission';
import geErrorPageLevelAdvancedMappingBody from '@salesforce/label/c.geErrorPageLevelAdvancedMappingBody';
import geErrorPageLevelAdvancedMappingHeader from '@salesforce/label/c.geErrorPageLevelAdvancedMappingHeader';
import geErrorPageLevelFieldPermission1 from '@salesforce/label/c.geErrorPageLevelFieldPermission1';
import geErrorPageLevelFieldPermission2 from '@salesforce/label/c.geErrorPageLevelFieldPermission2';
import geErrorPageLevelMissingRequiredFields from '@salesforce/label/c.geErrorPageLevelMissingRequiredFields';
import geErrorPageLevelMissingRequiredGroupFields from '@salesforce/label/c.geErrorPageLevelMissingRequiredGroupFields';
import geErrorRequiredField from '@salesforce/label/c.geErrorRequiredField';
import geHeaderBatchHeaderLeftCol from '@salesforce/label/c.geHeaderBatchHeaderLeftCol';
import geHeaderBatchHeaderRightCol from '@salesforce/label/c.geHeaderBatchHeaderRightCol';
import geHeaderCustomTableHeaders from '@salesforce/label/c.geHeaderCustomTableHeaders';
import geHeaderEmptyFormSection from '@salesforce/label/c.geHeaderEmptyFormSection';
import geHeaderFormFieldsDefaultSectionName from '@salesforce/label/c.geHeaderFormFieldsDefaultSectionName';
import geHeaderFormFieldsLeftCol from '@salesforce/label/c.geHeaderFormFieldsLeftCol';
import geHeaderFormFieldsModalDeleteSection from '@salesforce/label/c.geHeaderFormFieldsModalDeleteSection';
import geHeaderFormFieldsModalRenameSection from '@salesforce/label/c.geHeaderFormFieldsModalRenameSection';
import geHeaderFormFieldsModalSectionSettings from '@salesforce/label/c.geHeaderFormFieldsModalSectionSettings';
import geHeaderFormFieldsRightCol from '@salesforce/label/c.geHeaderFormFieldsRightCol';
import geHeaderGiftEntry from '@salesforce/label/c.geHeaderGiftEntry';
import geHeaderNewSection from '@salesforce/label/c.geHeaderNewSection';
import geHeaderNewTemplate from '@salesforce/label/c.geHeaderNewTemplate';
import geHeaderPageLevelError from '@salesforce/label/c.geHeaderPageLevelError';
import geHeaderTemplateInfoLeftCol from '@salesforce/label/c.geHeaderTemplateInfoLeftCol';
import geHelpTextBatchHeaderFieldLabelLabel from '@salesforce/label/c.geHelpTextBatchHeaderFieldLabelLabel';
import geHelpTextFormFieldsFieldCustomLabel from '@salesforce/label/c.geHelpTextFormFieldsFieldCustomLabel';
import geHelpTextFormFieldsFieldLabelLabel from '@salesforce/label/c.geHelpTextFormFieldsFieldLabelLabel';
import geLabelCustomTableSelectedFields from '@salesforce/label/c.geLabelCustomTableSelectedFields';
import geLabelCustomTableSourceFields from '@salesforce/label/c.geLabelCustomTableSourceFields';
import geLabelSectionName from '@salesforce/label/c.geLabelSectionName';
import geLabelTemplateInfoDescriptionField from '@salesforce/label/c.geLabelTemplateInfoDescriptionField';
import geLabelTemplateInfoNameField from '@salesforce/label/c.geLabelTemplateInfoNameField';
import geSearchPlaceholder from '@salesforce/label/c.geSearchPlaceholder';
import geTabBatchHeader from '@salesforce/label/c.geTabBatchHeader';
import geTabFormFields from '@salesforce/label/c.geTabFormFields';
import geTabTemplateInfo from '@salesforce/label/c.geTabTemplateInfo';
import geTextListViewItemCount from '@salesforce/label/c.geTextListViewItemCount';
import geTextListViewItemsCount from '@salesforce/label/c.geTextListViewItemsCount';
import geTextListViewSortedBy from '@salesforce/label/c.geTextListViewSortedBy';
import geTextListViewUpdatedAgo from '@salesforce/label/c.geTextListViewUpdatedAgo';
import geToastListViewUpdated from '@salesforce/label/c.geToastListViewUpdated';
import geToastSaveFailed from '@salesforce/label/c.geToastSaveFailed';
import geToastSelectActiveSection from '@salesforce/label/c.geToastSelectActiveSection';
import geToastTemplateCreateSuccess from '@salesforce/label/c.geToastTemplateCreateSuccess';
import geToastTemplateDeleteSuccess from '@salesforce/label/c.geToastTemplateDeleteSuccess';
import geToastTemplateTabError from '@salesforce/label/c.geToastTemplateTabError';
import geToastTemplateTabsError from '@salesforce/label/c.geToastTemplateTabsError';
import geToastTemplateUpdateSuccess from '@salesforce/label/c.geToastTemplateUpdateSuccess';
import geWarningFormFieldsModalDeleteSection from '@salesforce/label/c.geWarningFormFieldsModalDeleteSection';

class GeLabelService {

    /*******************************************************************************
    * @description Expose imported custom labels. We freeze this object because any
    * import of this service component within the same session is shared across
    * components. We disallow mutations of labels at this level. Components importing
    * the provided labels must clone in order to mutate/format the labels. A 'format'
    * utility method is provided.
    */
    CUSTOM_LABELS = Object.freeze({
        commonAssistiveError,
        commonAssistiveInfo,
        commonAssistiveSuccess,
        commonAssistiveWarning,
        commonBatches,
        commonCancel,
        commonClone,
        commonDefaultValue,
        commonDelete,
        commonEdit,
        commonError,
        commonFieldLabel,
        commonNoItems,
        commonReadMore,
        commonRequired,
        commonSave,
        commonSaveAndClose,
        commonTemplates,
        commonUnknownError,
        commonViewAll,
        commonViewMore,
        commonWarning,
        geAssistiveActiveSection,
        geAssistiveBatchHeaderRemoveField,
        geAssistiveFieldDown,
        geAssistiveFieldUp,
        geAssistiveFormFieldsCollapseAll,
        geAssistiveFormFieldsExpandAll,
        geAssistiveFormFieldsRemoveField,
        geAssistiveFormFieldsSectionEdit,
        geAssistiveModalCancelAndDiscard,
        geAssistiveSectionDown,
        geAssistiveSectionUp,
        geAssistiveShowMenu,
        geAssistiveSpinner,
        geBodyBatchHeaderLeftCol,
        geBodyBatchHeaderRightCol,
        geBodyBatchHeaderWarning,
        geBodyEmptyFormSection,
        geBodyFormFieldsLeftCol,
        geBodyFormFieldsLeftColAdditional,
        geBodyFormFieldsModalDeleteSection,
        geBodyFormFieldsRightCol,
        geBodyTemplateInfoLeftCol,
        geBodyTemplatesTabDescription,
        geButtonBuilderNavBackFormFields,
        geButtonBuilderNavBackTemplateInfo,
        geButtonBuilderNavBatchHeader,
        geButtonBuilderNavFormFields,
        geButtonEnterGifts,
        geButtonFormFieldsAddSection,
        geButtonFormFieldsCollapseAll,
        geButtonFormFieldsExpandAll,
        geButtonFormFieldsModalDeleteSectionAndFields,
        geButtonTemplatesTabCreateTemplate,
        geErrorCompleteThisField,
        geErrorExistingTemplateName,
        geErrorFieldPermission,
        geErrorPageLevelAdvancedMappingBody,
        geErrorPageLevelAdvancedMappingHeader,
        geErrorPageLevelFieldPermission1,
        geErrorPageLevelFieldPermission2,
        geErrorPageLevelMissingRequiredFields,
        geErrorPageLevelMissingRequiredGroupFields,
        geErrorRequiredField,
        geHeaderBatchHeaderLeftCol,
        geHeaderBatchHeaderRightCol,
        geHeaderCustomTableHeaders,
        geHeaderEmptyFormSection,
        geHeaderFormFieldsDefaultSectionName,
        geHeaderFormFieldsLeftCol,
        geHeaderFormFieldsModalDeleteSection,
        geHeaderFormFieldsModalRenameSection,
        geHeaderFormFieldsModalSectionSettings,
        geHeaderFormFieldsRightCol,
        geHeaderGiftEntry,
        geHeaderNewSection,
        geHeaderNewTemplate,
        geHeaderPageLevelError,
        geHeaderTemplateInfoLeftCol,
        geHelpTextBatchHeaderFieldLabelLabel,
        geHelpTextFormFieldsFieldCustomLabel,
        geHelpTextFormFieldsFieldLabelLabel,
        geLabelCustomTableSelectedFields,
        geLabelCustomTableSourceFields,
        geLabelSectionName,
        geLabelTemplateInfoDescriptionField,
        geLabelTemplateInfoNameField,
        geAssistiveRemoveSelectedOption,
        geSearchPlaceholder,
        geTabBatchHeader,
        geTabFormFields,
        geTabTemplateInfo,
        geTextListViewItemCount,
        geTextListViewItemsCount,
        geTextListViewSortedBy,
        geTextListViewUpdatedAgo,
        geToastListViewUpdated,
        geToastSaveFailed,
        geToastSelectActiveSection,
        geToastTemplateCreateSuccess,
        geToastTemplateDeleteSuccess,
        geToastTemplateTabError,
        geToastTemplateTabsError,
        geToastTemplateUpdateSuccess,
        geWarningFormFieldsModalDeleteSection,
    });

    /*******************************************************************************
    * @description Pass through method for imported 'format' utility method.
    * Javascript method comparable to Apex's String.format(...).
    * Replaces placeholders in Custom Labels ({0}, {1}, etc) with provided values.
    *
    * @param {string} string: Custom Label to be formatted.
    * @param {list} replacements: List of string to use as replacements.
    * @return {string} formattedString: Formatted custom label
    */
    format = (string, replacements) => format(string, replacements);
}

export default new GeLabelService();<commit_msg>include new gift entry label in geLabelService<commit_after>// Import utility method
import { format } from 'c/utilCommon';

// Import custom labels
import commonAssistiveError from '@salesforce/label/c.commonAssistiveError';
import commonAssistiveInfo from '@salesforce/label/c.commonAssistiveInfo';
import commonAssistiveSuccess from '@salesforce/label/c.commonAssistiveSuccess';
import commonAssistiveWarning from '@salesforce/label/c.commonAssistiveWarning';
import commonBatches from '@salesforce/label/c.commonBatches';
import commonCancel from '@salesforce/label/c.commonCancel';
import commonClone from '@salesforce/label/c.commonClone';
import commonDefaultValue from '@salesforce/label/c.commonDefaultValue';
import commonDelete from '@salesforce/label/c.commonDelete';
import commonEdit from '@salesforce/label/c.commonEdit';
import commonError from '@salesforce/label/c.commonError';
import commonFieldLabel from '@salesforce/label/c.commonFieldLabel';
import commonNoItems from '@salesforce/label/c.commonNoItems';
import commonReadMore from '@salesforce/label/c.commonReadMore';
import commonRequired from '@salesforce/label/c.commonRequired';
import commonSave from '@salesforce/label/c.commonSave';
import commonSaveAndClose from '@salesforce/label/c.commonSaveAndClose';
import commonTemplates from '@salesforce/label/c.commonTemplates';
import commonUnknownError from '@salesforce/label/c.commonUnknownError';
import commonViewAll from '@salesforce/label/c.commonViewAll';
import commonViewMore from '@salesforce/label/c.commonViewMore';
import commonWarning from '@salesforce/label/c.commonWarning';
import geAssistiveActiveSection from '@salesforce/label/c.geAssistiveActiveSection';
import geAssistiveBatchHeaderRemoveField from '@salesforce/label/c.geAssistiveBatchHeaderRemoveField';
import geAssistiveFieldDown from '@salesforce/label/c.geAssistiveFieldDown';
import geAssistiveFieldUp from '@salesforce/label/c.geAssistiveFieldUp';
import geAssistiveFormFieldsCollapseAll from '@salesforce/label/c.geAssistiveFormFieldsCollapseAll';
import geAssistiveFormFieldsExpandAll from '@salesforce/label/c.geAssistiveFormFieldsExpandAll';
import geAssistiveFormFieldsRemoveField from '@salesforce/label/c.geAssistiveFormFieldsRemoveField';
import geAssistiveFormFieldsSectionEdit from '@salesforce/label/c.geAssistiveFormFieldsSectionEdit';
import geAssistiveModalCancelAndDiscard from '@salesforce/label/c.geAssistiveModalCancelAndDiscard';
import geAssistiveRemoveSelectedOption from '@salesforce/label/c.geAssistiveRemoveSelectedOption';
import geAssistiveSectionDown from '@salesforce/label/c.geAssistiveSectionDown';
import geAssistiveSectionUp from '@salesforce/label/c.geAssistiveSectionUp';
import geAssistiveShowMenu from '@salesforce/label/c.geAssistiveShowMenu';
import geAssistiveSpinner from '@salesforce/label/c.geAssistiveSpinner';
import geBodyBatchHeaderLeftCol from '@salesforce/label/c.geBodyBatchHeaderLeftCol';
import geBodyBatchHeaderRightCol from '@salesforce/label/c.geBodyBatchHeaderRightCol';
import geBodyBatchHeaderWarning from '@salesforce/label/c.geBodyBatchHeaderWarning';
import geBodyEmptyFormSection from '@salesforce/label/c.geBodyEmptyFormSection';
import geBodyFormFieldsLeftCol from '@salesforce/label/c.geBodyFormFieldsLeftCol';
import geBodyFormFieldsLeftColAdditional from '@salesforce/label/c.geBodyFormFieldsLeftColAdditional';
import geBodyFormFieldsModalDeleteSection from '@salesforce/label/c.geBodyFormFieldsModalDeleteSection';
import geBodyFormFieldsRightCol from '@salesforce/label/c.geBodyFormFieldsRightCol';
import geBodyTemplateInfoLeftCol from '@salesforce/label/c.geBodyTemplateInfoLeftCol';
import geBodyTemplatesTabDescription from '@salesforce/label/c.geBodyTemplatesTabDescription';
import geButtonBuilderNavBackFormFields from '@salesforce/label/c.geButtonBuilderNavBackFormFields';
import geButtonBuilderNavBackTemplateInfo from '@salesforce/label/c.geButtonBuilderNavBackTemplateInfo';
import geButtonBuilderNavBatchHeader from '@salesforce/label/c.geButtonBuilderNavBatchHeader';
import geButtonBuilderNavFormFields from '@salesforce/label/c.geButtonBuilderNavFormFields';
import geButtonEnterGifts from '@salesforce/label/c.geButtonEnterGifts';
import geButtonFormFieldsAddSection from '@salesforce/label/c.geButtonFormFieldsAddSection';
import geButtonFormFieldsCollapseAll from '@salesforce/label/c.geButtonFormFieldsCollapseAll';
import geButtonFormFieldsExpandAll from '@salesforce/label/c.geButtonFormFieldsExpandAll';
import geButtonFormFieldsModalDeleteSectionAndFields from '@salesforce/label/c.geButtonFormFieldsModalDeleteSectionAndFields';
import geButtonTemplatesTabCreateTemplate from '@salesforce/label/c.geButtonTemplatesTabCreateTemplate';
import geErrorCompleteThisField from '@salesforce/label/c.geErrorCompleteThisField';
import geErrorExistingTemplateName from '@salesforce/label/c.geErrorExistingTemplateName';
import geErrorDonorTypeValidation from '@salesforce/label/c.geErrorDonorTypeValidation';
import geErrorFieldPermission from '@salesforce/label/c.geErrorFieldPermission';
import geErrorPageLevelAdvancedMappingBody from '@salesforce/label/c.geErrorPageLevelAdvancedMappingBody';
import geErrorPageLevelAdvancedMappingHeader from '@salesforce/label/c.geErrorPageLevelAdvancedMappingHeader';
import geErrorPageLevelFieldPermission1 from '@salesforce/label/c.geErrorPageLevelFieldPermission1';
import geErrorPageLevelFieldPermission2 from '@salesforce/label/c.geErrorPageLevelFieldPermission2';
import geErrorPageLevelMissingRequiredFields from '@salesforce/label/c.geErrorPageLevelMissingRequiredFields';
import geErrorPageLevelMissingRequiredGroupFields from '@salesforce/label/c.geErrorPageLevelMissingRequiredGroupFields';
import geErrorRequiredField from '@salesforce/label/c.geErrorRequiredField';
import geHeaderBatchHeaderLeftCol from '@salesforce/label/c.geHeaderBatchHeaderLeftCol';
import geHeaderBatchHeaderRightCol from '@salesforce/label/c.geHeaderBatchHeaderRightCol';
import geHeaderCustomTableHeaders from '@salesforce/label/c.geHeaderCustomTableHeaders';
import geHeaderEmptyFormSection from '@salesforce/label/c.geHeaderEmptyFormSection';
import geHeaderFormFieldsDefaultSectionName from '@salesforce/label/c.geHeaderFormFieldsDefaultSectionName';
import geHeaderFormFieldsLeftCol from '@salesforce/label/c.geHeaderFormFieldsLeftCol';
import geHeaderFormFieldsModalDeleteSection from '@salesforce/label/c.geHeaderFormFieldsModalDeleteSection';
import geHeaderFormFieldsModalRenameSection from '@salesforce/label/c.geHeaderFormFieldsModalRenameSection';
import geHeaderFormFieldsModalSectionSettings from '@salesforce/label/c.geHeaderFormFieldsModalSectionSettings';
import geHeaderFormFieldsRightCol from '@salesforce/label/c.geHeaderFormFieldsRightCol';
import geHeaderGiftEntry from '@salesforce/label/c.geHeaderGiftEntry';
import geHeaderNewSection from '@salesforce/label/c.geHeaderNewSection';
import geHeaderNewTemplate from '@salesforce/label/c.geHeaderNewTemplate';
import geHeaderPageLevelError from '@salesforce/label/c.geHeaderPageLevelError';
import geHeaderTemplateInfoLeftCol from '@salesforce/label/c.geHeaderTemplateInfoLeftCol';
import geHelpTextBatchHeaderFieldLabelLabel from '@salesforce/label/c.geHelpTextBatchHeaderFieldLabelLabel';
import geHelpTextFormFieldsFieldCustomLabel from '@salesforce/label/c.geHelpTextFormFieldsFieldCustomLabel';
import geHelpTextFormFieldsFieldLabelLabel from '@salesforce/label/c.geHelpTextFormFieldsFieldLabelLabel';
import geLabelCustomTableSelectedFields from '@salesforce/label/c.geLabelCustomTableSelectedFields';
import geLabelCustomTableSourceFields from '@salesforce/label/c.geLabelCustomTableSourceFields';
import geLabelSectionName from '@salesforce/label/c.geLabelSectionName';
import geLabelTemplateInfoDescriptionField from '@salesforce/label/c.geLabelTemplateInfoDescriptionField';
import geLabelTemplateInfoNameField from '@salesforce/label/c.geLabelTemplateInfoNameField';
import geSearchPlaceholder from '@salesforce/label/c.geSearchPlaceholder';
import geTabBatchHeader from '@salesforce/label/c.geTabBatchHeader';
import geTabFormFields from '@salesforce/label/c.geTabFormFields';
import geTabTemplateInfo from '@salesforce/label/c.geTabTemplateInfo';
import geTextListViewItemCount from '@salesforce/label/c.geTextListViewItemCount';
import geTextListViewItemsCount from '@salesforce/label/c.geTextListViewItemsCount';
import geTextListViewSortedBy from '@salesforce/label/c.geTextListViewSortedBy';
import geTextListViewUpdatedAgo from '@salesforce/label/c.geTextListViewUpdatedAgo';
import geToastListViewUpdated from '@salesforce/label/c.geToastListViewUpdated';
import geToastSaveFailed from '@salesforce/label/c.geToastSaveFailed';
import geToastSelectActiveSection from '@salesforce/label/c.geToastSelectActiveSection';
import geToastTemplateCreateSuccess from '@salesforce/label/c.geToastTemplateCreateSuccess';
import geToastTemplateDeleteSuccess from '@salesforce/label/c.geToastTemplateDeleteSuccess';
import geToastTemplateTabError from '@salesforce/label/c.geToastTemplateTabError';
import geToastTemplateTabsError from '@salesforce/label/c.geToastTemplateTabsError';
import geToastTemplateUpdateSuccess from '@salesforce/label/c.geToastTemplateUpdateSuccess';
import geWarningFormFieldsModalDeleteSection from '@salesforce/label/c.geWarningFormFieldsModalDeleteSection';

class GeLabelService {

    /*******************************************************************************
    * @description Expose imported custom labels. We freeze this object because any
    * import of this service component within the same session is shared across
    * components. We disallow mutations of labels at this level. Components importing
    * the provided labels must clone in order to mutate/format the labels. A 'format'
    * utility method is provided.
    */
    CUSTOM_LABELS = Object.freeze({
        commonAssistiveError,
        commonAssistiveInfo,
        commonAssistiveSuccess,
        commonAssistiveWarning,
        commonBatches,
        commonCancel,
        commonClone,
        commonDefaultValue,
        commonDelete,
        commonEdit,
        commonError,
        commonFieldLabel,
        commonNoItems,
        commonReadMore,
        commonRequired,
        commonSave,
        commonSaveAndClose,
        commonTemplates,
        commonUnknownError,
        commonViewAll,
        commonViewMore,
        commonWarning,
        geAssistiveActiveSection,
        geAssistiveBatchHeaderRemoveField,
        geAssistiveFieldDown,
        geAssistiveFieldUp,
        geAssistiveFormFieldsCollapseAll,
        geAssistiveFormFieldsExpandAll,
        geAssistiveFormFieldsRemoveField,
        geAssistiveFormFieldsSectionEdit,
        geAssistiveModalCancelAndDiscard,
        geAssistiveSectionDown,
        geAssistiveSectionUp,
        geAssistiveShowMenu,
        geAssistiveSpinner,
        geBodyBatchHeaderLeftCol,
        geBodyBatchHeaderRightCol,
        geBodyBatchHeaderWarning,
        geBodyEmptyFormSection,
        geBodyFormFieldsLeftCol,
        geBodyFormFieldsLeftColAdditional,
        geBodyFormFieldsModalDeleteSection,
        geBodyFormFieldsRightCol,
        geBodyTemplateInfoLeftCol,
        geBodyTemplatesTabDescription,
        geButtonBuilderNavBackFormFields,
        geButtonBuilderNavBackTemplateInfo,
        geButtonBuilderNavBatchHeader,
        geButtonBuilderNavFormFields,
        geButtonEnterGifts,
        geButtonFormFieldsAddSection,
        geButtonFormFieldsCollapseAll,
        geButtonFormFieldsExpandAll,
        geButtonFormFieldsModalDeleteSectionAndFields,
        geButtonTemplatesTabCreateTemplate,
        geErrorCompleteThisField,
        geErrorDonorTypeValidation,
        geErrorExistingTemplateName,
        geErrorFieldPermission,
        geErrorPageLevelAdvancedMappingBody,
        geErrorPageLevelAdvancedMappingHeader,
        geErrorPageLevelFieldPermission1,
        geErrorPageLevelFieldPermission2,
        geErrorPageLevelMissingRequiredFields,
        geErrorPageLevelMissingRequiredGroupFields,
        geErrorRequiredField,
        geHeaderBatchHeaderLeftCol,
        geHeaderBatchHeaderRightCol,
        geHeaderCustomTableHeaders,
        geHeaderEmptyFormSection,
        geHeaderFormFieldsDefaultSectionName,
        geHeaderFormFieldsLeftCol,
        geHeaderFormFieldsModalDeleteSection,
        geHeaderFormFieldsModalRenameSection,
        geHeaderFormFieldsModalSectionSettings,
        geHeaderFormFieldsRightCol,
        geHeaderGiftEntry,
        geHeaderNewSection,
        geHeaderNewTemplate,
        geHeaderPageLevelError,
        geHeaderTemplateInfoLeftCol,
        geHelpTextBatchHeaderFieldLabelLabel,
        geHelpTextFormFieldsFieldCustomLabel,
        geHelpTextFormFieldsFieldLabelLabel,
        geLabelCustomTableSelectedFields,
        geLabelCustomTableSourceFields,
        geLabelSectionName,
        geLabelTemplateInfoDescriptionField,
        geLabelTemplateInfoNameField,
        geAssistiveRemoveSelectedOption,
        geSearchPlaceholder,
        geTabBatchHeader,
        geTabFormFields,
        geTabTemplateInfo,
        geTextListViewItemCount,
        geTextListViewItemsCount,
        geTextListViewSortedBy,
        geTextListViewUpdatedAgo,
        geToastListViewUpdated,
        geToastSaveFailed,
        geToastSelectActiveSection,
        geToastTemplateCreateSuccess,
        geToastTemplateDeleteSuccess,
        geToastTemplateTabError,
        geToastTemplateTabsError,
        geToastTemplateUpdateSuccess,
        geWarningFormFieldsModalDeleteSection,
    });

    /*******************************************************************************
    * @description Pass through method for imported 'format' utility method.
    * Javascript method comparable to Apex's String.format(...).
    * Replaces placeholders in Custom Labels ({0}, {1}, etc) with provided values.
    *
    * @param {string} string: Custom Label to be formatted.
    * @param {list} replacements: List of string to use as replacements.
    * @return {string} formattedString: Formatted custom label
    */
    format = (string, replacements) => format(string, replacements);
}

export default new GeLabelService();<|endoftext|>


<commit_before>
var expect = require('chai').expect;
var polyfillLoader = require('./../../index.js');

describe('Browser Feature detection Tests for IE 11', function() {

    before(function() {
        // runs before all tests in this block
        window = {};
        //window.Promise = function() {};
    });

    it('shoud accept multiple features', function() {

        var features = "Promise";
        expect(polyfillLoader.detectBrowserFeatures(features)).to.be.deep.eq(["Promise"]);
    });
});
<commit_msg>update feature detection test<commit_after>
var expect = require('chai').expect;
var polyfillLoader = require('./../../index.js');

describe('Browser Feature detection Tests for IE 11', function() {

    // TODO: Continue applying this Feature Detection method
    // https://polyfill.io/v2/docs/examples

    before(function() {
        // runs before all tests in this block
        window = {};
        //window.Promise = function() {};
    });

    it('shoud accept multiple features', function() {

        var features = "Promise";
        expect(polyfillLoader.detectBrowserFeatures(features)).to.be.deep.eq(["Promise"]);
    });
});
<|endoftext|>


<commit_before>/**
 * Copyright 2014 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

var should = require("should");
var path = require('path');
var fs = require('fs-extra');
var mkdirp = require('mkdirp');

var tailNode = require("../../../../nodes/core/storage/28-tail.js");
var helper = require("../../helper.js");

describe('TailNode', function() {

    var resourcesDir = path.join(__dirname,"..","..","..","resources");
    var fileToTail = path.join(resourcesDir,"28-tail-test-file.txt");

    beforeEach(function(done) {
        fs.writeFileSync(fileToTail, "Tail message line 1\nTail message line 2\n");
        helper.startServer(done);
    });

    afterEach(function(done) {
        helper.unload().then(function() {
            fs.unlinkSync(fileToTail);
            helper.stopServer(done);
        });
    });

    it('should be loaded', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            tailNode1.should.have.property('name', 'tailNode');
            done();
        });
    });

    it('tail should tail a file', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            var inputCounter = 0;
            helperNode1.on("input", function(msg) {
                //console.log(msg);
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line " + (++inputCounter + 2));
                if (inputCounter === 2) {
                    done();
                }
            });
            setTimeout( function() {
                fs.appendFileSync(fileToTail, "Tail message line 3\n");
                fs.appendFileSync(fileToTail, "Tail message line 4\n");
            },100);
        });
    });

    it('tail should work in non-split mode', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":false, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            helperNode1.on("input", function(msg) {
                //console.log(msg);
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line 5\nTail message line 6\n");
                done();
            });
            setTimeout( function() {
                fs.appendFileSync(fileToTail, "Tail message line 5\nTail message line 6\n");
            },150);
        });
    });

    it('tail should handle a non-existent file', function(done) {
        fs.unlinkSync(fileToTail);
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            helperNode1.on("input", function(msg) {
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line");
                done();
            });
            setTimeout( function() {
                fs.writeFileSync(fileToTail, "Tail message line\n");
            },150);
        });
    });

    it('tail should handle file truncation', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            var inputCounter = 0;
            var warned = false;
            tailNode1.on("log", function(msg) {
                if (msg.level == "warn") { warned = true; }
            });
            helperNode1.on("input", function(msg) {
                msg.should.have.property('topic', fileToTail);
                inputCounter++;
                if (inputCounter === 1) {
                    warned.should.be.false;
                    msg.payload.should.equal("Tail message line append");
                } else if (inputCounter === 2) {
                    msg.payload.should.equal("Tail message line truncate");
                } else {
                    msg.payload.should.equal("Tail message line append "+inputCounter);
                }

                if (inputCounter === 5) {
                    setTimeout(function() {
                        warned.should.be.true;
                        done();
                    },100);
                }
            });
            setTimeout( function() {
                fs.appendFileSync(fileToTail, "Tail message line append\n");
                fs.writeFileSync(fileToTail, "Tail message line truncate\n");
                fs.appendFileSync(fileToTail, "Tail message line append 3\n");
                fs.appendFileSync(fileToTail, "Tail message line append 4\n");
                fs.appendFileSync(fileToTail, "Tail message line append 5\n");
            },150);
        });
    });

});
<commit_msg>Add more delays to tail node test<commit_after>/**
 * Copyright 2014 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

var should = require("should");
var path = require('path');
var fs = require('fs-extra');
var mkdirp = require('mkdirp');

var tailNode = require("../../../../nodes/core/storage/28-tail.js");
var helper = require("../../helper.js");

describe('TailNode', function() {

    var resourcesDir = path.join(__dirname,"..","..","..","resources");
    var fileToTail = path.join(resourcesDir,"28-tail-test-file.txt");

    beforeEach(function(done) {
        fs.writeFileSync(fileToTail, "Tail message line 1\nTail message line 2\n");
        helper.startServer(done);
    });

    afterEach(function(done) {
        helper.unload().then(function() {
            fs.unlinkSync(fileToTail);
            helper.stopServer(done);
        });
    });

    it('should be loaded', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            tailNode1.should.have.property('name', 'tailNode');
            done();
        });
    });

    it('tail should tail a file', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            var inputCounter = 0;
            helperNode1.on("input", function(msg) {
                //console.log(msg);
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line " + (++inputCounter + 2));
                if (inputCounter === 2) {
                    done();
                }
            });
            setTimeout( function() {
                fs.appendFileSync(fileToTail, "Tail message line 3\n");
                fs.appendFileSync(fileToTail, "Tail message line 4\n");
            },100);
        });
    });

    it('tail should work in non-split mode', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":false, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            helperNode1.on("input", function(msg) {
                //console.log(msg);
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line 5\nTail message line 6\n");
                done();
            });
            setTimeout( function() {
                fs.appendFileSync(fileToTail, "Tail message line 5\nTail message line 6\n");
            },150);
        });
    });

    it('tail should handle a non-existent file', function(done) {
        fs.unlinkSync(fileToTail);
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            helperNode1.on("input", function(msg) {
                msg.should.have.property('topic', fileToTail);
                msg.payload.should.equal("Tail message line");
                done();
            });
            setTimeout( function() {
                fs.writeFileSync(fileToTail, "Tail message line\n");
            },150);
        });
    });

    it('tail should handle file truncation', function(done) {
        var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail, "wires":[["helperNode1"]]},
                    {id:"helperNode1", type:"helper", wires:[]}];
        helper.load(tailNode, flow, function() {
            var tailNode1 = helper.getNode("tailNode1");
            var helperNode1 = helper.getNode("helperNode1");
            var inputCounter = 0;
            var warned = false;
            tailNode1.on("log", function(msg) {
                if (msg.level == "warn") { warned = true; }
            });
            helperNode1.on("input", function(msg) {
                console.log("inputCounter =",inputCounter);
                console.log(msg);
                msg.should.have.property('topic', fileToTail);
                inputCounter++;
                if (inputCounter === 1) {
                    warned.should.be.false;
                    msg.payload.should.equal("Tail message line append");
                } else if (inputCounter === 2) {
                    msg.payload.should.equal("Tail message line truncate");
                } else {
                    msg.payload.should.equal("Tail message line append "+inputCounter);
                }

                if (inputCounter === 5) {
                    setTimeout(function() {
                        warned.should.be.true;
                        done();
                    },100);
                }
            });
            var actions = [
                function() { fs.appendFileSync(fileToTail, "Tail message line append\n");},
                function() { fs.writeFileSync(fileToTail, "Tail message line truncate\n");},
                function() { fs.appendFileSync(fileToTail, "Tail message line append 3\n");},
                function() { fs.appendFileSync(fileToTail, "Tail message line append 4\n");},
                function() { fs.appendFileSync(fileToTail, "Tail message line append 5\n");}
            ];

            function processAction() {
                var action = actions.shift();
                action();
                if (actions.length > 0) {
                    setTimeout(function() {
                        processAction();
                    },250);
                }
            }
            setTimeout( function() {
                processAction();
            },150);
        });
    });

});
<|endoftext|>


<commit_before>import test from "ava";

import ChunkManifestPlugin from "../src/chunk-manifest-webpack-plugin";

test.cb("replace runtime's chunk manifest with lookup", t => {
  const chunkIdVariableName = "a-chunk-id-variable";
  const manifestVariable = "manifest-variable";
  const placeholder = `"__CHUNK_MANIFEST__"`;

  const runtimeSource = [
    "runtime-source-start",
    placeholder,
    ";",
    "runtime-source-end"
  ];

  let expected = [...runtimeSource];
  expected[1] = `window["${manifestVariable}"][${chunkIdVariableName}]`;

  const compilationPluginEvent = (compilationEvent, ensure) => {
    if (compilationEvent === "require-ensure") {
      const updatedSource = ensure(
        runtimeSource.join(""),
        undefined,
        undefined,
        chunkIdVariableName
      );
      t.is(updatedSource, expected.join(""));
      t.end();
    }
  };

  const pluginEvent = (event, compile) => {
    if (event === "compilation") {
      const compilation = {
        mainTemplate: {
          plugin: compilationPluginEvent
        }
      };
      compile(compilation);
    }
  };

  const fakeCompiler = { plugin: pluginEvent };

  const plugin = new ChunkManifestPlugin({
    manifestVariable
  });

  plugin.plugins = [{ apply: () => {} }];
  plugin.apply(fakeCompiler);
});
<commit_msg>Removed unused mock<commit_after>import test from "ava";

import ChunkManifestPlugin from "../src/chunk-manifest-webpack-plugin";

test.cb("replace runtime's chunk manifest with lookup", t => {
  const chunkIdVariableName = "a-chunk-id-variable";
  const manifestVariable = "manifest-variable";
  const placeholder = `"__CHUNK_MANIFEST__"`;

  const runtimeSource = [
    "runtime-source-start",
    placeholder,
    ";",
    "runtime-source-end"
  ];

  let expected = [...runtimeSource];
  expected[1] = `window["${manifestVariable}"][${chunkIdVariableName}]`;

  const compilationPluginEvent = (compilationEvent, ensure) => {
    if (compilationEvent === "require-ensure") {
      const updatedSource = ensure(
        runtimeSource.join(""),
        undefined,
        undefined,
        chunkIdVariableName
      );
      t.is(updatedSource, expected.join(""));
      t.end();
    }
  };

  const pluginEvent = (event, compile) => {
    if (event === "compilation") {
      const compilation = {
        mainTemplate: {
          plugin: compilationPluginEvent
        }
      };
      compile(compilation);
    }
  };

  const fakeCompiler = { plugin: pluginEvent };

  const plugin = new ChunkManifestPlugin({
    manifestVariable
  });

  plugin.apply(fakeCompiler);
});
<|endoftext|>


<commit_before>import styled from 'styled-components';

export const ResultsListWrapper = styled.div`
  margin: 0 auto 40px auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
`;

export const ResultsListHeader = styled.p`
  text-align: center;
  margin: 32px 0;
  font-size: 28px;
  font-weight: bold;
  color: ${(props) => props.theme.colors.darkGreen};
`;

export const ResultsListItemWrapper = styled.div`
  margin: 8px;
  max-width: 340px;
  flex: 0 1 calc(33% - 16px);

  display: flex;
  flex-direction: column;

  border: solid 2px ${(props) => props.theme.colors.darkGreen};
  border-radius: 12px;

  @media (max-width: 1200px) {
    flex: 0 1 50%;
  }

  @media (max-width: 700px) {
    flex: 0 1 100%;
  }
`;

export const PageWrapper = styled.a`
  display: block;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  padding: 10px;
  align-items: center;
  height: 80px;
  cursor: pointer;
  color: black;
  background-color: ${(props) => props.backgroundColor};
  }

  &:first-of-type {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }

  &:last-of-type {
    border-bottom: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }

  &:hover {
    background: ${(props) => props.theme.colors.gray};
  }
`;

export const PageInnerWrapper = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 68px;
  flex: 1;
`;

export const PageImage = styled.img`
  width: 60px;
  height: 60px;
  margin-right: 12px;
  border-radius: 8px;
  border: solid 1px black;
  background-color: ${(props) => props.theme.colors.gray};
`;

export const PageTitle = styled.p`
  font-size: 16px;
`;

export const PageDescription = styled.p`
  font-size: 12px;
  max-height: 46px;
  overflow: hidden;
`;
<commit_msg>Made results list more colorblind friendly and easier on the eyes<commit_after>import styled from 'styled-components';

export const ResultsListWrapper = styled.div`
  margin: 0 auto 40px auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: center;
`;

export const ResultsListHeader = styled.p`
  text-align: center;
  margin: 32px 0;
  font-size: 28px;
  font-weight: bold;
  color: ${(props) => props.theme.colors.darkGreen};
`;

export const ResultsListItemWrapper = styled.div`
  margin: 8px;
  max-width: 340px;
  flex: 0 1 calc(33% - 16px);

  display: flex;
  flex-direction: column;

  border: solid 2px ${(props) => props.theme.colors.darkGreen};
  border-radius: 12px;

  @media (max-width: 1200px) {
    flex: 0 1 50%;
  }

  @media (max-width: 700px) {
    flex: 0 1 100%;
  }
`;

export const PageWrapper = styled.a`
  display: block;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: row;
  padding: 10px;
  align-items: center;
  height: 80px;
  cursor: pointer;
  color: ${(props) => props.theme.colors.darkGreen};
  border-bottom: solid 1px ${(props) => props.theme.colors.darkGreen};
  border-left: solid 12px ${(props) => props.backgroundColor};
  background-color: ${(props) => props.theme.colors.creme};

  &:first-of-type {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }

  &:last-of-type {
    border-bottom: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }

  &:hover {
    background: ${(props) => props.theme.colors.gray};
  }
`;

export const PageInnerWrapper = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 68px;
  flex: 1;
`;

export const PageImage = styled.img`
  width: 60px;
  height: 60px;
  margin-right: 12px;
  border-radius: 8px;
  border: solid 1px ${(props) => props.theme.colors.darkGreen};
  background-color: ${(props) => props.theme.colors.gray};
`;

export const PageTitle = styled.p`
  font-size: 16px;
`;

export const PageDescription = styled.p`
  font-size: 12px;
  max-height: 46px;
  overflow: hidden;
`;
<|endoftext|>