Rally Software

 View Only
  • 1.  Modify Hidden Fields in Custom App

    Posted Dec 05, 2019 01:00 PM
    Hi,

    I'm trying to show and modify a field this field is a hidden meaning it is not visible to any projects. This is because I don't want this field to show in the defect view window, only show in the app that I'm developing. I am able to render the field to the UI using 'renderer' and returning the record.get('c_fieldName') this is contained in a 'rallygrid' . Although I noticed I am not able to edit the field and therefore won't be able to keep track of data entered in this field. Is there a way to allow this field to be modified and retain its data?

    Thanks,

    ~Zach


  • 2.  RE: Modify Hidden Fields in Custom App

    Broadcom Employee
    Posted Dec 09, 2019 09:57 AM
    Hi Zach, if the field is hidden and you can still see it, that would suggest that you have admin rights. However, it sounds like the issue is in your app that you are running from your admin login.

    I might need to see some of your code to fully understand what is going on, but my first guess would be that you have fetched data (e.g. UserStories) and put them into either a custom store or an artifact store. I have noticed that when you do this, the records are marked with { updatable: false }. This would prevent you from modifying the field. If this is what you are doing, can you try putting the data into a Rally.data.wsapi.Store and give it the model type of the records you are fetching and see what it does then?

    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 3.  RE: Modify Hidden Fields in Custom App

    Posted Dec 09, 2019 10:51 AM
    Hi Nik,

    Thanks for getting back to me. Im not actually seeing the ''true field" field which is the problem and maybe the code below will help show that. I also probably need to explain my use case a little better.

    Use Case:
    I created a hidden field  for defects which doesn't show up in the defect window when you look at a defect. So far this behavior is correct. The idea being this field is only visible and editable from the app that I am creating. The reason for this is because it allows our teams to perform reviews and note lessons learned that can be brought up during a review.

    Problem:
    The problem I face is since it is a hidden field the rally grid seems to ignore it when I add it to the columnCfgs I have to do it manually and because I did it this way you can't edit or add data.

    {
       xtype: 'rallygrid',
       showPagingToolbar: true,
       showRowActionsColumn: false,
       enableEditing: true,
       itemId: "defectView",
       height: 300,
       width: 1000,
       storeConfig: {
    	model: 'defect',
    	filters: newFilters,
    	//fetch: ['FormattedID','Name','c_DefectType','c_LessonsLearned']
       },
       columnCfgs: [
    	
    	{
    		text: "ID",
    		dataIndex: 'FormattedID',
    		flex: 1
    	},
    	{
    		text: "Name",
    		dataIndex: 'Name',
    		flex: 1
    	},
    	{
    		text: "Defect Type",
    		dataIndex: 'c_DefectType',
    		flex:1
    	},
    	{
    		text: "Lessons Learned",
    		renderer: function(value,meta,record)
    		{
    			return record.get('c_LessonsLearned');
    		},
    	},
       ]
    };


    Hope this helped
    Thanks,
    ~Zach


  • 4.  RE: Modify Hidden Fields in Custom App

    Broadcom Employee
    Posted Dec 09, 2019 11:21 AM
    Hi Zach, what does the WSAPI doc show you for that custom field?

    https://rally1.rallydev.com/slm/doc/webservice/

    E.g. 


    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 5.  RE: Modify Hidden Fields in Custom App

    Posted Dec 09, 2019 11:33 AM
    This is what I found:




  • 6.  RE: Modify Hidden Fields in Custom App

    Broadcom Employee
    Posted Dec 09, 2019 12:40 PM
    OK, so I delved into the code for the grid. Only to find that it has a load of stuff to try and prevent you doing anything with fields that are hidden. You can trawl through and create overrides, but it might take you a while.

    Here is the code snippet I used to override the hiding of the column, but that was just the beginning......

    Ext.define('Rally.ui.grid.ColumnBuilderFix', {
    extend: 'Rally.ui.grid.ColumnBuilder',
    statics: {
    ICON_FIELDS: ['Defects', 'Dicsussion', 'DisplayColor', 'Milestones', 'PredecessorsAndSuccessors', 'Tags', 'Tasks', 'TestCases'],
    ICON_HEADER_FIELDS: { PredecessorsAndSuccessors: 'predecessor' },
    },
    _removeHiddenColumns: function (arg) {
    return arg;
    },
    });

    Ext.define('CustomApp', {
    extend: 'Rally.app.App',
    componentCls: 'app',
    fieldList: [
    'FormattedID',
    'Name',
    'c_RequiredBy'
    ],

    launch: function () {
    var me = this;

    var store = Ext.create('Rally.data.wsapi.Store', {
    model: 'User Story',
    autoLoad: true,
    fetch: me.fieldList,
    listeners: {
    load: function (store, records, success) {
    me.addGrid(store);
    },
    scope: me
    }
    });
    },
    addGrid: function (store) {
    var me = this;
    var context = this.getContext();
    var modelName = 'defect';
    this.add({
    xtype: 'rallygrid',
    context: context,
    model: modelName,
    stateful: false,
    storeConfig: {
    store: store,
    remoteFilter: false,
    },
    buildColumns: function (models) {
    return Ext.create('Rally.ui.grid.ColumnBuilderFix').
    withContext(this.getContext()).
    withEditingEnabled(this.enableEditing).
    withRankingEnabled(this.enableRanking).
    withDefaultColumns(this.columnCfgs).
    withSortableColumns(this.sortableColumns).
    shouldAutoAddAllModelFieldsAsColumns(this.autoAddAllModelFieldsAsColumns).
    shouldShowRowActionsColumn((this.showRowActionsColumn && this.rowActionColumnConfig) || this.showRowActionsColumn).
    withDisableColumnMenus(this.disableColumnMenus).
    withEditorsDisabledForColumns(this._getDisabledEditorColumns(models)).
    build(models);
    },
    columnCfgs: me.fieldList
    });
    }
    });


    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 7.  RE: Modify Hidden Fields in Custom App

    Posted Dec 09, 2019 01:25 PM
    Maybe this is a good idea for an Idea submission?

    The request kind of reminds me of Microsoft's "Hidden" attribute for files.  Setting the "Hidden" flag normally hides a file from directory listings, but Windows Explorer gives users the option to "Display Hidden Files".

    https://support.microsoft.com/en-us/help/14201/windows-show-hidden-files


  • 8.  RE: Modify Hidden Fields in Custom App
    Best Answer

    Broadcom Employee
    Posted Dec 10, 2019 11:40 AM
    Hi Zach,

    You know how sometimes when you are not thinking about a problem, the solution comes into your head....well.....

    The problem lies in that the field is marked as hidden in the project that you are trying to access it. The only scenario I can think of is that the field is enabled higher up the project hierarchy, at a level that normal users can't see. You app can be run in that top level project and will be able to read/modify the field contents as a normal field. Your app can also see all the defects in the tree below, so you would have to apply filters to get those in a particular team node. The users, who normally reside lower down the project tree cannot see the field in the Defect QDP or FDP because those apps respect the hidden attribute.

    If you build the Saved Views capability into your custom app (e.g. by using a gridboard), you could have a number of team specific views each with it's own filter settings in.

    ------------------------------
    Nik
    Rally Sales Engineer
    Rally Software
    ------------------------------



  • 9.  RE: Modify Hidden Fields in Custom App

    Posted Dec 10, 2019 12:39 PM
    Hi Nik,

    I tried this and it works! Thank you so much! Instead of defining the app at the top of the hierarchy I can also define it at the teams parent project and as long as its not defined for the child project it wont show in the defect view. Not sure what the best way to define the field in our our project structure is yet, whether its at the root with an extra filter option the user has to select the project(s) or at each team node which reduces this filter. Ill have to figure this out with some feedback from our teams, but thanks for the follow up this works the way I want it to now!

    Ex:
    • Root                                 -Field cant be set to visible here as well
      • Team1                    -Field set to visible here
        • project1
        • project2
      • Team2                    -Field set to visible here
        • project1
      • Team3                    -Field set to visible here

    Thanks again,
    ~Zach